diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 15:40:10 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 15:40:10 +0100 |
commit | c6e67582e73a49b15107dfab3bc2273e11b0f9f0 (patch) | |
tree | ff75ce2d5683b40e4ae79ec5411f6ec74d9c13e1 /update-conf.in | |
parent | 03384208e0e05697570ec8d61cf6bb940c9ee0a1 (diff) | |
download | alpine-conf-c6e67582e73a49b15107dfab3bc2273e11b0f9f0.zip |
update-conf: code clean. use ask
Diffstat (limited to 'update-conf.in')
-rw-r--r-- | update-conf.in | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/update-conf.in b/update-conf.in index b59151d..8a6d774 100644 --- a/update-conf.in +++ b/update-conf.in @@ -60,7 +60,6 @@ fi for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do p="${apknew%.apk-new}" f="${p#${ROOT}/}" - unset choice if [ "$lflag" ] ; then @@ -79,24 +78,24 @@ for apknew in $(find "$ROOT/etc" -name '*.apk-new') ; do diff -u "$p" "$apknew" # ask user what to do with the file - while [ -z "$choice" ] ; do + unset resp + while [ -z "$resp" ] ; do echo "New $p available:" - echon "Quit, Next, Show diff, Edit new${vflag}, Zap new, Use new (q/n/s/e${vflag2}/z/u) [s]: " - default_read choice "s" </dev/tty - case "$choice" in + ask "Quit, Next, Show diff, Edit new${vflag}, Zap new, Use new (q/n/s/e${vflag2}/z/u)" s + case "$resp" in q) exit;; n) continue;; s) diff -u "$p" "$apknew" | ${PAGER:-less} - unset choice + unset resp ;; - e) ${EDITOR:-vi} "$apknew" ; unset choice;; + e) ${EDITOR:-vi} "$apknew" ; unset resp;; v) if [ "$vflag" ]; then vimdiff "$p" "$apknew" fi - unset choice;; + unset resp;; z) rm "$apknew";; u) mv "$apknew" "$p";; - *) unset choice;; + *) unset resp;; esac done else |