1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00

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 <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-03-05 15:09:34 +01:00
parent 2afd8fc20b
commit 2c741e06f3
6 changed files with 12 additions and 15 deletions

12
mk.sh
View file

@ -31,7 +31,7 @@ REPODIR="$BUILDROOT/$PRODUCT/repo"
DEPENDSLIST="$BUILDROOT/$PRODUCT/depends" DEPENDSLIST="$BUILDROOT/$PRODUCT/depends"
PROVIDESLIST="$BUILDROOT/$PRODUCT/provides" PROVIDESLIST="$BUILDROOT/$PRODUCT/provides"
mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGLOGDIR" "$PKGDEPLOYDIR" mkdir -p "$PKGDOWNLOADDIR" "$PKGSRCDIR" "$PKGLOGDIR"
mkdir -p "$REPODIR" mkdir -p "$REPODIR"
pushd "$SCRIPTDIR" > /dev/null pushd "$SCRIPTDIR" > /dev/null
@ -101,16 +101,16 @@ while read pkg; do
run_pkg_command "build" run_pkg_command "build"
run_pkg_command "deploy" run_pkg_command "deploy"
deploy_dev_cleanup "$PKGDEPLOYDIR/$PKGNAME" deploy_dev_cleanup "$PKGDEPLOYDIR"
strip_files ${PKGDEPLOYDIR}/${PKGNAME}/{bin,lib} strip_files ${PKGDEPLOYDIR}/{bin,lib}
for f in $SUBPKG; do for f in $SUBPKG; do
pkg pack -r "$REPODIR" \ pkg pack -r "$REPODIR" \
-d "$PKGDEPLOYDIR/$PKGNAME/${f}.desc" \ -d "$PKGDEPLOYDIR/${f}.desc" \
-l "$PKGDEPLOYDIR/$PKGNAME/${f}.files" -l "$PKGDEPLOYDIR/${f}.files"
done done
rm -rf "$PKGBUILDDIR" rm -rf "$PKGBUILDDIR" "$PKGDEPLOYDIR"
touch "$PKGLOGDIR/.$pkg" touch "$PKGLOGDIR/.$pkg"
fi fi
done < "$PACKAGELIST" done < "$PACKAGELIST"

View file

@ -25,7 +25,7 @@ deploy() {
local SOURCE="$1" local SOURCE="$1"
local DEPLOY="$2" local DEPLOY="$2"
tar czf "$DEPLOY/$PKGNAME.tar.gz" * tar czf "$BUILDROOT/$PRODUCT/$PKGNAME.tar.gz" *
touch "$2/$PKGNAME.files" touch "$2/$PKGNAME.files"
cat > "$2/$PKGNAME.desc" <<_EOF cat > "$2/$PKGNAME.desc" <<_EOF

View file

@ -29,7 +29,7 @@ deploy() {
local SOURCE="$1" local SOURCE="$1"
local DEPLOY="$2" local DEPLOY="$2"
tar czf "$DEPLOY/$PKGNAME.tar.gz" * tar czf "$BUILDROOT/$PRODUCT/$PKGNAME.tar.gz" *
touch "$2/$PKGNAME.files" touch "$2/$PKGNAME.files"
cat > "$2/$PKGNAME.desc" <<_EOF cat > "$2/$PKGNAME.desc" <<_EOF

View file

@ -27,7 +27,7 @@ deploy() {
local SOURCE="$1" local SOURCE="$1"
local DEPLOY="$2" local DEPLOY="$2"
tar czf "$DEPLOY/$PKGNAME.tar.gz" * tar czf "$BUILDROOT/$PRODUCT/$PKGNAME.tar.gz" *
touch "$2/$PKGNAME.files" touch "$2/$PKGNAME.files"
cat > "$2/$PKGNAME.desc" <<_EOF cat > "$2/$PKGNAME.desc" <<_EOF

View file

@ -41,7 +41,7 @@ deploy_dev_cleanup() {
} }
unfuck_libtool() { unfuck_libtool() {
local libdir="$PKGDEPLOYDIR/$PKGNAME/lib" local libdir="$PKGDEPLOYDIR/lib"
local f local f
for f in $(find $PKGBUILDDIR -type f -name '*.la' -o -name '*.lai'); do for f in $(find $PKGBUILDDIR -type f -name '*.la' -o -name '*.lai'); do

View file

@ -12,17 +12,14 @@ include_pkg() {
run_pkg_command() { run_pkg_command() {
local FUNCTION="$1" local FUNCTION="$1"
local DEPLOYDIR="$PKGDEPLOYDIR/$PKGNAME"
local LOGFILE="$PKGLOGDIR/${PKGNAME}-${FUNCTION}.log" local LOGFILE="$PKGLOGDIR/${PKGNAME}-${FUNCTION}.log"
local SRC="$PKGSRCDIR/$SRCDIR" local SRC="$PKGSRCDIR/$SRCDIR"
echo "$PKGNAME - $FUNCTION" echo "$PKGNAME - $FUNCTION"
mkdir -p "$PKGBUILDDIR" "$DEPLOYDIR" mkdir -p "$PKGBUILDDIR" "$PKGDEPLOYDIR"
pushd "$PKGBUILDDIR" > /dev/null pushd "$PKGBUILDDIR" > /dev/null
$FUNCTION "$SRC" "$DEPLOYDIR" &>> "$LOGFILE" < /dev/null $FUNCTION "$SRC" "$PKGDEPLOYDIR" &>> "$LOGFILE" < /dev/null
popd > /dev/null popd > /dev/null
(rmdir "$DEPLOYDIR" || true) 2> /dev/null ;
} }