summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-03-12 13:31:41 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-03-13 13:58:46 +0100
commit3dcdc1f91a5646f882940ff055b972d6b31a0ba5 (patch)
treea12bbf9b0eaea3b8a7ce0efda9bec6d92d17b477
parent69d6988a1914881952c013cb63b4d835c3db0db7 (diff)
factor out getting list of architectures from comma list
Beside fixing this minor code duplication it also resolves the problem of messing up vim syntax-highlighting. Git-Dch: Ignore
-rw-r--r--test/integration/framework13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 1ab421c4c..00c8f3abc 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -259,6 +259,10 @@ getarchitectures() {
echo "$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')"
}
+getarchitecturesfromcommalist() {
+ echo "$1" | sed -e 's#,#\n#g' | sed -e "s/^native\$/$(getarchitecture 'native')/"
+}
+
configarchitecture() {
{
echo "APT::Architecture \"$(getarchitecture $1)\";"
@@ -432,7 +436,7 @@ Package: $NAME" >> ${BUILDDIR}/debian/control
# fi
done
- for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do
+ for arch in $(getarchitecturesfromcommalist "$ARCH"); do
rm -rf ${BUILDDIR}/debian/tmp
mkdir -p ${BUILDDIR}/debian/tmp/DEBIAN ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} ${BUILDDIR}/debian/tmp/usr/bin
cp ${BUILDDIR}/debian/copyright ${BUILDDIR}/debian/changelog ${BUILDDIR}/FEATURES ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME}
@@ -587,7 +591,7 @@ insertpackage() {
something went horribly wrong! They are autogenerated
und used only by testcases and surf no other proposeā€¦"}"
local ARCHS=""
- for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do
+ for arch in $(getarchitecturesfromcommalist "$ARCH"); do
if [ "$arch" = 'all' -o "$arch" = 'none' ]; then
ARCHS="$(getarchitectures)"
else
@@ -649,7 +653,7 @@ insertinstalledpackage() {
local FILE='rootdir/var/lib/dpkg/status'
local INFO='rootdir/var/lib/dpkg/info'
- for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do
+ for arch in $(getarchitecturesfromcommalist "$ARCH"); do
echo "Package: $NAME
Status: $STATUS
Priority: $PRIORITY
@@ -943,8 +947,7 @@ acquire::cdrom::autodetect 0;" > rootdir/etc/apt/apt.conf.d/00cdrom
downloadfile() {
local PROTO="$(echo "$1" | cut -d':' -f 1 )"
- apthelper -o Acquire::https::CaInfo=${TESTDIR}/apt.pem \
- -o Debug::Acquire::${PROTO}=1 \
+ apthelper -o Debug::Acquire::${PROTO}=1 \
download-file "$1" "$2" 2>&1 || true
# only if the file exists the download was successful
if [ -e "$2" ]; then