From c3a84adda049e53d9ea94507bf05e695e1575def Mon Sep 17 00:00:00 2001
From: merakor <cem@ckyln.com>
Date: Mon, 11 Jan 2021 17:32:01 +0000
Subject: cpt-export: change directory in a subshell

FossilOrigin-Name: 063411c0c7d0323b39f8d915486cda56ab77155d89c764870018ace267630445
---
 contrib/cpt-export | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'contrib')

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 ;;
-- 
cgit v1.2.3