root/scripts/extra-packages.script @ bd62049a
3e290f5a | Jorge L. Florit | #!/bin/sh
|
|
ee446b02 | Jorge L. Florit | ||
PREPOST="$1"
|
|||
shift
|
|||
TBUILD="$1"
|
|||
shift
|
|||
shift
|
|||
EXTRA_PACKS="$@"
|
|||
3e290f5a | Jorge L. Florit | FILE="build/${TBUILD}/.config"
|
|
[ -z "$TBUILD" ] || [ ! -d "build/$TBUILD" ] || [ ! -f "$FILE" ] && exit 1
|
|||
ee446b02 | Jorge L. Florit | ||
for i in $EXTRA_PACKS; do
|
|||
3e290f5a | Jorge L. Florit | AUX="$(grep $i $FILE)"
|
|
[ ! -z "$AUX" ] && {
|
|||
0bbc22a4 | Jorge L. Florit | [ "$PREPOST" = "PRE_BUILD" ] && echo "- Adding extra package: $i" >&2 && sed -i -e s/"${AUX}"/"CONFIG_PACKAGE_$i=y"/g $FILE
|
|
[ "$PREPOST" = "POST_BUILD" ] && echo "- Removing extra package: $1" >&2 && sed -i -e s/"${AUX}"/"# CONFIG_PACKAGE_$i is not set"/g $FILE
|
|||
3e290f5a | Jorge L. Florit | }
|
|
ee446b02 | Jorge L. Florit | done
|