Skip to content
Snippets Groups Projects
Commit a8b64995 authored by Allan McRae's avatar Allan McRae Committed by Pierre Schmitz
Browse files

makechrootpkg: fix error message


Passing a directory that does not exist to makechrootpkg results in
an error message:

==> ERROR: No chroot dir defined, or invalid path ''

The path is not being printed as the readlink command blanks it if
the directory does not exist. Fix this.

Signed-off-by: default avatarAllan McRae <allan@archlinux.org>
Signed-off-by: default avatarPierre Schmitz <pierre@archlinux.de>
parent 2c9855fe
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ install_pkg= ...@@ -20,6 +20,7 @@ install_pkg=
add_to_db=false add_to_db=false
run_namcap=false run_namcap=false
chrootdir= chrootdir=
passeddir=
default_copy=$USER default_copy=$USER
[[ -n $SUDO_USER ]] && default_copy=$SUDO_USER [[ -n $SUDO_USER ]] && default_copy=$SUDO_USER
...@@ -63,7 +64,7 @@ while getopts 'hcudr:I:l:n' arg; do ...@@ -63,7 +64,7 @@ while getopts 'hcudr:I:l:n' arg; do
c) clean_first=true ;; c) clean_first=true ;;
u) update_first=true ;; u) update_first=true ;;
d) add_to_db=true ;; d) add_to_db=true ;;
r) chrootdir="$OPTARG" ;; r) passeddir="$OPTARG" ;;
I) install_pkg="$OPTARG" ;; I) install_pkg="$OPTARG" ;;
l) copy="$OPTARG" ;; l) copy="$OPTARG" ;;
n) run_namcap=true ;; n) run_namcap=true ;;
...@@ -72,7 +73,7 @@ while getopts 'hcudr:I:l:n' arg; do ...@@ -72,7 +73,7 @@ while getopts 'hcudr:I:l:n' arg; do
done done
# Canonicalize chrootdir, getting rid of trailing / # Canonicalize chrootdir, getting rid of trailing /
chrootdir=$(readlink -e "$chrootdir") chrootdir=$(readlink -e "$passeddir")
if [[ ${copy:0:1} = / ]]; then if [[ ${copy:0:1} = / ]]; then
copydir=$copy copydir=$copy
...@@ -101,7 +102,7 @@ if [[ ! -f PKGBUILD && -z $install_pkg ]]; then ...@@ -101,7 +102,7 @@ if [[ ! -f PKGBUILD && -z $install_pkg ]]; then
fi fi
if [[ ! -d $chrootdir ]]; then if [[ ! -d $chrootdir ]]; then
die "No chroot dir defined, or invalid path '$chrootdir'" die "No chroot dir defined, or invalid path '$passeddir'"
fi fi
if [[ ! -d $chrootdir/root ]]; then if [[ ! -d $chrootdir/root ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment