Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=f640f85b37e9186afd6f141c76f76c0b9506d27b

commit f640f85b37e9186afd6f141c76f76c0b9506d27b
Author: DeX77 <[email protected]>
Date:   Wed Nov 25 13:25:02 2015 +0100

* update testsuite srcmissing.
Old: >5m, New: 8s

diff --git a/t/srccheck b/t/srccheck
new file mode 100644
index 0000000..c74acc2
--- /dev/null
+++ b/t/srccheck
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+#declare vars
+pkgname=""
+nobuild=""
+archs=""
+source=""
+prevfile=""
+
+# fake variable for fwmakepkg
+export CHROOT=1
+
+. ./functions.sh || echo "could not parse functions"
+. /etc/makepkg.conf || echo "could not parse makepkg.conf"
+. /usr/lib/frugalware/fwmakepkg || echo "could not parse fwmakepkg"
+
+
+if [ "$1" == "--download" ]; then
+       download="y"
+       shift
+fi
+
+if [ "$#" -ne 1 ]; then
+    echo "Illegal number of parameters"
+    exit
+fi
+
+directory=$(dirname $1)
+cd "$directory" || exit
+startdir="$(pwd)"
+export startdir
+
+. ./FrugalBuild || echo "could not parse $1"
+maintainer=$(grep Maintainer FrugalBuild |sed 's/.*: //')
+
+if [[ -z "$pkgname" ]]; then
+  echo "$directory: $pkgname is missing ($maintainer)"
+  exit
+fi
+
+#Package is nobuild or nomirror
+if [[ -n "$nobuild" ]] || ( [[ -n "$(check_option NOBUILD)" ]]  ||  [[ -n 
"$(check_option NOMIRROR)" ]] ); then
+  exit
+fi
+
+for j in "${archs[@]}"
+do
+  [[ "${j:0:1}" = '!' ]] && continue
+  export CARCH=$j
+  startdir="$(pwd)"
+  export startdir
+  . ./FrugalBuild || echo "could not parse $1, arch $j"
+  for k in "${source[@]}"
+  do
+    [[ "${k:0:25}" = "http://ftp.frugalware.org"; ]] && continue
+    file="`strip_url $k`"
+    if [ ! -e "$file" ] && [ "$prevfile" != "$file" ]; then
+      prevfile="$file"
+      echo "$directory: $file is missing ($maintainer)"
+      if [ ! -z "$download" ]; then
+        echo "downloading $file..."
+        $FTPAGENT $k
+      fi
+    fi
+  done
+done
diff --git a/t/srcmissing b/t/srcmissing
index 7b2c467..011fae0 100755
--- a/t/srcmissing
+++ b/t/srcmissing
@@ -1,58 +1,14 @@
#!/bin/bash

-# fake variable for fwmakepkg
-CHROOT=1
-
-. ./functions.sh
-. /etc/makepkg.conf
-. /usr/lib/frugalware/fwmakepkg
-
if [ "$1" == "--help" ]; then
echo "missing source files"
exit 1
fi

if [ "$1" == "--download" ]; then
-       download="y"
+       export download="y"
shift
fi
startdir=..

-reset_env () {
-       unset archs install nobuild options pkgname pkgver pkgextraver source 
sha1sums
-       for k in `set|egrep '^(_F_|USE_)'|sed 's/\(=.*\| ()\)//'`; do unset $k; 
done
-
-       export Fpkgversep='-' startdir=`pwd`
-}
-
-prevfile=""
-cd $startdir
-for i in `find source -maxdepth 5 -name FrugalBuild`
-do
-       cd `dirname $i` || continue
-       reset_env
-       . ./FrugalBuild || echo "could not parse $i"
-       if [ ! -z "$pkgname" -a ! "$nobuild" -a ! "`check_option NOBUILD`" -a ! 
"`check_option NOMIRROR`" ]; then
-               for j in "${archs[@]}"
-               do
-                       [[ "${j:0:1}" = '!' ]] && continue
-                       reset_env
-                       export CARCH=$j
-                       . ./FrugalBuild || echo "could not parse $i, arch $j"
-                       for k in "${source[@]}"
-                       do
-                               [[ "${k:0:25}" = "http://ftp.frugalware.org"; ]] 
&& continue
-                               file="`strip_url $k`"
-                               if [ ! -e "$file" ] && [ "$prevfile" != "$file" 
]; then
-                                       prevfile="$file"
-                                       echo "`dirname $i`: $file is missing 
(`grep Maintainer FrugalBuild |sed 's/.*: //'`)"
-                                       if [ ! -z "$download" ]; then
-                                               echo "downloading $file..."
-                                               $FTPAGENT $k
-                                       fi
-                               fi
-                       done
-               done
-       fi
-       cd - >/dev/null
-done
+find $startdir/source -maxdepth 5 -name FrugalBuild -print0 | xargs -0 -n 1 -P 
16 ./srccheck
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to