]> git.pld-linux.org Git - packages/poldek.git/commitdiff
poldek-config: option to change cache dir
authorElan Ruusamäe <glen@delfi.ee>
Tue, 5 Jan 2016 12:35:56 +0000 (14:35 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Tue, 5 Jan 2016 12:36:12 +0000 (14:36 +0200)
poldek-config.sh

index 01503d056ac6a970e4846a14c9dc0d1be21a771a..d8732efef7f674b2a5799d1c65239141d7d3f3b1 100755 (executable)
@@ -24,6 +24,9 @@ hold [PACKAGE] [PACKAGE...]
 keep_downloads yes|no
     Do not remove downloaded packages after its successful installation.
 
+cachedir /var/cache/poldek
+    Cache directory for downloaded files. NOTE that parent directory of cachedir must exist.
+
 EOF
 }
 
@@ -34,7 +37,7 @@ die() {
 
 option_set() {
        local option="$1"; shift
-       sed -i -re "/^#?$option\s*=/ s/.*/$option = $*/" "$poldek_conf"
+       sed -i -re "/^#?$option\s*=/ s#.*#$option = $*#" "$poldek_conf"
 }
 
 # parse command line args
@@ -79,6 +82,9 @@ main() {
                keep_downloads)
                        option_set "keep downloads" "$arguments"
                        ;;
+               cachedir|cache_dir)
+                       option_set "cachedir" "$arguments"
+                       ;;
                *)
                        die "Unknown command: $command"
                        ;;
This page took 0.033759 seconds and 4 git commands to generate.