root/scripts/extra-packages.script @ f9904d97
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
|
|||
d418904d | Pau Escrich | PKG="CONFIG_PACKAGE_$i"
|
|
AUX="$(grep $PKG $FILE | tr -d '\n')"
|
|||
[ -n "$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
|
|
d418904d | Pau Escrich | [ "$PREPOST" = "POST_BUILD" ] && echo "- Removing extra package: $i" >&2 && sed -i -e s/"${AUX}"/"# CONFIG_PACKAGE_$i is not set"/g $FILE
|
|
3e290f5a | Jorge L. Florit | }
|
|
ee446b02 | Jorge L. Florit | done
|