Commit e59c0afc authored by Vitaly Lipatov's avatar Vitaly Lipatov

loginhsh: support -X -Y args, and -p option for override hasher dir name postfix

parent 0b4105c6
#!/bin/sh #!/bin/sh
# 2005-2006, 2012 (c) Etersoft www.etersoft.ru # 2005-2006, 2012, 2016 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain # Public domain
# #
...@@ -35,16 +35,18 @@ phelp() ...@@ -35,16 +35,18 @@ phelp()
echog " -r run command" echog " -r run command"
echog " -o log in as root user" echog " -o log in as root user"
echog " -v verbose" echog " -v verbose"
echog " -x allow run X program (set DISPLAY and install xauth)" echog " -X|-Y allow run X program (set DISPLAY and install xauth)"
echog " -t use test hasher dir (different to usual build dir)" echog " -t use test hasher dir (different to usual build dir)"
echog " -p NAME use hasher dir with NAME postfix"
echo echo
echog "Extra options:" echog "Extra options:"
echog " -a auto test mode for post myhsh build checking" echog " -a auto test mode for post myhsh build checking"
echog " -d print hasher dir" echog " -d print hasher dir only"
echog " -M?? binary repository name (obsoleted)" echog " -M?? binary repository name (obsoleted)"
echog " -x allow run X program (obsoleted)"
} }
while getopts :chitoadvqr:b:x opt; do while getopts :chitoadvqr:b:p:xXY opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
t) TESTMODE=1 ;; t) TESTMODE=1 ;;
...@@ -55,7 +57,10 @@ while getopts :chitoadvqr:b:x opt; do ...@@ -55,7 +57,10 @@ while getopts :chitoadvqr:b:x opt; do
q) QUIETMODE=1 ;; q) QUIETMODE=1 ;;
b) BINARYREPONAME=$OPTARG ;; b) BINARYREPONAME=$OPTARG ;;
r) RUNCOMMAND=$OPTARG ;; r) RUNCOMMAND=$OPTARG ;;
x) ALLOWX=1 ;; p) HASHERPOSTFIX=$OPTARG ;;
X) ALLOWX=-X ;;
Y) ALLOWX=-Y ;;
x) ALLOWX=-Y ;;
v) VERBOSE="-v" ;; v) VERBOSE="-v" ;;
o) ROOTER="--rooter" ;; o) ROOTER="--rooter" ;;
+?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;; +?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;;
...@@ -86,7 +91,9 @@ prepare_aptconfig ...@@ -86,7 +91,9 @@ prepare_aptconfig
HASHERARG="$HASHERARG --apt-config=$OURAPTCONF --target $BUILDARCH --with-stuff" HASHERARG="$HASHERARG --apt-config=$OURAPTCONF --target $BUILDARCH --with-stuff"
set_hasherdir set_hasherdir
if [ -n "$TESTMODE" ] || [ -n "$AUTOMODE" ] ; then if [ -n "$HASHERPOSTFIX" ] ; then
HASHERDIR=$HASHERDIR-$HASHERPOSTFIX
elif [ -n "$TESTMODE" ] || [ -n "$AUTOMODE" ] ; then
HASHERDIR=$HASHERDIR-test HASHERDIR=$HASHERDIR-test
fi fi
...@@ -119,12 +126,6 @@ if [ -n "$ALLOWX" ] ; then ...@@ -119,12 +126,6 @@ if [ -n "$ALLOWX" ] ; then
UTILPKG="$UTILPKG xauth fonts-ttf-liberation" UTILPKG="$UTILPKG xauth fonts-ttf-liberation"
fi fi
if [ -n "$RUNCOMMAND" ] ; then
docmd $HSH-install $HASHERDIR --wait-lock $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install"
docmd $HSH-run $ROOTER $HASHERDIR -- $RUNCOMMAND
exit
fi
if [ -n "$QUIETMODE" ] ; then if [ -n "$QUIETMODE" ] ; then
docmd $HSH-install $HASHERDIR --wait-lock $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install" docmd $HSH-install $HASHERDIR --wait-lock $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install"
echog "Exiting (quiet mode)..." echog "Exiting (quiet mode)..."
...@@ -143,13 +144,20 @@ fi ...@@ -143,13 +144,20 @@ fi
if [ -n "$AUTOMODE" ] || [ -n "$ALLOWX" ] ; then if [ -n "$AUTOMODE" ] || [ -n "$ALLOWX" ] ; then
UTILPKG="$UTILPKG xauth fonts-ttf-liberation" UTILPKG="$UTILPKG xauth fonts-ttf-liberation"
SHELLHASHERARG="$SHELLHASHERARG $ALLOWX"
else else
UTILPKG="$UTILPKG etersoft-build-utils" UTILPKG="$UTILPKG etersoft-build-utils"
fi fi
docmd $HSH-install $HASHERDIR --wait-lock $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install" docmd $HSH-install $HASHERDIR --wait-lock $UTILPKG $LISTRPMARGS $LISTNAMES || fatal "Error with install"
if [ -n "$RUNCOMMAND" ] ; then
docmd $HSH-run $HASHERDIR $SHELLHASHERARG $ROOTER --wait-lock -- $RUNCOMMAND
exit
fi
echog "You are in hasher shell" echog "You are in hasher shell"
docmd $HSH-shell $HASHERDIR $SHELLHASHERARG $ROOTER -Y --shell docmd $HSH-shell $HASHERDIR $SHELLHASHERARG $ROOTER --wait-lock --shell
if [ -n "$AUTOMODE" ] ; then if [ -n "$AUTOMODE" ] ; then
# FIXME: do not remove on x86_64 # FIXME: do not remove on x86_64
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment