From 7aac177733dfe71b1f3deb1ae2158a879ac1b8ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 19 Apr 2012 12:55:49 +0000 Subject: [PATCH] Efficient processing of packages on Debian, only rough classification of production and tested packages. --- .../LB/tests/lb-common-testbeds.sh | 48 ++++++++++++++-------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh b/org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh index 12a5681..39dcb56 100755 --- a/org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh +++ b/org.glite.testsuites.ctb/LB/tests/lb-common-testbeds.sh @@ -212,31 +212,43 @@ function gen_repo_lists() { egrep -i "Debian|Ubuntu" /etc/issue if [ $? = 0 ]; then - LISTALLCMD="apt-get install -q --yes" - for pkg in `apt-cache pkgnames`; do - apt-cache showpkg $pkg | grep -A 1000 ^Version | grep -B 1000 "^Reverse Depends:" | grep "^[0-9]" | sed "s/^/$pkg /" >> /tmp/allpkgs.$$.txt - done - cat /tmp/allpkgs.$$.txt | awk {'print $3'} | sort | uniq > /tmp/allrepos.$$.txt + apt-cache showpkg `apt-cache pkgnames` | awk '\ + /^Package:/ { pkg=$2; } + /^Versions:/ { + getline + print pkg, $0 + } + /.*/ { next }' | sed 's/[()]//g' > /tmp/allpkgs.$$.txt + + # + # rough distinguish between PROD and TEST repo on Debian + # 1) filtering by name + # 2) OS vs non-OS packages + # + #cat /tmp/allpkgs.$$.txt | cut -f3- -d' ' | sed 's/ /\n/g' | sort | uniq > /tmp/allrepos.$$.txt + cat /tmp/allpkgs.$$.txt | grep -Ei '\<(lib)?(glite|emi|canl|gridsite|voms|myproxy|globus)' | grep -Ev '(^emil |canlock)' > /tmp/somepkgs.$$.txt + cat /tmp/somepkgs.$$.txt | grep -E 'debian.*(sid|wheezy|squeezy)' > $1 + cat /tmp/somepkgs.$$.txt | grep -v -E 'debian.*(sid|wheezy|squeezy)' > $2 else yum install -y -q yum-utils repoquery -a --qf "%{name} %{version} %{repoid}" > /tmp/allpkgs.$$.txt repoquery -a --qf "%{repoid}" | sort | uniq > /tmp/allrepos.$$.txt - fi - grep -i etics /tmp/allrepos.$$.txt > /dev/null - if [ $? = 0 ]; then - PRODREPO="EMI" - TESTREPO="ETICS" - else - printf " etics repo not found, trying to distinguish between EMI repos " - PRODREPO=`cat /tmp/allrepos.$$.txt | grep -o -E "EMI-[0-9]+" | sort | uniq | head -n 1` - TESTREPO=`cat /tmp/allrepos.$$.txt | grep -o -E "EMI-[0-9]+" | sort | uniq | tail -n 1` + grep -i etics /tmp/allrepos.$$.txt > /dev/null + if [ $? = 0 ]; then + PRODREPO="EMI" + TESTREPO="ETICS" + else + printf " etics repo not found, trying to distinguish between EMI repos " + PRODREPO=`cat /tmp/allrepos.$$.txt | grep -o -E "EMI-[0-9]+" | sort | uniq | head -n 1` + TESTREPO=`cat /tmp/allrepos.$$.txt | grep -o -E "EMI-[0-9]+" | sort | uniq | tail -n 1` + fi + + cat /tmp/allpkgs.$$.txt | grep " $PRODREPO" > $1 + cat /tmp/allpkgs.$$.txt | grep " $TESTREPO" > $2 fi - cat /tmp/allpkgs.$$.txt | grep " $PRODREPO" > $1 - cat /tmp/allpkgs.$$.txt | grep " $TESTREPO" > $2 - - rm -f /tmp/allpkgs.$$.txt /tmp/allrepos.$$.txt + rm -f /tmp/allpkgs.$$.txt /tmp/allrepos.$$.txt /tmp/somepkgs.$$.txt } function gen_test_report() -- 1.8.2.3