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

index 54300bdb5f6cd89b293dc5ad58be332b8f78645d..a8e50dfcf8e5a526e9aa871e44ce463097c85484 100755 (executable)
@@ -13,6 +13,18 @@ ZAUTH=
 # Read configuration
 . /etc/apt-zephyr.conf
 
+send_zephyr ()
+{
+    zwrite \
+       ${CLASS:+-c "$CLASS"} \
+       ${INSTANCE:+-i "$INSTANCE"} \
+       ${REALM:+-r "$REALM"} \
+       ${SIG:+-s "$SIG"} \
+       ${OPCODE:+-O "$OPCODE"} \
+       ${ZAUTH:--d} \
+       ${RECIPIENTS:+$RECIPIENTS}
+}
+
 package ()
 {
     package=$1
@@ -75,5 +87,4 @@ case "$line" in
        done
        rm -f "$oldpkgs" "$newpkgs"
        ;;
-esac | \
-    zwrite ${CLASS:+-c "$CLASS"} ${INSTANCE:+-i "$INSTANCE"} ${REALM:+-r "$REALM"} ${SIG:+-s "$SIG"} ${OPCODE:+-O "$OPCODE"} ${ZAUTH:--d} ${RECIPIENTS:+$RECIPIENTS}
+esac | send_zephyr