chiark / gitweb /
bin/mdw-sbuild-server: Keep track of the target CPU architectures.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 13 Aug 2017 17:36:04 +0000 (18:36 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 13 Aug 2017 17:36:04 +0000 (18:36 +0100)
Nothing needs this yet, but it'll be handy soon.

bin/mdw-sbuild-server

index d04f5a24de72d52a60c34887ffa6464431dc465f..1ac507fd0f8f049423ce12a41a014ce1faeb4180 100755 (executable)
@@ -171,6 +171,7 @@ case "$#,$1" in
     unset first rest; anyp=nil depp=nil allp=nil
     wantarchs=$(sed -n '/^[Aa]rchitecture:/ s/^[^:]*: *//p' "$dsc")
     : ${wantarchs:=any}
+    unset buildarchs buildarchs_seen=:
 
     ## Work through the available targets assigning builds to them.  This is
     ## actually a little tricky.
@@ -182,6 +183,14 @@ case "$#,$1" in
        */*) target=${archs%/*} host=${archs#*/} ;;
        *) target=$archs host=$archs; t=$suite-$target/$host ;;
       esac
+      case $buildarchs_seen in
+       *:$target:*)
+         ;;
+       *)
+         buildarchs=${buildarchs+$buildarchs }$target
+         buildarchs_seen=$buildarchs_seen$target:
+         ;;
+      esac
 
       ## Work through the architectures which we can build.
       for arch in $wantarchs; do