]> git.saurik.com Git - apple/system_cmds.git/blobdiff - zic.tproj/generate_zone_file_list.sh
system_cmds-643.1.1.tar.gz
[apple/system_cmds.git] / zic.tproj / generate_zone_file_list.sh
diff --git a/zic.tproj/generate_zone_file_list.sh b/zic.tproj/generate_zone_file_list.sh
new file mode 100755 (executable)
index 0000000..839dd63
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# we need to know where the data files are...
+if [ $# -ne 1 ]; then
+    echo "Usage: $0 DATA_FILES_DIR" 1>&2
+    exit 1
+fi
+
+DATFILES="$1"
+ZONE_FILES="$(egrep --files-with-match '^(Zone|Rule|Link)' ${DATFILES}/* | awk -F "/" '{print $NF}')"
+
+for tz in ${ZONE_FILES}; do
+    if [ ${tz} = "backward" ]; then
+        DO_BACKWARD=1
+        continue
+    elif [ ${tz} = "backzone" ]; then
+        continue
+    else
+        echo "${tz}"
+    fi
+done
+
+if [ -n "$DO_BACKWARD" ]; then
+    echo "backward"
+fi
+