From: Anders Kaseorg Date: Sun, 21 Mar 2010 01:04:24 +0000 (-0400) Subject: apt-zephyr: Make pre_install_pkgs a function. X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/Scripts/git/.git/commitdiff_plain/6d930f304655c3467cbd52f1c3b595f1fbdc3e33 apt-zephyr: Make pre_install_pkgs a function. Signed-off-by: Anders Kaseorg --- diff --git a/apt-zephyr/apt-zephyr b/apt-zephyr/apt-zephyr index 11a9bb7..7db23c5 100755 --- a/apt-zephyr/apt-zephyr +++ b/apt-zephyr/apt-zephyr @@ -84,17 +84,22 @@ parse_v2 () done } -read -r line -case "$line" in - 'VERSION 2') - parse_v2 | send_zephyr - ;; - 'VERSION *') - echo "$0: unrecognized version: $line" | send-zephyr - ;; - '') - ;; - *) - (echo "$line"; cat) | parse_v1 | send_zephyr - ;; -esac +pre_install_pkgs () +{ + read -r line + case "$line" in + 'VERSION 2') + parse_v2 | send_zephyr + ;; + 'VERSION *') + echo "$0: unrecognized version: $line" | send-zephyr + ;; + '') + ;; + *) + (echo "$line"; cat) | parse_v1 | send_zephyr + ;; + esac +} + +pre_install_pkgs