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
}
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"
usage
exit 0
;;
+ -c)
+ shift
+ poldek_conf=$1
+ ;;
--)
shift
break
ignore|hold)
option_set "$command" "$arguments"
;;
+ keep_downloads)
+ option_set "keep downloads" "$arguments"
+ ;;
+ cachedir|cache_dir)
+ option_set "cachedir" "$arguments"
+ ;;
*)
die "Unknown command: $command"
;;