From 2471d64295214cbc03cb499fda9d8744a5e71beb Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 2 Jun 2017 18:05:42 -0300 Subject: Adds sudo config into remove-dep --- share/hydractl/remove-dep | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'share') 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') -- cgit v1.2.3