changeset 126:828f0de6b2fb

Add single-repo update
author Chris Cannam
date Wed, 06 Feb 2019 13:50:03 +0000
parents 08f7d7cdf1df
children 622ddc1ace50
files SCRIPTS/Dockerfile SCRIPTS/Dockerfile_arch SCRIPTS/update-all.sh SCRIPTS/update.sh
diffstat 4 files changed, 62 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/SCRIPTS/Dockerfile	Thu Sep 28 10:34:24 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-FROM base/devel:latest
-MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
-RUN echo "[multilib]" >> /etc/pacman.conf && echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
-RUN pacman-key --refresh-keys && pacman -Syu --noconfirm && pacman-db-upgrade && pacman -S --noconfirm \
-    mercurial subversion git \
-    zip \
-    libsndfile \
-    python2-numpy \
-    mingw-w64-gcc \
-    lib32-ncurses wine \
-    openssh w3m
-RUN hg clone https://code.soundsoftware.ac.uk/hg/vamp-build-and-test /opt/vamp-build-and-test
-WORKDIR /opt/vamp-build-and-test
-RUN ./SCRIPTS/update-all.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SCRIPTS/Dockerfile_arch	Wed Feb 06 13:50:03 2019 +0000
@@ -0,0 +1,14 @@
+FROM base/devel:latest
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN echo "[multilib]" >> /etc/pacman.conf && echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
+RUN pacman-key --refresh-keys && pacman -Syu --noconfirm && pacman-db-upgrade && pacman -S --noconfirm \
+    mercurial subversion git \
+    zip \
+    libsndfile \
+    python2-numpy \
+    mingw-w64-gcc \
+    lib32-ncurses wine \
+    openssh w3m
+RUN hg clone https://code.soundsoftware.ac.uk/hg/vamp-build-and-test /opt/vamp-build-and-test
+WORKDIR /opt/vamp-build-and-test
+RUN ./SCRIPTS/update.sh
--- a/SCRIPTS/update-all.sh	Thu Sep 28 10:34:24 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-set -eu
-
-# Run this from the top-level vamp-build-and-test directory
-
-failed=/tmp/failed_$$
-rm -f "$failed"
-trap "rm -f $failed" 0
-
-cat METADATA/repos.txt | grep -v '^#' | awk -F= '{ print $1, $2 }' |
-    while read name loc; do
-	if [ -d "$name"/.hg ]; then 
- 	    ( cd $name ; hg pull && hg update ) || echo "$name" >> "$failed"
-	elif [ -d "$name"/.git ]; then 
- 	    ( cd $name ; git pull ) || echo "$name" >> "$failed"
-	elif [ -d "$name" ]; then
-	    echo "ERROR: Directory \"$name\" exists, but is not a git or hg repo" 1>&2
-	    exit 1
-	else
-	    case "$loc" in
-		*/hg/*)
-		    hg clone "$loc" "$name" || echo "$name" >> "$failed";;
-		*//git*)
-		    git clone "$loc" "$name" || echo "$name" >> "$failed";;
-		*)
-		    echo "ERROR: Can't deduce repo type from URL \"$loc\"" 1>&2
-		    exit 1;;
-	    esac
-	fi
-    done
-
-echo "Done"
-if [ -f "$failed" ]; then
-    echo "Failed repos:"
-    cat "$failed"
-fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SCRIPTS/update.sh	Wed Feb 06 13:50:03 2019 +0000
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# Run this from the top-level vamp-build-and-test directory
+# Optional argument for the single repo to checkout; default is all of them
+
+single=""
+if [ -n "$1" ]; then
+    single="$1"
+fi
+
+set -eu
+
+failed=/tmp/failed_$$
+rm -f "$failed"
+trap "rm -f $failed" 0
+
+cat METADATA/repos.txt | grep -v '^#' | awk -F= '{ print $1, $2 }' |
+    while read name loc; do
+        if [ -n "$single" ]; then
+            if [ "$single" != "$name" ]; then
+                continue
+            fi
+        fi
+	if [ -d "$name"/.hg ]; then 
+ 	    ( cd $name ; hg pull && hg update ) || echo "$name" >> "$failed"
+	elif [ -d "$name"/.git ]; then 
+ 	    ( cd $name ; git pull ) || echo "$name" >> "$failed"
+	elif [ -d "$name" ]; then
+	    echo "ERROR: Directory \"$name\" exists, but is not a git or hg repo" 1>&2
+	    exit 1
+	else
+	    case "$loc" in
+		*/hg/*)
+		    hg clone "$loc" "$name" || echo "$name" >> "$failed";;
+		*//git*)
+		    git clone "$loc" "$name" || echo "$name" >> "$failed";;
+		*)
+		    echo "ERROR: Can't deduce repo type from URL \"$loc\"" 1>&2
+		    exit 1;;
+	    esac
+	fi
+    done
+
+echo "Done"
+if [ -f "$failed" ]; then
+    echo "Failed repos:"
+    cat "$failed"
+fi