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

runinhsh: rewrite

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