Commit 50b21eb0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

runinhsh: rewrite

parent 9746fc90
......@@ -12,10 +12,10 @@
if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
echo "runinhsh [-b REPONAME] [package/command] [command] - run command inside hasher for REPONAME distro"
echo "runinhsh [-b REPONAME] [-p package] [command] [command options] - run command inside hasher for REPONAME distro"
echo "Examples:"
echo " $ runinhsh -b p8 firefox-gost firefox"
echo " $ runinhsh -b p8 chromium"
echo " $ runinhsh -b p8 -p firefox-gost firefox"
echo " $ runinhsh -b p9 chromium https://ya.ru"
exit 0
fi
......@@ -37,23 +37,24 @@ if [ "$1" = "-b" ] ; then
shift 2
fi
# TODO --short
#PACKAGE=$(epmqf --quiet --short "$1")
if [ -n "$2" ] ; then
if [ "$1" = "-p" ] ; then
PACKAGE="$1"
COMMAND="$2"
else
COMMAND="$1"
PACKAGE=$($EPMCMD qf --quiet "$COMMAND" 2>/dev/null)
if [ -n "$PACKAGE" ] ; then
PACKAGE=$(echo "$PACKAGE" | $EPMCMD print name for package)
else
shift
fi
COMMAND="$1"
shift 1
if [ -z "$PACKAGE" ] ; then
PACKAGE=$($EPMCMD qf --short "$COMMAND" 2>/dev/null)
if [ -z "$PACKAGE" ] ; then
PACKAGE="$COMMAND"
fi
fi
PACKAGES="$PACKAGE"
PACKAGES="$PACKAGE glibc-nss mtr hostinfo"
OPTIONS=
case $PACKAGE in
firefox*)
PACKAGES="$PACKAGES $PLUGINJAVA"
......@@ -69,5 +70,5 @@ esac
HASHERNAME=$(echo "$COMMAND $PACKAGES" | md5sum | cut -f1 -d" ")
showcmd "$ETERBUILDBIN/loginhsh -Y -t -p $HASHERNAME $PLATFORM -r '$COMMAND $OPTIONS' $PACKAGES"
$ETERBUILDBIN/loginhsh -Y -t -p $HASHERNAME $PLATFORM -r "$COMMAND $OPTIONS" $PACKAGES
showcmd "$ETERBUILDBIN/loginhsh -Y -p $HASHERNAME $PLATFORM -r 'dbus-launch $COMMAND $OPTIONS $@' $PACKAGES"
$ETERBUILDBIN/loginhsh -Y -p $HASHERNAME $PLATFORM -r "dbus-launch $COMMAND $OPTIONS $@" $PACKAGES
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