diff options
Diffstat (limited to 'build-pkg-rpm')
-rw-r--r-- | build-pkg-rpm | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/build-pkg-rpm b/build-pkg-rpm index c0f9653..fc6a421 100644 --- a/build-pkg-rpm +++ b/build-pkg-rpm @@ -109,7 +109,17 @@ pkg_cumulate_rpm() { } pkg_install_rpm() { - ( chroot $BUILD_ROOT rpm --ignorearch --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \ + export ADDITIONAL_PARAMS= + if test "$USE_FORCE" = true ; then + export ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --force" + fi + # work around for cross-build installs, we must not overwrite the running rpm + if test "$PKG" = rpm ; then + for i in $BUILD_ROOT/.init_b_cache/preinstalls/rpm-x86-* ; do + test -e "$i" && ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --justdb" + done + fi + ( cd $BUILD_ROOT && chroot $BUILD_ROOT rpm --ignorearch --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \ $ADDITIONAL_PARAMS .init_b_cache/$PKG.rpm 2>&1 || \ touch $BUILD_ROOT/exit ) | \ grep -v "^warning:.*saved as.*rpmorig$" @@ -125,8 +135,8 @@ pkg_finalize_rpm() { rm -f $BUILD_ROOT/${CUMULATED_LIST[$num]} cp $BUILD_ROOT/.init_b_cache/rpms/$PKG $BUILD_ROOT/${CUMULATED_LIST[$num]} || cleanup_and_exit 1 done > $BUILD_ROOT/.init_b_cache/manifest - chroot $BUILD_ROOT rpm --ignorearch --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \ - $ADDITIONAL_PARAMS .init_b_cache/manifest 2>&1 || touch $BUILD_ROOT/exit + ( cd $BUILD_ROOT && chroot $BUILD_ROOT rpm --ignorearch --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \ + $ADDITIONAL_PARAMS .init_b_cache/manifest 2>&1 || touch $BUILD_ROOT/exit ) for ((num=0; num<=cumulate; num++)) ; do rm -f $BUILD_ROOT/${CUMULATED_LIST[$num]} done @@ -182,12 +192,12 @@ pkg_preinstall_rpm() { pkg_runscripts_rpm() { if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre" ; then echo "running $PKG preinstall script" - chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.pre" 0 + (cd $BUILD_ROOT && chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.pre" 0) rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre" fi if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then echo "running $PKG postinstall script" - chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.post" 1 + (cd $BUILD_ROOT && chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.post" 1) rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" fi } |