]> git.pld-linux.org Git - packages/poldek.git/blobdiff - poldek-config.sh
Release 19 (by relup.sh)
[packages/poldek.git] / poldek-config.sh
index 9e67ed2dcddb24f8f0dadcb87b5942a8c7c4ea4a..795e894883115630d8cfe3ac6a6685b6c39bcd71 100755 (executable)
@@ -21,6 +21,12 @@ 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.
+
+cachedir /var/cache/poldek
+    Cache directory for downloaded files. NOTE that parent directory of cachedir must exist.
+
 EOF
 }
 
@@ -31,12 +37,12 @@ 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
 parse_arguments() {
-       t=$(getopt -o h --long help -n "$PROGRAM" -- "$@")
+       t=$(getopt -o hc: --long help -n "$PROGRAM" -- "$@")
        [ $? != 0 ] && exit $?
        eval set -- "$t"
 
@@ -46,6 +52,10 @@ parse_arguments() {
                        usage
                        exit 0
                ;;
+               -c)
+                       shift
+                       poldek_conf=$1
+               ;;
                --)
                        shift
                        break
@@ -73,6 +83,12 @@ main() {
                ignore|hold)
                        option_set "$command" "$arguments"
                        ;;
+               keep_downloads)
+                       option_set "keep downloads" "$arguments"
+                       ;;
+               cachedir|cache_dir)
+                       option_set "cachedir" "$arguments"
+                       ;;
                *)
                        die "Unknown command: $command"
                        ;;
This page took 0.127013 seconds and 4 git commands to generate.