From 2c741e06f332d95989f53736a80b79909e024133 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 5 Mar 2019 15:09:34 +0100 Subject: [PATCH] Eliminate latent, per package deploy directory Same process as for the build dir. We have one intermediate deploy directory that the packaes installs it self to, then we package the contents, finally we nuke the build and deploy directory before starting with the next package. Signed-off-by: David Oberhollenzer --- mk.sh | 12 ++++++------ pkg/release-alix/build | 2 +- pkg/release-qemu/build | 2 +- pkg/release-rpi3/build | 2 +- util/misc.sh | 2 +- util/pkgcmd.sh | 7 ++----- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/mk.sh b/mk.sh index f9cc9b6..da7633d 100755 --- a/mk.sh +++ b/mk.sh @@ -31,7 +31,7 @@ REPODIR="$BUILDROOT/$PRODUCT/repo" DEPENDSLIST="$BUILDROOT/$PRODUCT/depends" PROVIDESLIST="$BUILDROOT/$PRODUCT/provides" -mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGLOGDIR" "$PKGDEPLOYDIR" +mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGLOGDIR" mkdir -p "$REPODIR" pushd "$SCRIPTDIR" > /dev/null @@ -101,16 +101,16 @@ while read pkg; do run_pkg_command "build" run_pkg_command "deploy" - deploy_dev_cleanup "$PKGDEPLOYDIR/$PKGNAME" - strip_files ${PKGDEPLOYDIR}/${PKGNAME}/{bin,lib} + deploy_dev_cleanup "$PKGDEPLOYDIR" + strip_files ${PKGDEPLOYDIR}/{bin,lib} for f in $SUBPKG; do pkg pack -r "$REPODIR" \ - -d "$PKGDEPLOYDIR/$PKGNAME/${f}.desc" \ - -l "$PKGDEPLOYDIR/$PKGNAME/${f}.files" + -d "$PKGDEPLOYDIR/${f}.desc" \ + -l "$PKGDEPLOYDIR/${f}.files" done - rm -rf "$PKGBUILDDIR" + rm -rf "$PKGBUILDDIR" "$PKGDEPLOYDIR" touch "$PKGLOGDIR/.$pkg" fi done < "$PACKAGELIST" diff --git a/pkg/release-alix/build b/pkg/release-alix/build index da3cf0e..1c40ea1 100755 --- a/pkg/release-alix/build +++ b/pkg/release-alix/build @@ -25,7 +25,7 @@ deploy() { local SOURCE="$1" local DEPLOY="$2" - tar czf "$DEPLOY/$PKGNAME.tar.gz" * + tar czf "$BUILDROOT/$PRODUCT/$PKGNAME.tar.gz" * touch "$2/$PKGNAME.files" cat > "$2/$PKGNAME.desc" <<_EOF diff --git a/pkg/release-qemu/build b/pkg/release-qemu/build index f1a571a..5032939 100755 --- a/pkg/release-qemu/build +++ b/pkg/release-qemu/build @@ -29,7 +29,7 @@ deploy() { local SOURCE="$1" local DEPLOY="$2" - tar czf "$DEPLOY/$PKGNAME.tar.gz" * + tar czf "$BUILDROOT/$PRODUCT/$PKGNAME.tar.gz" * touch "$2/$PKGNAME.files" cat > "$2/$PKGNAME.desc" <<_EOF diff --git a/pkg/release-rpi3/build b/pkg/release-rpi3/build index 43534cb..6a92d43 100755 --- a/pkg/release-rpi3/build +++ b/pkg/release-rpi3/build @@ -27,7 +27,7 @@ deploy() { local SOURCE="$1" local DEPLOY="$2" - tar czf "$DEPLOY/$PKGNAME.tar.gz" * + tar czf "$BUILDROOT/$PRODUCT/$PKGNAME.tar.gz" * touch "$2/$PKGNAME.files" cat > "$2/$PKGNAME.desc" <<_EOF diff --git a/util/misc.sh b/util/misc.sh index 9b0c7aa..13fbbba 100644 --- a/util/misc.sh +++ b/util/misc.sh @@ -41,7 +41,7 @@ deploy_dev_cleanup() { } unfuck_libtool() { - local libdir="$PKGDEPLOYDIR/$PKGNAME/lib" + local libdir="$PKGDEPLOYDIR/lib" local f for f in $(find $PKGBUILDDIR -type f -name '*.la' -o -name '*.lai'); do diff --git a/util/pkgcmd.sh b/util/pkgcmd.sh index b75edc9..2edd34e 100644 --- a/util/pkgcmd.sh +++ b/util/pkgcmd.sh @@ -12,17 +12,14 @@ include_pkg() { run_pkg_command() { local FUNCTION="$1" - local DEPLOYDIR="$PKGDEPLOYDIR/$PKGNAME" local LOGFILE="$PKGLOGDIR/${PKGNAME}-${FUNCTION}.log" local SRC="$PKGSRCDIR/$SRCDIR" echo "$PKGNAME - $FUNCTION" - mkdir -p "$PKGBUILDDIR" "$DEPLOYDIR" + mkdir -p "$PKGBUILDDIR" "$PKGDEPLOYDIR" pushd "$PKGBUILDDIR" > /dev/null - $FUNCTION "$SRC" "$DEPLOYDIR" &>> "$LOGFILE" < /dev/null + $FUNCTION "$SRC" "$PKGDEPLOYDIR" &>> "$LOGFILE" < /dev/null popd > /dev/null - - (rmdir "$DEPLOYDIR" || true) 2> /dev/null ; }