apt-zephyr: Make parse_v2 a function.
authorAnders Kaseorg <andersk@mit.edu>
Sun, 21 Mar 2010 00:58:42 +0000 (20:58 -0400)
committerAnders Kaseorg <andersk@mit.edu>
Sun, 21 Mar 2010 00:59:03 +0000 (20:59 -0400)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
apt-zephyr/apt-zephyr

index 3650cc572b915c7d8e22de267e626024245e249a..72c217ec77f3effdae76f07cb97eb905c44e37bc 100755 (executable)
@@ -69,20 +69,25 @@ parse_v1 ()
     rm -f "$oldpkgs" "$newpkgs"
 }
 
+parse_v2 ()
+{
+    while read -r line && [ -n "$line" ]; do :; done
+    while read -r package oldver cmp newver action; do
+       case "$action" in
+           '**CONFIGURE**' | '**REMOVE**')
+               package "$package" "$oldver" "$cmp" "$newver"
+               ;;
+           '**ERROR**')
+               echo "ERROR on $package $newver"
+               ;;
+       esac
+    done
+}
+
 read -r line
 case "$line" in
     'VERSION 2')
-       while read -r line && [ -n "$line" ]; do :; done
-       while read -r package oldver cmp newver action; do
-           case "$action" in
-               '**CONFIGURE**' | '**REMOVE**')
-                   package "$package" "$oldver" "$cmp" "$newver"
-                   ;;
-               '**ERROR**')
-                   echo "ERROR on $package $newver"
-                   ;;
-           esac
-       done
+       parse_v2
        ;;
     'VERSION *')
        echo "$0: unrecognized version: $line"