aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-01-11 17:32:01 +0000
committermerakor <cem@ckyln.com>2021-01-11 17:32:01 +0000
commitc3a84adda049e53d9ea94507bf05e695e1575def (patch)
treebfa7dfbb474d837d13f6049ee59fb31ed958bf5f /contrib
parentd49469e1e562b8b2fdbac5348cab3a568ab4a4b5 (diff)
downloadcpt-c3a84adda049e53d9ea94507bf05e695e1575def.tar.gz
cpt-export: change directory in a subshell
FossilOrigin-Name: 063411c0c7d0323b39f8d915486cda56ab77155d89c764870018ace267630445
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cpt-export6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/cpt-export b/contrib/cpt-export
index 9b4edd1..87ba2da 100755
--- a/contrib/cpt-export
+++ b/contrib/cpt-export
@@ -25,8 +25,10 @@ while read -r file; do
done < "$CPT_ROOT/var/db/cpt/installed/$pkg/manifest"
# Turn the list of files back into a package.
-: "${CPT_COMPRESS:=gz}"
-tar cf - -C / -- "$@" | case "$CPT_COMPRESS" in
+(cd "$CPT_ROOT/"
+ tar cf - -- "$@" || exit 1) |
+
+case "$CPT_COMPRESS" in
bz2) bzip2 -z ;;
gz) gzip -6 ;;
xz) xz -zT 0 ;;