From 1dd4d6ff907682cd1ae941224d4b3bc02443f51e Mon Sep 17 00:00:00 2001 From: merakor Date: Sun, 4 Jul 2021 12:01:16 +0000 Subject: cpt-export: export manifest as is and make optimisations for pax FossilOrigin-Name: 1775aea1245c96453da6dfb0116b8864c935882a3811a8375289cf647635ad7f --- contrib/cpt-export | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/contrib/cpt-export b/contrib/cpt-export index 0e6ce6f..68d628d 100755 --- a/contrib/cpt-export +++ b/contrib/cpt-export @@ -20,11 +20,12 @@ case "$1" in '') set -- "${PWD##*/}" esac -cpt-list "${1:-null}" >/dev/null +cpt-list "$1" >/dev/null +db=$CPT_ROOT/var/db/cpt/installed # Grab the package's version.. -read -r ver rel 2>/dev/null < \ - "$CPT_ROOT/var/db/cpt/installed/$1/version" +read -r ver rel 2>/dev/null < "$db/$1/version" + ### Environment variables: ### The compression method can be changed while creating a tarball, using the @@ -35,17 +36,12 @@ read -r ver rel 2>/dev/null < \ case "$CPT_COMPRESS" in bz2|gz|xz|zst|lz) ;; *) CPT_COMPRESS=gz; esac # Reset the argument list. -pkg=$1 tarball="$PWD/$1#$ver-$rel.tar.$CPT_COMPRESS" -set -- - -# Construct the argument list using each file. -eval set -- "$(sed '/\/$/d;s|^|".|;s|$|"|' \ - "$CPT_ROOT/var/db/cpt/installed/$pkg/manifest" | tr '\n' ' ')" # Turn the list of files back into a package. cd "$CPT_ROOT/" -pax -w -- "$@" | +sed 's/^/./' "$db/$1/manifest" | +pax -wd | case "$CPT_COMPRESS" in bz2) bzip2 -z ;; -- cgit v1.2.3