aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')