diff --git a/config/options b/config/options index 399341f007..cfeca9ce85 100644 --- a/config/options +++ b/config/options @@ -57,6 +57,9 @@ fi # multi-processor computer (like hyperthreading SMP CPU) CONCURRENCY_MAKE_LEVEL=`cat /proc/cpuinfo | grep -c '^processor[[:cntrl:]]*:'` +# forcing install of all packages (yes/no) + FORCE_INSTALL=no + # set jpeg library depending on ARCH if [ "$TARGET_ARCH" = "i386" -o "$TARGET_ARCH" = "x86_64" ]; then LIBJPEG="libjpeg-turbo" diff --git a/config/path b/config/path index cf9ad9de54..ead51f3f65 100644 --- a/config/path +++ b/config/path @@ -43,7 +43,7 @@ TARGET_ADDONS="$TARGET_IMG/$ADDONS/$ADDON_PATH" ADDON_BUILD="$BUILD/$ADDONS/$1" STAMPS_NOARCH=.stamps STAMPS=$BUILD/.stamps -INSTALLSTAMPS=$BUILD/.install +STAMPS_INSTALL=$BUILD/image/.stamps DOCS=DOCS TOOLCHAIN=$BUILD/toolchain SYSROOT_PREFIX=$ROOT/$TOOLCHAIN/$TARGET_NAME/sysroot diff --git a/scripts/install b/scripts/install index 357f0a0475..e0f5cce301 100755 --- a/scripts/install +++ b/scripts/install @@ -2,58 +2,61 @@ . config/options $1 +STAMP=$STAMPS_INSTALL/$1/install + if [ -z "$1" ]; then echo "usage: $0 package_name" exit 1 fi -# mkdir -p $INSTALLSTAMPS/$1 -# INSTALLSTAMP=$INSTALLSTAMPS/$1/install +mkdir -p $STAMPS_INSTALL/$1 -# if [ $1 = "image" ]; then -# rm -rf $INSTALLSTAMPS -# mkdir -p $INSTALLSTAMPS/image -# fi +if [ -f $STAMP -a $PKG_DIR/install -nt $STAMP ]; then + rm -f $STAMP +fi -# if [ ! -f $INSTALLSTAMP ]; then +[ -f $STAMP -a $FORCE_INSTALL = "no" ] && exit 0 - if [ -f $PKG_DIR/arch ]; then - grep -q "$TARGET_ARCH" "$PKG_DIR/arch" || exit 0 - grep -q "\-$TARGET_ARCH" "$PKG_DIR/arch" && exit 0 - fi +if [ -f $PKG_DIR/arch ]; then + grep -q "$TARGET_ARCH" "$PKG_DIR/arch" || exit 0 + grep -q "\-$TARGET_ARCH" "$PKG_DIR/arch" && exit 0 +fi - if [ -f $PKG_DIR/platform ]; then - grep -q "$TARGET_PLATFORM" "$PKG_DIR/platform" || exit 0 - grep -q "\-$TARGET_PLATFORM" "$PKG_DIR/platform" && exit 0 - fi +if [ -f $PKG_DIR/platform ]; then + grep -q "$TARGET_PLATFORM" "$PKG_DIR/platform" || exit 0 + grep -q "\-$TARGET_PLATFORM" "$PKG_DIR/platform" && exit 0 +fi - if [ -d $PKG_DIR/init.d ]; then - mkdir -p $INSTALL/etc/init.d - cp $PKG_DIR/init.d/* $INSTALL/etc/init.d/ - fi +if [ -d $PKG_DIR/init.d ]; then + mkdir -p $INSTALL/etc/init.d + cp $PKG_DIR/init.d/* $INSTALL/etc/init.d/ +fi - if [ -d $PKG_DIR/profile.d ]; then - mkdir -p $INSTALL/etc/profile.d - cp $PKG_DIR/profile.d/*.conf $INSTALL/etc/profile.d/ - fi +if [ -d $PKG_DIR/profile.d ]; then + mkdir -p $INSTALL/etc/profile.d + cp $PKG_DIR/profile.d/*.conf $INSTALL/etc/profile.d/ +fi - if [ -d $PKG_DIR/init.network ]; then - mkdir -p $INSTALL/etc/init.d/network - cp $PKG_DIR/init.network/* $INSTALL/etc/init.d/network/ - fi +if [ -d $PKG_DIR/init.network ]; then + mkdir -p $INSTALL/etc/init.d/network + cp $PKG_DIR/init.network/* $INSTALL/etc/init.d/network/ +fi - $SCRIPTS/build $@ - printf "%${INDENT}c INSTALL $1\n" >&$SILENT_OUT - #dialog --infobox "%${INDENT}c INSTALL $1\n" 15 40 - export INDENT=$((${INDENT:-1}+$INDENT_SIZE)) +$SCRIPTS/build $@ +printf "%${INDENT}c INSTALL $1\n" >&$SILENT_OUT +export INDENT=$((${INDENT:-1}+$INDENT_SIZE)) - for p in $PKG_DEPENDS; do - $SCRIPTS/install $p - done +for p in $PKG_DEPENDS; do + $SCRIPTS/install $p +done - if [ -f $PKG_DIR/install ]; then - $PKG_DIR/install $@ >&$VERBOSE_OUT - fi +if [ -f $PKG_DIR/install ]; then + $PKG_DIR/install $@ >&$VERBOSE_OUT +fi -# touch $INSTALLSTAMP -# fi +. $PROJECT_DIR/$PROJECT/options + +for i in `sed -n "s/^\([^#].*\)=\".*$/\1/p" $PROJECT_DIR/$PROJECT/options | grep -v "#"`; do + eval val=\$$i + echo "STAMP_$i=\"$val"\" >> $STAMP +done