-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniele Rondina
committed
Aug 2, 2023
1 parent
b1d39e4
commit 82e0d99
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# Author: Daniele Rondina, geaaru@funtoo.org | ||
# Description: Generate or Update the luet-portage-converter layer file of the | ||
# selected layer. | ||
# | ||
# Example: | ||
# $> LAYER_NAME=funtoo-base sh scripts/create-pc-layer.sh | ||
|
||
REPO_DIR=$(dirname ${BASH_SOURCE[0]})/.. | ||
|
||
LAYER_NAME=${LAYER_NAME:-} | ||
PKGLIST=${PKGLIST:-/usr/share/macaroni/layers/${LAYER_NAME}/pkgslist} | ||
|
||
LAYER_FILE=${LAYER_FILE:-${REPO_DIR}/portage-converter/layers/${LAYER_NAME}.yaml} | ||
|
||
if [ -z "${LAYER_NAME}" ] ; then | ||
echo "Missing LAYER_NAME env" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -e ${PKGLIST} ] ; then | ||
echo "The file ${PKGLIST} doesn't exist." | ||
exit 1 | ||
fi | ||
|
||
# Delete current packages list | ||
yq d ${LAYER_FILE} 'packages' -i | ||
|
||
echo "packages:" >> ${LAYER_FILE} | ||
|
||
pkgs-checker pkglist show -r ${PKGLIST} -j -p -v | \ | ||
jq '.packages[] | " - "+ .category + "/" + .name + ":" + .slot' -r | \ | ||
sort >> ${LAYER_FILE} | ||
|