]> gitweb.fluxo.info Git - hydra.git/commitdiff
Adds sudo config into remove-dep
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Jun 2017 21:05:42 +0000 (18:05 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Jun 2017 21:05:42 +0000 (18:05 -0300)
share/hydractl/remove-dep

index f5f253700b0f349b837a9b092bc5a9ae559ed1fe..5e1a732a69a9816354254e9a1c36c6c9214fe14f 100755 (executable)
@@ -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')