From: Silvio Rhatto Date: Fri, 2 Jun 2017 21:05:42 +0000 (-0300) Subject: Adds sudo config into remove-dep X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=2471d64295214cbc03cb499fda9d8744a5e71beb;p=hydra.git Adds sudo config into remove-dep --- diff --git a/share/hydractl/remove-dep b/share/hydractl/remove-dep index f5f2537..5e1a732 100755 --- a/share/hydractl/remove-dep +++ b/share/hydractl/remove-dep @@ -30,6 +30,11 @@ if [ -z "$1" ]; then exit 1 fi -aptitude markauto $(apt-cache showsrc "$1" \ +# Set sudo config +if [ "`whoami`" != 'root' ]; then + sudo="sudo" +fi + +$sudo aptitude markauto $(apt-cache showsrc "$1" \ | grep Build-Depends \ | perl -p -e 's/(?:[\[(].+?[\])]|Build-Depends:|,|\|)//g')