summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-09-12 16:09:53 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-09-12 16:09:53 +0200
commit7adf8bb88faba98793998bed1e6c60f4b5483531 (patch)
tree4002c43084de6db6eb4f6128baa241cb6c757ba7 /test/integration/framework
parent178dd062eeaa1d7e56770455e005dc27aa71f026 (diff)
parent02679bb36369dce76f3a2159dbb829ba221c1e67 (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework36
1 files changed, 23 insertions, 13 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 45c1f156a..a2e71760e 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -513,10 +513,12 @@ buildaptarchivefromfiles() {
# can be overridden by testcases for their pleasure
getcodenamefromsuite() { echo -n "$1"; }
getreleaseversionfromsuite() { true; }
+getlabelfromsuite() { true; }
generatereleasefiles() {
+ # $1 is the Date header and $2 is the ValidUntil header to be set
+ # both should be given in notation date/touch can understand
msgninfo "\tGenerate Release files… "
- local DATE="${1:-now}"
if [ -e aptarchive/dists ]; then
for dir in $(find ./aptarchive/dists -mindepth 3 -maxdepth 3 -type d -name 'i18n'); do
aptftparchive -qq release $dir -o APT::FTPArchive::Release::Patterns::='Translation-*' > $dir/Index
@@ -525,27 +527,35 @@ generatereleasefiles() {
local SUITE="$(echo "$dir" | cut -d'/' -f 4)"
local CODENAME="$(getcodenamefromsuite $SUITE)"
local VERSION="$(getreleaseversionfromsuite $SUITE)"
- if [ -z "$VERSION" ]; then
- aptftparchive -qq release $dir \
- -o APT::FTPArchive::Release::Suite="${SUITE}" \
- -o APT::FTPArchive::Release::Codename="${CODENAME}" \
- | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
- else
- aptftparchive -qq release $dir \
- -o APT::FTPArchive::Release::Suite="${SUITE}" \
- -o APT::FTPArchive::Release::Codename="${CODENAME}" \
- -o APT::FTPArchive::Release::Version="${VERSION}" \
- | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
+ local LABEL="$(getlabelfromsuite $SUITE)"
+ if [ -n "$VERSION" ]; then
+ VERSION="-o APT::FTPArchive::Release::Version=${VERSION}"
fi
+ if [ -n "$LABEL" ]; then
+ LABEL="-o APT::FTPArchive::Release::Label=${LABEL}"
+ fi
+ aptftparchive -qq release $dir \
+ -o APT::FTPArchive::Release::Suite="${SUITE}" \
+ -o APT::FTPArchive::Release::Codename="${CODENAME}" \
+ ${LABEL} \
+ ${VERSION} \
+ | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then
sed -i '/^Date: / a\
NotAutomatic: yes' $dir/Release
fi
+ if [ -n "$1" -a "$1" != "now" ]; then
+ sed -i "s/^Date: .*$/Date: $(date -d "$1" '+%a, %d %b %Y %H:%M:%S %Z')/" $dir/Release
+ fi
+ if [ -n "$2" ]; then
+ sed -i "/^Date: / a\
+Valid-Until: $(date -d "$2" '+%a, %d %b %Y %H:%M:%S %Z')" $dir/Release
+ fi
done
else
aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference
fi
- if [ "$DATE" != "now" ]; then
+ if [ -n "$1" -a "$1" != "now" ]; then
for release in $(find ./aptarchive -name 'Release'); do
touch -d "$1" $release
done