summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Leone <simo@archlinux.org>2007-10-06 21:58:16 -0500
committerAaron Griffin <aaronmgriffin@gmail.com>2007-10-06 21:58:16 -0500
commit192b24f829953ff2bb0e86ac6bdc686b42d9f0b8 (patch)
tree9a2be0e212091d999ec7e7425f7cbf28dc6d4462
parent656a54014bb63dc1ce5b6f3037111fbbbd786529 (diff)
downloaddevtools-192b24f829953ff2bb0e86ac6bdc686b42d9f0b8.tar.xz
Trap EXIT and use relative cache and db paths
Trapping exit ensures that unmounting occurs in the event of an exit 1 or a normal exit. Pacman 3.0.6 takes cachedir and dbpath to be relative to it's given root, not absolute. Signed-off-by: Simo Leone <simo@archlinux.org> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xmkarchroot7
1 files changed, 4 insertions, 3 deletions
diff --git a/mkarchroot b/mkarchroot
index 22697ca..2a02196 100755
--- a/mkarchroot
+++ b/mkarchroot
@@ -65,7 +65,7 @@ function chroot_mount ()
[ -e "${working_dir}/var/cache/pacman" ] || mkdir -p "${working_dir}/var/cache/pacman"
mount -o bind /var/cache/pacman "${working_dir}/var/cache/pacman"
- trap 'chroot_umount' 1 2 15
+ trap 'chroot_umount' 0 1 2 15
}
function chroot_umount ()
@@ -111,8 +111,9 @@ else
pacargs="--noconfirm -v " #--noprogressbar -v
pacargs="$pacargs --root=${working_dir}"
- pacargs="$pacargs --dbpath=${working_dir}/var/lib/pacman"
- pacargs="$pacargs --cachedir=${working_dir}/var/cache/pacman"
+ # pacman takes these as relative to the given root
+ pacargs="$pacargs --dbpath=/var/lib/pacman"
+ pacargs="$pacargs --cachedir=/var/cache/pacman/pkg"
if [ $# -eq 0 ]; then
echo "no packages to install"