aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-05-13 03:33:39 +0300
committerCem Keylan <cem@ckyln.com>2020-05-13 03:33:39 +0300
commit7a75d6d44e194540de84cabadedfa3c9a31f226f (patch)
tree166486fbfcd6b70da2eb5e43d0ec3a4f9ce3887d
parentbaa1cfb1e2f9a3d9443c481028f9499bcfbe6e93 (diff)
downloadmkrootfs-7a75d6d44e194540de84cabadedfa3c9a31f226f.tar.gz
minor nitpicks
-rwxr-xr-xmkrootfs.sh14
1 files changed, 5 insertions, 9 deletions
diff --git a/mkrootfs.sh b/mkrootfs.sh
index a65d2aa..453e005 100755
--- a/mkrootfs.sh
+++ b/mkrootfs.sh
@@ -11,7 +11,7 @@ die() { printf '\033[1;31m!> ERROR: \033[m%s\n' "$@" >&2; exit 1 ;}
# Exit if the user is not root
-! [ "$(id -u)" -eq 0 ] && die "Please run as root"
+[ "$(id -u)" -eq 0 ] || die "Please run as root"
# Let's get current working directory
BASEDIR="$PWD"
@@ -20,11 +20,11 @@ BASEDIR="$PWD"
# to config. After we make sure config file is
# in place, we source the contents
! [ -e config ] && cp config.def config
-. "$PWD/config"
+. "${0%/*}/config"
# Check whether absolutely required variables are set.
-[ -n "$PKGS" ] || die "You must set PKGS variable to continue the bootstrapper"
-[ -n "$MNTDIR" ] || die "You must specify fakeroot location \"MNTDIR\" in order to continue the bootstrapper"
+[ "$PKGS" ] || die "You must set PKGS variable to continue the bootstrapper"
+[ "$MNTDIR" ] || die "You must specify fakeroot location 'MNTDIR' in order to continue the bootstrapper"
# Print variables from the configuration file
@@ -46,10 +46,7 @@ PKGS = $PKGS
EOF
-# Check if there is no NOWELCOME variable set in
-# the configuration file. If there is such variable
-# set in the configuration, the bootstrapper will
-# start immediately
+# If there is NOCONFIRM, skip the prompt.
[ "$NOCONFIRM" ] || {
printf '\033[1;33m?> \033[mDo you want to start the bootstrapper? (y/N)\n'
read -r ans
@@ -73,7 +70,6 @@ rm -rf "$MNTDIR/var/db/kiss/repo"
git clone --depth 1 "$REPO" "$MNTDIR/var/db/kiss/repo"
export KISS_PATH="${HOST_REPO_PATH:-/tmp/repo/core}"
-
msg "Starting build from the PKGS variable"
# Word Splitting is intentional here, as we are