~mvo/apt/dep8

« back to all changes in this revision

Viewing changes to test/integration/create-test-data

  • Committer: Michael Vogt
  • Date: 2011-02-08 09:25:47 UTC
  • mfrom: (1561.38.60 apt-sid)
  • Revision ID: michael.vogt@ubuntu.com-20110208092547-3gsosv0ywgr9vh2q
merged from lp:~donkult/apt/sid

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
set +e # its okay to fail in these script, most of the time the apt* stuff will generate errors
3
3
 
 
4
if [ -z "$1" -o -z "$2" ]; then
 
5
        echo "Usage: $0 file codename pkg…"
 
6
        exit 1
 
7
fi
 
8
 
4
9
local TESTDIR=$(readlink -f $(dirname $0))
5
10
. $TESTDIR/framework
6
11
BUILDDIRECTORY="${TESTDIR}/../../build/bin"
16
21
export LANG=C
17
22
 
18
23
LISTOFPKGS=$(aptget install $* -t $CODENAME -so Dir::state::status=$WORKDIR/status -o Dir::Cache::archives=$WORKDIR -o pkgCacheGen::Essential=none -o APT::Immediate-Configure=0 2> /dev/null | awk '/^Inst/ {print $2}' | sed -e "s#\$#/$CODENAME#")
19
 
aptcache show $LISTOFPKGS --no-all-versions 2> /dev/null > $TMPGEN
 
24
if [ -z "$LISTOFPKGS" ]; then
 
25
        echo "List of packages is empty: run apt-get install command again for you now"
 
26
        aptget install $* -t $CODENAME -so Dir::state::status=$WORKDIR/status -o Dir::Cache::archives=$WORKDIR -o pkgCacheGen::Essential=none -o APT::Immediate-Configure=0
 
27
        exit 1
 
28
fi
 
29
aptcache show $LISTOFPKGS --no-all-versions 2> $WORKDIR/error.lst > $TMPGEN
20
30
sed -i $TMPGEN \
21
31
        -e '/^ / d' \
22
32
        -e '/^SHA1: / d' -e '/^SHA256: / d' \
24
34
        -e '/^Xul-Appid: / d' \
25
35
        -e '/^Status: / d'
26
36
 
 
37
if [ "$CODENAME" = "experimental" ]; then
 
38
        aptcache show $(cat $WORKDIR/error.lst | cut -d"'" -f 4 | sed -e 's#$#/sid#') --no-all-versions 2> /dev/null >> $TMPGEN
 
39
fi
 
40
 
27
41
if echo "$GENERATE" | grep '^status-' > /dev/null; then
28
42
        sed -i $TMPGEN -e '/^Package: / a\
29
43
Status: install ok installed' \