]> TLD Linux GIT Repositories - packages/rpm-build-tools.git/commitdiff
- wrapper for TLD GIT/PLD CVS builder script
authorMarcin Krol <hawk@tld-linux.org>
Mon, 25 Jun 2012 14:17:42 +0000 (14:17 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Mon, 25 Jun 2012 14:17:42 +0000 (14:17 +0000)
builder.wrapper [new file with mode: 0755]

diff --git a/builder.wrapper b/builder.wrapper
new file mode 100755 (executable)
index 0000000..875a401
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+git_list="$HOME/rpm/packages/git-packages.txt"
+git_list_url="http://kraz.tld-linux.org/git-packages.txt"
+
+/bin/rm "$git_list" 1>/dev/null 2>&1
+if /usr/bin/wget "$git_list_url" -O "$git_list" 1>/dev/null 2>&1; then
+  dl_md5=$(/usr/bin/head -n 1 "$git_list")
+  /bin/sed -i -e '1d' "$git_list" 1>/dev/null 2>&1
+  list_md5="# MD5: $(/usr/bin/md5sum "$git_list" 2>/dev/null| cut -d " " -f 1)"
+  if [ "x$dl_md5" = "x$list_md5" ]; then
+    for p in "$@"; do
+      if echo "$p" | /bin/grep -q -E "\.spec$"; then
+        if /bin/grep -q -E "^"$p"$" $git_list; then
+          ~/rpm/packages/builder.git "$@"
+        else
+          ~/rpm/packages/builder.cvs "$@"
+        fi
+      fi
+    done
+  else
+    echo "Error: list of GIT package repositories is corrupted (MD5 mismatch)"
+  fi
+else
+  /bin/rm "$git_list" 1>/dev/null 2>&1
+  echo "Error: unable to fetch list of GIT package repositories"
+  exit 1
+fi