Skip to content

Commit 0d1d41c

Browse files
committed
Fix with pwd
1 parent 0ba0859 commit 0d1d41c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

archbashstrap

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pacstrap() {
6565
else
6666
:
6767
fi
68+
_curdir="$(pwd)"
6869
msg "Downloading core.db & extra.db"
6970
curl -s -L -S $MIRROR/core/os/x86_64/core.db -o core.db || die "Error during getting core.db"
7071
curl -s -L -S $MIRROR/extra/os/x86_64/extra.db -o extra.db || die "Error during getting extra.db"
@@ -214,7 +215,7 @@ pacstrap() {
214215
rm -rf "$tmp_dir"/*
215216
done < <(echo -e "${parsed}" | cut -d " " -f 3 | sed '$d') || return 1
216217
mkdir -m 755 -p "$folder"/etc/pacman.d
217-
if [ ! -f "$PWD/../arch_mirrorlist" ]; then echo 'Server = '$MIRROR'/$repo/os/$arch' >"$folder"/etc/pacman.d/mirrorlist; fi
218+
if [ ! -f "$_curdir/arch_mirrorlist" ]; then echo 'Server = '$MIRROR'/$repo/os/$arch' >"$folder"/etc/pacman.d/mirrorlist; fi
218219
echo "9" >"$folder"/var/lib/pacman/local/ALPM_DB_VERSION
219220
if [ "$NOCHROOT" != 1 ]; then
220221
echo ""
@@ -238,7 +239,7 @@ EOF
238239
umount "$folder"/sys
239240
umount -l "$folder"/dev
240241
fi
241-
rm -rf "$PWD"/../{core_db,extra_db,download}
242+
rm -rf "$_curdir"/{core_db,extra_db,download}
242243
rm -rf "${tmp_dir}"
243244
msg "DONE!"
244245
}
@@ -253,17 +254,17 @@ mkdir -m 0755 -p "$folder"/var/{cache/pacman/pkg,lib/pacman,log} "$folder"/{dev,
253254
mkdir -m 1777 -p "$folder"/tmp
254255
mkdir -m 0555 -p "$folder"/{sys,proc}
255256

256-
if [[ -d ./arch_gnupg ]]; then
257+
if [[ -d "$_curdir"/arch_gnupg ]]; then
257258
# if there's a keyring on the host, copy it into the new root, unless it exists already
258-
cp -a ./arch_gnupg "$folder/etc/pacman.d/gnupg"
259+
cp -a "$_curdir"/arch_gnupg "$folder/etc/pacman.d/gnupg"
259260
fi
260261

261262
if ! pacstrap "$folder"; then
262263
die 'Failed to install packages to new root'
263264
fi
264265

265-
if [[ -f ./arch_mirrorlist ]]; then
266+
if [[ -f "$_curdir"/arch_mirrorlist ]]; then
266267
# install the host's mirrorlist onto the new root
267-
cp ./arch_mirrorlist "$folder/etc/pacman.d/mirrorlist"
268+
cp "$_curdir"/arch_mirrorlist "$folder/etc/pacman.d/mirrorlist"
268269
chmod 644 "$folder"/etc/pacman.d/mirrorlist
269270
fi

0 commit comments

Comments
 (0)