From 9fdc5c3f07e3592fed8ef4202f6c1362ed773a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 6 Apr 2018 18:49:43 +0200 Subject: personal-utils: fix gentoo-mount prints and check for DIR --- sys-apps/personal-utils/files/gentoo-mount | 22 +++++++++++++--------- .../personal-utils/personal-utils-1.5-r1.ebuild | 15 --------------- .../personal-utils/personal-utils-1.5.1-r1.ebuild | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 24 deletions(-) delete mode 100644 sys-apps/personal-utils/personal-utils-1.5-r1.ebuild create mode 100644 sys-apps/personal-utils/personal-utils-1.5.1-r1.ebuild (limited to 'sys-apps/personal-utils') diff --git a/sys-apps/personal-utils/files/gentoo-mount b/sys-apps/personal-utils/files/gentoo-mount index f3cd674..812d7d5 100755 --- a/sys-apps/personal-utils/files/gentoo-mount +++ b/sys-apps/personal-utils/files/gentoo-mount @@ -35,6 +35,10 @@ if [ $(id -u) != 0 ]; then echo "This script has to be run only as root." >&2 exit 1 fi +if [ ! -d "$DIR" ]; then + echo "No DIR specified or no such directory exists: $DIR" >&2 + exit 1 +fi # Interactive mount @@ -48,13 +52,13 @@ imount() { return mount -o "$3" "$1" "$2" fi - echo "\e[1;32mPlease choose device\e[0m" + echo -e "\e[1;32mPlease choose device\e[0m" lsblk -o NAME,LABEL,SIZE,FSTYPE,MOUNTPOINT while true; do echo -n "Device: /dev/" read DEVICE if [ ! -b "/dev/$DEVICE" ]; then - echo "No such device: /dev/$DEVICE" >&2 + echo -e "No such device: /dev/$DEVICE" >&2 else break fi @@ -66,7 +70,7 @@ imount() { while [ -e "/dev/mapper/$CSNAME" ]; do CSNAME="${CSNAME}2" done - echo "\e[1;32mOpening encrypted filesystem\e[0m" + echo -e "\e[1;32mOpening encrypted filesystem\e[0m" cryptsetup open "/dev/$DEVICE" "$CSNAME" DEVICE="mapper/$CSNAME" fi @@ -83,7 +87,7 @@ imount() { local TMP="$(mktemp -d)" mount "/dev/$DEVICE" "$TMP" while true; do - echo "\e[1;32mPlease choose subvolume\e[0m" + echo -e "\e[1;32mPlease choose subvolume\e[0m" btrfs subvolume list -t "$TMP" # TODO default value? Probably same as name? echo -n "Subvolume: " @@ -102,24 +106,24 @@ imount() { } # Mount root filesystem ########################################################## -echo "\e[1;34mMount root filesystem\e[0m" +echo -e "\e[1;34mMount root filesystem\e[0m" imount "$DEV_ROOT" "$DIR" "" root # Mount system paths ############################################################# -echo "\e[1;34mMount system paths\e[0m" +echo -e "\e[1;34mMount system paths\e[0m" mount -t proc /proc "$DIR/proc" mount --rbind /dev "$DIR/dev" mount --rbind /sys "$DIR/sys" # Copy current resolv.conf ####################################################### -echo "\e[1;34mCopy system resolv.conf\e[0m" +echo -e "\e[1;34mCopy system resolv.conf\e[0m" cp /etc/resolv.conf "$DIR/etc/resolv.conf" # Mount boot partition ########################################################### -echo "\e[1;34mMount boot partition\e[0m" +echo -e "\e[1;34mMount boot partition\e[0m" imount "$DEV_BOOT" "$DIR/boot" # Mount home partition ########################################################### -echo "\e[1;34mMount home partition\e[0m" +echo -e "\e[1;34mMount home partition\e[0m" imount "$DEV_HOME" "$DIR/home" diff --git a/sys-apps/personal-utils/personal-utils-1.5-r1.ebuild b/sys-apps/personal-utils/personal-utils-1.5-r1.ebuild deleted file mode 100644 index 0f40c22..0000000 --- a/sys-apps/personal-utils/personal-utils-1.5-r1.ebuild +++ /dev/null @@ -1,15 +0,0 @@ -EAPI=6 - -DESCRIPTION="My simple personal system utilities" -HOMEPAGE="http://git.cynerd.cz/gentoo-personal-overlay/" -S="${WORKDIR}" - -LICENSE="GPL-3.0+" -SLOT="0" -KEYWORDS="amd64 x86" - -src_install() { - exeinto /usr/sbin - doexe "${FILESDIR}/emergefix" - doexe "${FILESDIR}/gentoo-mount" -} diff --git a/sys-apps/personal-utils/personal-utils-1.5.1-r1.ebuild b/sys-apps/personal-utils/personal-utils-1.5.1-r1.ebuild new file mode 100644 index 0000000..0f40c22 --- /dev/null +++ b/sys-apps/personal-utils/personal-utils-1.5.1-r1.ebuild @@ -0,0 +1,15 @@ +EAPI=6 + +DESCRIPTION="My simple personal system utilities" +HOMEPAGE="http://git.cynerd.cz/gentoo-personal-overlay/" +S="${WORKDIR}" + +LICENSE="GPL-3.0+" +SLOT="0" +KEYWORDS="amd64 x86" + +src_install() { + exeinto /usr/sbin + doexe "${FILESDIR}/emergefix" + doexe "${FILESDIR}/gentoo-mount" +} -- cgit v1.2.3