]> git.pld-linux.org Git - packages/poldek.git/commitdiff
poldek-config: add keep_downloads option
authorElan Ruusamäe <glen@delfi.ee>
Wed, 18 Nov 2015 09:41:58 +0000 (11:41 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Wed, 18 Nov 2015 09:42:08 +0000 (11:42 +0200)
poldek-config.sh

index 9e67ed2dcddb24f8f0dadcb87b5942a8c7c4ea4a..01503d056ac6a970e4846a14c9dc0d1be21a771a 100755 (executable)
@@ -21,6 +21,9 @@ ignore [PACKAGE] [PACKAGE...]
 hold [PACKAGE] [PACKAGE...]
     Prevent package listed from being upgraded if they are already installed.
 
+keep_downloads yes|no
+    Do not remove downloaded packages after its successful installation.
+
 EOF
 }
 
@@ -31,7 +34,7 @@ die() {
 
 option_set() {
        local option="$1"; shift
-       sed -i -e "/^$option/ s/.*/$option = $*/" "$poldek_conf"
+       sed -i -re "/^#?$option\s*=/ s/.*/$option = $*/" "$poldek_conf"
 }
 
 # parse command line args
@@ -73,6 +76,9 @@ main() {
                ignore|hold)
                        option_set "$command" "$arguments"
                        ;;
+               keep_downloads)
+                       option_set "keep downloads" "$arguments"
+                       ;;
                *)
                        die "Unknown command: $command"
                        ;;
This page took 0.199558 seconds and 4 git commands to generate.