Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/pacman-optimize.sh.in
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-14 10:11:43 -0600
committerDan McGee <dan@archlinux.org>2012-02-14 10:11:43 -0600
commit13a1d5883c9aa81ee10d61cbe4c2f2223dad9a50 (patch)
tree6f0af4989d98bbb3d5053a17199081ae05d51236 /scripts/pacman-optimize.sh.in
parentb4f5a63e7fee5d04949e290bd63e5f0e94bd211e (diff)
scripts: unset CDPATH if cd is used
This wonderful/awful little bash shell variable wrecks havoc on `cd` calls in shell scripts. Unset CDPATH in makepkg where we use `cd` quite heavily. In pacman-optimize, we can move the change directory logic into the bsdtar call so we are left with no usages of `cd` in the script. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/pacman-optimize.sh.in')
-rw-r--r--scripts/pacman-optimize.sh.in3
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/pacman-optimize.sh.in b/scripts/pacman-optimize.sh.in
index 47d8814a..8a4e7224 100644
--- a/scripts/pacman-optimize.sh.in
+++ b/scripts/pacman-optimize.sh.in
@@ -122,8 +122,7 @@ find "$dbroot" -type f | sort | xargs md5sum > "$workdir/pacsums.old"
# step 2: tar it up
msg "$(gettext "Tar'ing up %s...")" "$dbroot"
-cd "$dbroot"
-bsdtar -czf "$workdir/pacman-db.tar.gz" ./
+bsdtar -czf "$workdir/pacman-db.tar.gz" -C "$dbroot" ./
if (( $? )); then
rm -rf "$workdir"
die_r "$(gettext "Tar'ing up %s failed.")" "$dbroot"