aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-06-02 18:05:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-06-02 18:05:42 -0300
commit2471d64295214cbc03cb499fda9d8744a5e71beb (patch)
treed369d2727edf65ee48bad9e7741c79cad5d1529e /share
parentb81f64ae48bbab40fea4e489cd84892bb685d4d0 (diff)
downloadhydra-2471d64295214cbc03cb499fda9d8744a5e71beb.tar.gz
hydra-2471d64295214cbc03cb499fda9d8744a5e71beb.tar.bz2
Adds sudo config into remove-dep
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydractl/remove-dep7
1 files changed, 6 insertions, 1 deletions
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')