]> git.saurik.com Git - apt.git/commitdiff
Merge branch 'debian/jessie' into debian/experimental
authorDavid Kalnischkies <david@kalnischkies.de>
Sat, 18 Apr 2015 23:24:46 +0000 (01:24 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Sat, 18 Apr 2015 23:27:31 +0000 (01:27 +0200)
Conflicts:
apt-pkg/acquire-item.cc
cmdline/apt-key.in
methods/https.cc
test/integration/test-apt-key
test/integration/test-multiarch-foreign

1  2 
apt-pkg/contrib/strutl.h
apt-pkg/deb/deblistparser.cc
apt-pkg/deb/dpkgpm.cc
cmdline/apt-key.in
configure.ac
debian/changelog
test/integration/test-apt-key
test/integration/test-multiarch-foreign
test/integration/test-specific-architecture-dependencies

Simple merge
Simple merge
Simple merge
index cf0b9a96f75960081d8a8bc2afb8dc5d08a2bca0,1da311d351212c5a6b2704442995943e5ed39262..2a66ad74d182a805c5a62f410ab2a3857fc67ba8
@@@ -158,150 -178,59 +158,150 @@@ update() 
  }
  
  remove_key_from_keyring() {
 -    local GPG="$GPG_CMD --keyring $1"
 -    # check if the key is in this keyring: the key id is in the 5 column at the end
 -    if ! $GPG --with-colons --list-keys 2>&1 | grep -iq "^pub:[^:]*:[^:]*:[^:]*:[0-9A-F]*$2:"; then
 -      return
 -    fi
 -    if [ ! -w "$1" ]; then
 -      echo >&2 "Key ${2} is in keyring ${1}, but can't be removed as it is read only."
 -      return
 +    local KEYRINGFILE="$1"
 +    shift
 +    # non-existent keyrings have by definition no keys
 +    if [ ! -e "$KEYRINGFILE" ]; then
 +       return
      fi
 -    # check if it is the only key in the keyring and if so remove the keyring altogether
 -    if [ '1' = "$($GPG --with-colons --list-keys | grep "^pub:[^:]*:[^:]*:[^:]*:[0-9A-F]\+:" | wc -l)" ]; then
 -      mv -f "$1" "${1}~" # behave like gpg
 -      return
 -    fi
 -    # we can't just modify pointed to files as these might be in /usr or something
 -    local REALTARGET
 -    if [ -L "$1" ]; then
 -      REALTARGET="$(readlink -f "$1")"
 -      mv -f "$1" "${1}.dpkg-tmp"
 -      cp -a "$REALTARGET" "$1"
 -      ls "$(dirname $1)"
 -    fi
 -    # delete the key from the keyring
 -    $GPG --batch --delete-key --yes "$2"
 -    if [ -n "$REALTARGET" ]; then
 -      # the real backup is the old link, not the copy we made
 -      mv -f "${1}.dpkg-tmp" "${1}~"
 -    fi
 -}
  
 -remove_key() {
 -    requires_root
 +    local GPG="$GPG_CMD --keyring $KEYRINGFILE"
 +    for KEY in "$@"; do
 +      # check if the key is in this keyring: the key id is in the 5 column at the end
-       if ! get_fingerprints_of_keyring "$KEYRINGFILE" | grep -q "^[0-9A-F]*${KEY}$"; then
++      if ! get_fingerprints_of_keyring "$KEYRINGFILE" | grep -iq "^[0-9A-F]*${KEY}$"; then
 +          continue
 +      fi
 +      if [ ! -w "$KEYRINGFILE" ]; then
 +          echo >&2 "Key ${KEY} is in keyring ${KEYRINGFILE}, but can't be removed as it is read only."
 +          continue
 +      fi
 +      # check if it is the only key in the keyring and if so remove the keyring altogether
 +      if [ '1' = "$(get_fingerprints_of_keyring "$KEYRINGFILE" | wc -l)" ]; then
 +          mv -f "$KEYRINGFILE" "${KEYRINGFILE}~" # behave like gpg
 +          return
 +      fi
 +      # we can't just modify pointed to files as these might be in /usr or something
 +      local REALTARGET
 +      if [ -L "$KEYRINGFILE" ]; then
 +          REALTARGET="$(readlink -f "$KEYRINGFILE")"
 +          mv -f "$KEYRINGFILE" "${KEYRINGFILE}.dpkg-tmp"
 +          cp -a "$REALTARGET" "$KEYRINGFILE"
 +      fi
 +      # delete the key from the keyring
 +      $GPG --batch --delete-key --yes "$KEY"
 +      if [ -n "$REALTARGET" ]; then
 +          # the real backup is the old link, not the copy we made
 +          mv -f "${KEYRINGFILE}.dpkg-tmp" "${KEYRINGFILE}~"
 +      fi
 +    done
 +}
  
 -    # if a --keyring was given, just remove from there
 -    if [ -n "$FORCED_KEYRING" ]; then
 -      remove_key_from_keyring "$FORCED_KEYRING" "$1"
 -    else
 +foreach_keyring_do() {
 +   local ACTION="$1"
 +   shift
 +   # if a --keyring was given, just remove from there
 +   if [ -n "$FORCED_KEYRING" ]; then
 +      $ACTION "$FORCED_KEYRING" "$@"
 +   else
        # otherwise all known keyrings are up for inspection
 -      local TRUSTEDFILE="/etc/apt/trusted.gpg"
 -      eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
 -      eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
 -      remove_key_from_keyring "$TRUSTEDFILE" "$1"
 -      TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
 +      if [ -s "$TRUSTEDFILE" ]; then
 +          $ACTION "$TRUSTEDFILE" "$@"
 +      fi
 +      local TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
        eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
        if [ -d "$TRUSTEDPARTS" ]; then
 +          # strip / suffix as gpg will double-slash in that case (#665411)
 +          local STRIPPED_TRUSTEDPARTS="${TRUSTEDPARTS%/}"
 +          if [ "${STRIPPED_TRUSTEDPARTS}/" = "$TRUSTEDPARTS" ]; then
 +              TRUSTEDPARTS="$STRIPPED_TRUSTEDPARTS"
 +          fi
            for trusted in $(run-parts --list "$TRUSTEDPARTS" --regex '^.*\.gpg$'); do
 -              remove_key_from_keyring "$trusted" "$1"
 +              if [ -s "$trusted" ]; then
 +                  $ACTION "$trusted" "$@"
 +              fi
            done
        fi
 +   fi
 +}
 +
 +run_cmd_on_keyring() {
 +    local KEYRINGFILE="$1"
 +    shift
 +    # fingerprint and co will fail if key isn't in this keyring
 +    $GPG_CMD --keyring "$KEYRINGFILE" --batch "$@" 2>/dev/null || true
 +}
 +
 +import_keys_from_keyring() {
 +    local IMPORT="$1"
 +    local KEYRINGFILE="$2"
 +    if ! $GPG_CMD --keyring "$KEYRINGFILE" --batch --import "$IMPORT" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then
 +      cat "${GPGHOMEDIR}/gpgoutput.log"
 +      false
 +    fi
 +}
 +
 +merge_keys_into_keyrings() {
 +    local KEYRINGFILE="$1"
 +    local IMPORT="$2"
 +    if ! $GPG_CMD --keyring "$KEYRINGFILE" --batch --import --import-options 'merge-only' "$IMPORT" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then
 +      cat "${GPGHOMEDIR}/gpgoutput.log"
 +      false
 +    fi
 +}
 +
 +merge_back_changes() {
 +    if [ -n "$FORCED_KEYRING" ]; then
 +      # if the keyring was forced merge is already done
 +      return
 +    fi
 +    if [ -s "${GPGHOMEDIR}/pubring.gpg" ]; then
 +      # merge all updated keys
 +      foreach_keyring_do 'merge_keys_into_keyrings' "${GPGHOMEDIR}/pubring.gpg"
 +    fi
 +    # look for keys which were added or removed
 +    get_fingerprints_of_keyring "${GPGHOMEDIR}/pubring.orig.gpg" > "${GPGHOMEDIR}/pubring.orig.keylst"
 +    get_fingerprints_of_keyring "${GPGHOMEDIR}/pubring.gpg" > "${GPGHOMEDIR}/pubring.keylst"
 +    sort "${GPGHOMEDIR}/pubring.keylst" "${GPGHOMEDIR}/pubring.orig.keylst" | uniq --unique | while read key; do
 +      if grep -q "^${key}$" "${GPGHOMEDIR}/pubring.orig.keylst"; then
 +          # key isn't part of new keyring, so remove
 +          foreach_keyring_do 'remove_key_from_keyring' "$key"
 +      elif grep -q "^${key}$" "${GPGHOMEDIR}/pubring.keylst"; then
 +          # key is part of new keyring, so we need to import it
 +          create_new_keyring "$TRUSTEDFILE"
 +          if ! $GPG --batch --yes --export "$key" | $GPG_CMD --keyring "$TRUSTEDFILE" --batch --yes --import > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then
 +             cat "${GPGHOMEDIR}/gpgoutput.log"
 +             false
 +          fi
 +      else
 +          echo >&2 "Errror: Key ${key} (dis)appeared out of nowhere"
 +      fi
 +    done
 +}
 +
 +setup_merged_keyring() {
 +    if [ -z "$FORCED_KEYRING" ]; then
 +      foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg"
 +      if [ -r "${GPGHOMEDIR}/pubring.gpg" ]; then
 +          cp -a "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg"
 +      else
 +         touch "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg"
 +      fi
 +      GPG="$GPG --keyring ${GPGHOMEDIR}/pubring.gpg"
 +    else
 +      GPG="$GPG --keyring $TRUSTEDFILE"
 +      create_new_keyring "$TRUSTEDFILE"
      fi
 -    echo "OK"
  }
  
 +create_new_keyring() {
 +    # gpg defaults to mode 0600 for new keyrings. Create one with 0644 instead.
 +    if ! [ -e "$TRUSTEDFILE" ]; then
 +      if [ -w "$(dirname "$TRUSTEDFILE")" ]; then
 +          touch -- "$TRUSTEDFILE"
 +          chmod 0644 -- "$TRUSTEDFILE"
 +      fi
 +    fi
 +}
  
  usage() {
      echo "Usage: apt-key [--keyring file] [command] [arguments]"
diff --cc configure.ac
Simple merge
index b8954102ef2ab966929fd934c015ae4f22cfafb6,e9634c7633f57c8b3ecf7100dfb35b79633e8b4a..b0d518b17399fe0b0ebdf11d79e057d6f8ffc37c
 +apt (1.1~exp8) experimental; urgency=medium
 +
 +  [ Michael Vogt ]
 +  * merge unstable upload version 1.0.9.3
 +  * Ensure /etc/apt/auth.conf has _apt:root owner
 +  * Use sysconf(_SC_ARG_MAX) to find the size of Dpkg::MaxArgBytes
 +  * Only support Translation-* that are listed in the {In,}Release file
 +  * Call "Dequeue()" for items in AbortTransaction() to fix race
 +  * prepare ABI for feature/socketpair
 +  * Bump ABI to 4.15
 +
 +  [ David Kalnischkies ]
 +  * reenable support for -s (and co) in apt-get source (Closes: 742578)
 +  * run acquire transactions only once
 +  * aborted reverify restores file owner and permission
 +  * test if TMPDIR is accessible before using (Closes: 765951)
 +  * chown finished partial files earlier
 +  * promote filesize to a hashstring
 +
 + -- Michael Vogt <mvo@debian.org>  Thu, 06 Nov 2014 10:01:21 +0100
 +
 +apt (1.1~exp7) experimental; urgency=medium
 +
 +  [ David Kalnischkies ]
 +  * don't cleanup cdrom files in apt-get update (Closes: 765458)
 +  * ignore Acquire::GzipIndexes for cdrom sources
 +
 + -- David Kalnischkies <david@kalnischkies.de>  Wed, 15 Oct 2014 20:12:15 +0200
 +
 +apt (1.1~exp6) experimental; urgency=medium
 +
 +  [ josch ]
 +  * implement the updated build profile spec
 +
 +  [ Michael Vogt ]
 +  * methods/rsh.cc: replace strcat with std::string (Closes: #76442)
 +  * Add new configallowinsecurerepositories to the test framework
 +
 +  [ Guillem Jover ]
 +  * Update Status field values handling
 +
 +  [ David Kalnischkies ]
 +  * don't drop privileges if _apt has not enough rights
 +  * check for available space, excluding root reserved blocks
 +
 + -- Michael Vogt <mvo@debian.org>  Wed, 15 Oct 2014 07:47:36 +0200
 +
 +apt (1.1~exp5) experimental; urgency=medium
 +
 +  [ Michael Vogt ]
 +  * Only rename StatError files in AbortTransaction()
 +  * Document Acquire{MaxReleaseFileSize,AllowInsecureRepositories,
 +    AllowDowngradeToInsecureRepositories} and
 +    --no-allow-insecure-repositories
 +  * Fix backward compatiblity of the new pkgAcquireMethod::DropPrivsOrDie()
 +  * Change default of Acquire::AllowInsecureRepositories to "true"
 +    so that this change is less disruptive, this will be switched
 +    to "false" again after jessie
 +
 +  [ David Kalnischkies ]
 +  * remove useless pdiff filename output (Closes: 764737)
 +  * make --allow-insecure-repositories message an error
 +  * display a warning for unsigned repos
 +  * trusted=yes sources are secure, we just don't know why
 +
 + -- Michael Vogt <mvo@debian.org>  Mon, 13 Oct 2014 16:15:22 +0200
 +
 +apt (1.1~exp4) experimental; urgency=medium
 +
 +  [ Michael Vogt ]
 +  * Merge sid version 1.0.9.2
 +  * feature/acq-trans:
 +    - Make apt-get update more transactional by keeping all data from
 +      a sources.list line in partial/ until all data is good and only
 +      then move it into lists/ in one step
 +    - add new -o Debug::Acquire::Transaction=1 debug option
 +  * feature/expected-size:
 +    Do not download more data in the mehotds than expected if we know
 +    the size. For the InRelease/Release/Release.gpg add new 
 +    Acquire::MaxReleaseFileSize that defaults to 10Mb for now
 +  * Verify the the hashes of the downloaded compressed files early
 +  * Only load unauthenticated data into our parsers when the user
 +    explicitly asked for it via --allow-insecure-repositories
 +    (Acquire::AllowInsecureRepositories)
 +  * Print warning when trying to use unauthenticated repositories
 +  * Use /var/empty as the homedir for _apt
 +  * Revert making pkgAcquire::Item::DescURI() "const" to not break
 +    API
 +  * Do not allow going from a authenticated to unauthenticated repository
 +  * Add missing "adduser" dependency (for the new _apt user)
 +    Thanks to Russ Allbery (Closes: #763004)
 +  * Test if TMPDIR is a directory in apt-key and if not unset it
 +  * add early verification for the .diff/Index download
 +  * Bump library version to libapt-pkg4.14
 +  * Rework pkgAcqMeta{Index,Sig,ClearSig}::{Done,Failed]() for readability
 +  * Ignore EINVAL from prctl(PR_SET_NO_NEW_PRIVS) (closes: 764066)
 +
 +  [ David Kalnischkies ]
 +  * deprecate Pkg->Name in favor of Grp->Name
 +  * drop stored StringItems in favor of in-memory mappings
 +  * de-duplicate version strings in the cache
 +  * fix progress output for (dist-)upgrade calculation
 +  * move PCI::From* methods into CacheSetHelper class (Closes: 686221)
 +  * add a (hidden) --quiet option for apt-key
 +  * only create new trusted.gpg if directory is writeable
 +  * support (multiple) arguments properly in apt-key
 +  * set a primary-keyring only if we have access to it
 +  * merge fragment keyrings in apt-key to avoid hitting gpg limits
 +    (Closes: 733028)
 +  * use apt-key adv (+ gnupg) instead of gpgv for verify
 +  * support gnupg2 as drop-in replacement for gnupg
 +  * allow to specify fingerprints in 'apt-key del'
 +  * use only one --keyring in gpg interactions
 +  * add and use 'apt-key verify' which prefers gpgv over gpg
 +  * remove empty keyrings in trusted.gpg.d on upgrade
 +  * store source name and version in binary cache
 +  * allow fetcher setup without directory creation (Closes: 762898)
 +  * cleanup partial directory of lists in apt-get clean (Closes: #762889)
 +  * allow options between command and -- on commandline
 +  * update symbols file
 +  * support parsing of all hashes for pdiff
 +  * ensure world-readability for trusted.gpg in postinst (Closes: 647001)
 +  * ensure partial dirs are 0700 and owned by _apt:root
 +  * use _apt:root only for partial directories
 +  * display errortext for all Err
 +  * set PR_SET_NO_NEW_PRIVS also if run as non-root
 +
 +  [ James McCoy ]
 +  * ensure apt-key del handles 16-byte key ids (Closes: 754436)
 +
 +  [ Kenshi Muto ]
 +  * Japanese program translation update (Closes: 763033)
 +
 +  [ Trần Ngọc Quân ]
 +  * Set STRIP_FROM_PATH for doxygen
 +
 +  [ Mert Dirik ]
 +  * Turkish program translation update (Closes: 763379)
 +
 +  [ Guillem Jover ]
 +  * apt-get: Create the temporary downloaded changelog inside tmpdir
 +
 +  [ Miroslav Kure ]
 +  * [l10n] Updated Czech translation of apt (Closes: #764055)
 +
 + -- Michael Vogt <mvo@ubuntu.com>  Wed, 08 Oct 2014 09:37:35 +0200
 +
 +apt (1.1~exp3) experimental; urgency=medium
 +
 +  [ Michael Vogt ]
 +  * merged changes from debian/sid up to 1.0.9.1
 +  * Make /var/lib/apt/lists and /var/cache/apt/archives owned
 +    by the new _apt user
 +  * Drop Privileges in the following acquire methods:
 +     copy, http, https, ftp, gpgv, gzip/bzip2/lzma/xz 
 +  * DropPrivs: Improvements based on feedback from error@debian.org
 +
 +  [ Julian Andres Klode ]
 +  * DropPriv: Really call seteuid and not setuid, and add more checks
 +  * Use _apt as our unprivileged user name
 +  * DropPrivs: Also check for saved set-user-ID and set-group-ID
 +  * methods: Fail if we cannot drop privileges
 +  * DropPrivs: Also check for saved set-user-ID and set-group-ID
 +
 + -- Michael Vogt <mvo@debian.org>  Wed, 24 Sep 2014 22:30:09 +0200
 +
 +apt (1.1~exp2) experimental; urgency=medium
 +
 +  [ Guillem Jover ]
 +  * Add new Base256ToNum long long overload function
 +  * Fix ar and tar code to be LFS-safe (Closes: #742882)
 +
 +  [ Michael Vogt ]
 +  * increase libapt-inst to version 1.6
 +  * Only allow "apt-get build-dep path" when path starts with ./ or /
 +  * Allow passing a full path to apt-get install /foo/bar.deb (CLoses: #752327)
 +  * merge changes from the 1.0.6 upload
 +
 + -- Michael Vogt <mvo@debian.org>  Thu, 10 Jul 2014 13:18:08 +0200
 +
 +apt (1.1~exp1) experimental; urgency=low
 +
 +  [ David Kalnischkies ]
 +  * [API Break] change "std::string pkgAcquire::Item::DescURI()" to
 +                       "std::string pkgAcquire::Item::DescURI() const"
 +  * [ABI-Break] increase hashtable size for packages/groups by factor 5
 +  * [ABI-Break] cleanup datatypes mix used in binary cache
 +  * [internal API-Break] remove the Section member from package struct
 +  * use 'best' hash for source authentication (LP: 1098738)
 +  * use HashStringList in the acquire system
 +  * deal with hashes in ftparchive more dynamic as well
 +  * reenable pipelining via hashsum reordering support
 +  * parse and retrieve multiple Descriptions in one record
 +  * improve pkgTagSection scanning and parsing
 +  * invalid cache if architecture set doesn't match (Closes: 745036)
 +
 +  [ Michael Vogt ]
 +  * add support for "apt-get build-dep foo.dsc"
 +  * add support for "apt-get build-dep unpacked-source-dir"
 +  * add support for "apt-get install foo_1.0_all.deb"
 +  * make "apt-get update" progress much more accurate by loading the
 +    sizes of the targets into the fetcher early
 +  * Implement simple by-hash for apt update to improve reliability of
 +    the update. Apt will try to fetch the Packages file via
 +    /by-hash/$hash_type/$hash_value if the repo supports that.
 +    - add APT::Acquire::$(host)::By-Hash=1 knob
 +    - add Acquire-By-Hash=1 to Release file
 +  * add Debug::Acquire::Progress debug option
 +  * [ABI-Break] lp:~mvo/apt/source-hashes:
 +    - use sha{512,256,1} for deb-src when available LP: #1098738
 +  * [ABI-Break] stop exporting the accidently exported parsenetrc() symbol
 +  * [ABI-Break] remove the PACKAGE_MATCHER_ABI_COMPAT defines
 +  * [ABI BREAK] apt-pkg/pkgcache.h:
 +    - adjust pkgCache::State::VerPriority enum, to match reality
 +  * test/integration/test-debsrc-hashes:
 +    - add integration test, thanks to Daniel Hartwig
 +  * [ABI-Break] remove the PACKAGE_MATCHER_ABI_COMPAT defines
 +  * [ABI-Break] Pass struct IndexTarget/indexRecords to
 +    pkgAcqIndex{,Merge}Diffs
 +  * [internal API-Break] rename pkgCache::Package::NextPackage to
 +    pkgCache::Package::Next
 +  * Calculate Percent as part of pkgAcquireStatus to provide a weighted
 +    percent for both items and bytes
 +  * apt-pkg/contrib/macros.h: bump library version to 4.13
 +  * apt-private/acqprogress.cc: do not show file size on IMSHit, it wasn't
 +    fetched
 +  * Fix warnings from clang -Wall/clang -fsanitize=address
 +  * add DropPrivs() and drop privileges to nobody when running the
 +    the buildin apt and dump solvers
 +  * lp:~mvo/apt/webserver-simulate-broken-with-fix346386:
 +    - fix invalid InRelease file download checking and add regression
 +      test to server broken files to the buildin test webserver
 +    - add regression test for LP: #34638
 +
 + -- Michael Vogt <mvo@debian.org>  Thu, 19 Jun 2014 12:01:48 +0200
 +
+ apt (1.0.9.8) unstable; urgency=medium
+   [ David Kalnischkies ]
+   * fix another d(e)select-upgrade typo (LP: #1399037)
+   * properly handle expected filesize in https.
+     Thanks to Robert Edmonds and Anders Kaseorg for initial patchs
+     (Closes: 777565, 781509) (LP: #807303)
+   * avoid depends on std::string implementation for pkgAcquire::Item::Mode
+     (Closes: 781858)
+   * demote VectorizeString gcc attribute from const to pure
+   * keyids in "apt-key del" should be case-insensitive (Closes: 781696)
+   * parse specific-arch dependencies correctly on single-arch systems
+     (Closes: 777760)
+   [ Michael Vogt ]
+   * fix crash in order writing in pkgDPkgPM::WriteApportReport() (LP: #1436626)
+  -- David Kalnischkies <david@kalnischkies.de>  Mon, 13 Apr 2015 07:14:36 +0200
  apt (1.0.9.7) unstable; urgency=medium
  
    [ Tomasz Buchert ]
index 989fe658c428ae963e1838aa2859660883a3a3f7,b4f823ef18d8ff05034cb2073e01b3895fbed617..486acccc80c406c002789135b4119a333fe741aa
@@@ -39,145 -23,97 +39,152 @@@ testrun() 
  gpg: Total number processed: 1
  gpg:              unchanged: 1' aptkey --fakeroot update
  
 -aptkey list | grep '^pub' > aptkey.list
 -testfileequal ./aptkey.list 'pub   2048R/DBAC8DAE 2010-08-18'
 +      testaptkeys 'pub   2048R/DBAC8DAE 2010-08-18'
  
 -testsuccess aptkey --fakeroot add ./keys/rexexpired.pub
 +      testfailure test -e rootdir/etc/apt/trusted.gpg
 +      testsuccess aptkey --fakeroot add ./keys/rexexpired.pub
 +      msgtest 'Check if trusted.gpg is created with permissions set to' '0644'
 +      if [ "$(stat -c '%a' rootdir/etc/apt/trusted.gpg )" = '644' ]; then
 +              msgpass
 +      else
 +              msgfail
 +      fi
  
 -aptkey list | grep '^pub' > aptkey.list
 -testfileequal ./aptkey.list 'pub   2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
 +      testaptkeys 'pub   2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
  pub   2048R/DBAC8DAE 2010-08-18'
  
 -msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
 -testsuccess --nomsg aptkey --fakeroot update
 -
 -aptkey list | grep '^pub' > aptkey.list
 -testfileequal ./aptkey.list 'pub   2048R/DBAC8DAE 2010-08-18'
 -
 -msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring'
 -testsuccess --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del DBAC8DAE
 +      msgtest 'Check that Sixpack key can be' 'exported'
 +      aptkey export 'Sixpack' > aptkey.export
 +      aptkey --keyring rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg exportall > aptkey.exportall
 +      testsuccess --nomsg cmp aptkey.export aptkey.exportall
 +      testsuccess test -s aptkey.export
 +      testsuccess test -s aptkey.exportall
 +
 +      msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
 +      testsuccess --nomsg aptkey --fakeroot update
 +
 +      testaptkeys 'pub   2048R/DBAC8DAE 2010-08-18'
 +
 +      msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring'
 +      testsuccess --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del DBAC8DAE
 +
 +      testaptkeys 'pub   2048R/DBAC8DAE 2010-08-18'
 +
 +      testsuccess aptkey --fakeroot del DBAC8DAE
 +      testempty aptkey list
 +
++      msgtest 'Test key removal with' 'lowercase key ID' #keylength somewher between 8byte and short
++      cleanplate
++      cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
++      testsuccess --nomsg aptkey --fakeroot del d141dbac8dae
++      testempty aptkey list
++
 +      msgtest 'Test key removal with' 'single key in real file'
 +      cleanplate
 +      cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 +      testempty aptkey list
 +      testfailure test -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 +
 +      msgtest 'Test key removal with' 'long key ID'
 +      cleanplate
 +      cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess --nomsg aptkey --fakeroot del 5A90D141DBAC8DAE
 +      testempty aptkey list
 +      testfailure test -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 +
 +      msgtest 'Test key removal with' 'fingerprint'
 +      cleanplate
 +      cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess --nomsg aptkey --fakeroot del 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
 +      testempty aptkey list
 +      testfailure test -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 +
 +      msgtest 'Test key removal with' 'single key in softlink'
 +      cleanplate
 +      ln -s $(readlink -f ./keys/joesixpack.pub) rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 +      testempty aptkey list
 +      testfailure test -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess test -L rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 +
 +      cleanplate
 +      testsuccess aptkey --fakeroot add ./keys/joesixpack.pub
 +      testsuccess aptkey --fakeroot add ./keys/marvinparanoid.pub
 +      testaptkeys 'pub   2048R/DBAC8DAE 2010-08-18
 +pub   2048R/528144E2 2011-01-16'
 +      cp -a rootdir/etc/apt/trusted.gpg keys/testcase-multikey.pub # store for reuse
 +
 +      msgtest 'Test key removal with' 'multi key in real file'
 +      cleanplate
 +      cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 +      testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 +      testaptkeys 'pub   2048R/528144E2 2011-01-16'
 +      testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
 +
 +      msgtest 'Test key removal with' 'multi key in softlink'
 +      cleanplate
 +      ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 +      testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 +      testaptkeys 'pub   2048R/528144E2 2011-01-16'
 +      testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
 +      testfailure test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 +      testsuccess test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
 +
 +      msgtest 'Test key removal with' 'multiple files including key'
 +      cleanplate
 +      cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 +      testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 +      testaptkeys 'pub   2048R/528144E2 2011-01-16'
 +      testfailure test -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 +      testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
 +
 +      cleanplate
 +      cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 +      cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 +      testaptkeys 'pub   2048R/DBAC8DAE 2010-08-18
 +pub   2048R/DBAC8DAE 2010-08-18
 +pub   2048R/528144E2 2011-01-16'
 +      msgtest 'Test merge-back of' 'added keys'
 +      testsuccess --nomsg aptkey adv --batch --yes --import keys/rexexpired.pub
 +      testaptkeys 'pub   2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
 +pub   2048R/DBAC8DAE 2010-08-18
 +pub   2048R/DBAC8DAE 2010-08-18
 +pub   2048R/528144E2 2011-01-16'
  
 -aptkey list | grep '^pub' > aptkey.list
 -testfileequal ./aptkey.list 'pub   2048R/DBAC8DAE 2010-08-18'
 +      msgtest 'Test merge-back of' 'removed keys'
 +      testsuccess --nomsg aptkey adv --batch --yes --delete-keys 27CE74F9
 +      testaptkeys 'pub   2048R/DBAC8DAE 2010-08-18
 +pub   2048R/DBAC8DAE 2010-08-18
 +pub   2048R/528144E2 2011-01-16'
  
 -testsuccess aptkey --fakeroot del DBAC8DAE
 -testempty aptkey list
 +      msgtest 'Test merge-back of' 'removed duplicate keys'
 +      testsuccess --nomsg aptkey adv --batch --yes --delete-keys DBAC8DAE
 +      testaptkeys 'pub   2048R/528144E2 2011-01-16'
 +}
  
 -# start from a clean plate again
 -cleanplate() {
 -      rm -rf rootdir/etc/apt/trusted.gpg.d/ rootdir/etc/apt/trusted.gpg
 -      mkdir rootdir/etc/apt/trusted.gpg.d/
 +setupgpgcommand() {
 +      echo "APT::Key::GPGCommand \"$1\";" > rootdir/etc/apt/apt.conf.d/00gpgcmd
 +      msgtest 'Test that apt-key uses for the following tests command' "$1"
 +      aptkey adv --version >aptkey.version 2>&1
 +      if grep -q "^Executing: $1 --" aptkey.version; then
 +              msgpass
 +      else
 +              cat aptkey.version
 +              msgfail
 +      fi
  }
  
 -msgtest 'Test key removal with' 'single key in real file'
 -cleanplate
 -cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 -testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 -testempty aptkey list
 -testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 -testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 -
 -msgtest 'Test key removal with' 'single key in softlink'
 -cleanplate
 -ln -s $(readlink -f ./keys/joesixpack.pub) rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 -testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 -testempty aptkey list
 -testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 -testsuccess test -L rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 -
 -cleanplate
 -testsuccess aptkey --fakeroot add ./keys/joesixpack.pub
 -testsuccess aptkey --fakeroot add ./keys/marvinparanoid.pub
 -aptkey list | grep '^pub' > aptkey.list
 -testfileequal ./aptkey.list 'pub   2048R/DBAC8DAE 2010-08-18
 -pub   2048R/528144E2 2011-01-16'
 -cp -a rootdir/etc/apt/trusted.gpg keys/testcase-multikey.pub # store for reuse
 -
 -msgtest 'Test key removal with' 'multi key in real file'
 -cleanplate
 -cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 -testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 -aptkey list | grep '^pub' > aptkey.list
 -testfileequal ./aptkey.list 'pub   2048R/528144E2 2011-01-16'
 -testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
 -
 -msgtest 'Test key removal with' 'multi key in softlink'
 -cleanplate
 -ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 -testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 -aptkey list | grep '^pub' > aptkey.list
 -testfileequal ./aptkey.list 'pub   2048R/528144E2 2011-01-16'
 -testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
 -testsuccess test ! -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 -testsuccess test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
 -
 -msgtest 'Test key removal with' 'multiple files including key'
 -cleanplate
 -cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 -cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
 -testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
 -aptkey list | grep '^pub' > aptkey.list
 -testfileequal ./aptkey.list 'pub   2048R/528144E2 2011-01-16'
 -testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 -testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 -testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
 -
 -msgtest 'Test key removal with' '8 byte key ID'
 -cleanplate
 -cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 -testsuccess --nomsg aptkey --fakeroot del 5A90D141DBAC8DAE
 -testempty aptkey list
 -
 -msgtest 'Test key removal with' 'lowercase key ID' #keylength somewher between 8byte and short
 -cleanplate
 -cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 -testsuccess --nomsg aptkey --fakeroot del d141dbac8dae
 -testempty aptkey list
 +# run with default (whatever this is)
 +testrun
 +# run with …
 +setupgpgcommand 'gpg'
 +testrun
 +setupgpgcommand 'gpg2'
 +testrun
++
index 490abb8731bab378d518fe9626c93e15d1ca3cd9,240f1a4d1efa2c542264121d9534cc324df06291..7870126f51ea012ee163d2bb429f8753380fc25a
@@@ -27,29 -31,7 +31,7 @@@ Inst cool-foo:i386 (1.0 unstable [i386]
  Conf foo (1.0 unstable [amd64])
  Conf cool-foo:i386 (1.0 unstable [i386])' aptget install cool-foo:i386 -s
  
- testsuccessequal 'Reading package lists...
- Building dependency tree...
- The following extra packages will be installed:
-   foo
- The following NEW packages will be installed:
-   cool-foo foo
- 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
- Inst foo (1.0 unstable [amd64])
- Inst cool-foo (1.0 unstable [amd64])
- Conf foo (1.0 unstable [amd64])
- Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 -s
- testsuccessequal 'Reading package lists...
- Building dependency tree...
- The following NEW packages will be installed:
-   cool-foo foo
- 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
- Inst foo (1.0 unstable [amd64])
- Inst cool-foo (1.0 unstable [amd64])
- Conf foo (1.0 unstable [amd64])
- Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:amd64 -s
 -testequal 'Reading package lists...
 +testsuccessequal 'Reading package lists...
  Building dependency tree...
  The following NEW packages will be installed:
    cool-foo foo:i386
@@@ -69,11 -51,7 +51,7 @@@ Inst cool-foo (1.0 unstable [amd64]
  Conf foo:armel (1.0 unstable [armel])
  Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:armel -s
  
 -testequal 'Reading package lists...
 +testsuccessequal 'Reading package lists...
  Building dependency tree...
  The following extra packages will be installed:
    bar
@@@ -85,8 -63,62 +63,62 @@@ Inst cool-bar:i386 (1.0 unstable [i386]
  Conf bar (1.0 unstable [amd64])
  Conf cool-bar:i386 (1.0 unstable [i386])' aptget install cool-bar:i386 -s
  
 -testequal 'Reading package lists...
 +testsuccessequal 'Reading package lists...
  Building dependency tree...
 -testequal 'Reading package lists...
+ The following NEW packages will be installed:
+   bar:i386 cool-bar
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst bar:i386 (1.0 unstable [i386])
+ Inst cool-bar (1.0 unstable [amd64])
+ Conf bar:i386 (1.0 unstable [i386])
+ Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:i386 -s
 -testequal "Reading package lists...
++testsuccessequal 'Reading package lists...
+ Building dependency tree...
+ The following NEW packages will be installed:
+   bar:armel cool-bar
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst bar:armel (1.0 unstable [armel])
+ Inst cool-bar (1.0 unstable [amd64])
+ Conf bar:armel (1.0 unstable [armel])
+ Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s
 -      testequal 'Reading package lists...
++testsuccessequal "Reading package lists...
+ Building dependency tree...
+ Note, selecting 'bar:i386' instead of 'bar-provider:i386'
+ The following NEW packages will be installed:
+   bar:i386 cool-bar
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst bar:i386 (1.0 unstable [i386])
+ Inst cool-bar (1.0 unstable [amd64])
+ Conf bar:i386 (1.0 unstable [i386])
+ Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 -s -q=0
+ satisfiable_in_singlearch() {
 -      testequal 'Reading package lists...
++      testsuccessequal 'Reading package lists...
+ Building dependency tree...
+ The following extra packages will be installed:
+   foo
+ The following NEW packages will be installed:
+   cool-foo foo
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst foo (1.0 unstable [amd64])
+ Inst cool-foo (1.0 unstable [amd64])
+ Conf foo (1.0 unstable [amd64])
+ Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 -s
 -      testequal 'Reading package lists...
++      testsuccessequal 'Reading package lists...
+ Building dependency tree...
+ The following NEW packages will be installed:
+   cool-foo foo
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst foo (1.0 unstable [amd64])
+ Inst cool-foo (1.0 unstable [amd64])
+ Conf foo (1.0 unstable [amd64])
+ Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:amd64 -s
++      testsuccessequal 'Reading package lists...
+ Building dependency tree...
  The following extra packages will be installed:
    bar
  The following NEW packages will be installed:
@@@ -97,7 -129,7 +129,7 @@@ Inst cool-bar (1.0 unstable [amd64]
  Conf bar (1.0 unstable [amd64])
  Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 -s
  
- testsuccessequal 'Reading package lists...
 -      testequal 'Reading package lists...
++      testsuccessequal 'Reading package lists...
  Building dependency tree...
  The following NEW packages will be installed:
    bar cool-bar
@@@ -107,44 -139,71 +139,71 @@@ Inst cool-bar (1.0 unstable [amd64]
  Conf bar (1.0 unstable [amd64])
  Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:amd64 -s
  
- testsuccessequal 'Reading package lists...
 -      testequal "Reading package lists...
++      testsuccessequal "Reading package lists...
  Building dependency tree...
+ Note, selecting 'bar' instead of 'bar-provider'
  The following NEW packages will be installed:
-   bar:i386 cool-bar
+   bar cool-bar
  0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
- Inst bar:i386 (1.0 unstable [i386])
+ Inst bar (1.0 unstable [amd64])
  Inst cool-bar (1.0 unstable [amd64])
- Conf bar:i386 (1.0 unstable [i386])
- Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:i386 -s
+ Conf bar (1.0 unstable [amd64])
+ Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q=0
  
- testsuccessequal 'Reading package lists...
 -      testequal 'Reading package lists...
++      testsuccessequal 'Reading package lists...
  Building dependency tree...
+ The following extra packages will be installed:
+   foo
  The following NEW packages will be installed:
-   bar:armel cool-bar
+   cool-foo-x64 foo
  0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
- Inst bar:armel (1.0 unstable [armel])
- Inst cool-bar (1.0 unstable [amd64])
- Conf bar:armel (1.0 unstable [armel])
- Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s
+ Inst foo (1.0 unstable [amd64])
+ Inst cool-foo-x64 (1.0 unstable [amd64])
+ Conf foo (1.0 unstable [amd64])
+ Conf cool-foo-x64 (1.0 unstable [amd64])' aptget install cool-foo-x64 -s
+ }
  
- testsuccessequal "Reading package lists...
+ #FIXME: do not work in single-arch as i386 isn't known at cache generation time
 -      testequal 'Reading package lists...
++      testsuccessequal 'Reading package lists...
  Building dependency tree...
- Note, selecting 'bar' instead of 'bar-provider'
+ The following extra packages will be installed:
+   foo
  The following NEW packages will be installed:
-   bar cool-bar
+   cool-foo-x32 foo
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst foo (1.0 unstable [amd64])
+ Inst cool-foo-x32 (1.0 unstable [amd64])
+ Conf foo (1.0 unstable [amd64])
+ Conf cool-foo-x32 (1.0 unstable [amd64])' aptget install cool-foo-x32 -s
 -      testequal 'Reading package lists...
++      testsuccessequal 'Reading package lists...
+ Building dependency tree...
+ The following extra packages will be installed:
+   bar
+ The following NEW packages will be installed:
+   bar cool-bar-x32
  0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  Inst bar (1.0 unstable [amd64])
- Inst cool-bar (1.0 unstable [amd64])
+ Inst cool-bar-x32 (1.0 unstable [amd64])
  Conf bar (1.0 unstable [amd64])
- Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q=0
+ Conf cool-bar-x32 (1.0 unstable [amd64])' aptget install cool-bar-x32 -s -q=0
  
- testsuccessequal "Reading package lists...
 -      testequal 'Reading package lists...
++      testsuccessequal 'Reading package lists...
  Building dependency tree...
- Note, selecting 'bar:i386' instead of 'bar-provider:i386'
+ The following extra packages will be installed:
+   bar
  The following NEW packages will be installed:
-   bar:i386 cool-bar
+   bar cool-bar-x64
  0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
- Inst bar:i386 (1.0 unstable [i386])
- Inst cool-bar (1.0 unstable [amd64])
- Conf bar:i386 (1.0 unstable [i386])
- Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 -s -q=0
+ Inst bar (1.0 unstable [amd64])
+ Inst cool-bar-x64 (1.0 unstable [amd64])
+ Conf bar (1.0 unstable [amd64])
+ Conf cool-bar-x64 (1.0 unstable [amd64])' aptget install cool-bar-x64 -s -q=0
+ satisfiable_in_singlearch
+ msgmsg 'switch to single architecture'
+ configarchitecture 'amd64'
+ satisfiable_in_singlearch
index cb6bc3cc24cd94d2891085f597308c2180eafe6f,ccfced15095e3c7ec75bfbe3fdc184fbf4df6c49..1c72d7b229d93fec7f678ff7dd0512d3b0695ff1
@@@ -54,8 -57,56 +57,56 @@@ Inst depender (1 unstable [all]
  Conf libc6:i386 (1 unstable [i386])
  Conf depender (1 unstable [all])' aptget install depender -s
  
 -testequal 'Reading package lists...
 +testsuccessequal 'Reading package lists...
  Building dependency tree...
+ The following extra packages will be installed:
+   libc6:i386
+ The following NEW packages will be installed:
+   depender-x32:i386 libc6:i386
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst libc6:i386 (1 unstable [i386])
+ Inst depender-x32:i386 (1 unstable [i386])
+ Conf libc6:i386 (1 unstable [i386])
+ Conf depender-x32:i386 (1 unstable [i386])' aptget install depender-x32:i386 -s
+ testequal 'Reading package lists...
+ Building dependency tree...
+ The following extra packages will be installed:
+   libc6:i386
+ The following NEW packages will be installed:
+   depender-x32 libc6:i386
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst libc6:i386 (1 unstable [i386])
+ Inst depender-x32 (1 unstable [amd64])
+ Conf libc6:i386 (1 unstable [i386])
+ Conf depender-x32 (1 unstable [amd64])' aptget install depender-x32:amd64 -s
+ testequal 'Reading package lists...
+ Building dependency tree...
+ The following extra packages will be installed:
+   libc6
+ The following NEW packages will be installed:
+   depender-x64 libc6
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst libc6 (1 unstable [amd64])
+ Inst depender-x64 (1 unstable [amd64])
+ Conf libc6 (1 unstable [amd64])
+ Conf depender-x64 (1 unstable [amd64])' aptget install depender-x64:amd64 -s
+ testequal 'Reading package lists...
+ Building dependency tree...
+ The following extra packages will be installed:
+   libc6
+ The following NEW packages will be installed:
+   depender-x64:i386 libc6
+ 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ Inst libc6 (1 unstable [amd64])
+ Inst depender-x64:i386 (1 unstable [i386])
+ Conf libc6 (1 unstable [amd64])
+ Conf depender-x64:i386 (1 unstable [i386])' aptget install depender-x64:i386 -s
+ testequal 'Reading package lists...
+ Building dependency tree...
  The following packages will be REMOVED:
    libold libold:i386
  The following NEW packages will be installed:
@@@ -75,9 -126,31 +126,31 @@@ The following NEW packages will be inst
  0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  Remv libold:i386 [1]
  Inst breaker-x32 (1 unstable [amd64])
- Conf breaker-x32 (1 unstable [amd64])' aptget install breaker-x32 -s
+ Conf breaker-x32 (1 unstable [amd64])' aptget install breaker-x32:amd64 -s
+ testequal 'Reading package lists...
+ Building dependency tree...
+ The following packages will be REMOVED:
+   libold:i386
+ The following NEW packages will be installed:
+   breaker-x32:i386
+ 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+ Remv libold:i386 [1]
+ Inst breaker-x32:i386 (1 unstable [i386])
+ Conf breaker-x32:i386 (1 unstable [i386])' aptget install breaker-x32:i386 -s
+ testequal 'Reading package lists...
+ Building dependency tree...
+ The following packages will be REMOVED:
+   libold
+ The following NEW packages will be installed:
+   breaker-x64
+ 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+ Remv libold [1]
+ Inst breaker-x64 (1 unstable [amd64])
+ Conf breaker-x64 (1 unstable [amd64])' aptget install breaker-x64:amd64 -s
  
 -testequal 'Reading package lists...
 +testsuccessequal 'Reading package lists...
  Building dependency tree...
  The following packages will be REMOVED:
    libold
@@@ -86,9 -159,9 +159,9 @@@ The following NEW packages will be inst
  0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  Remv libold [1]
  Inst breaker-x64:i386 (1 unstable [i386])
- Conf breaker-x64:i386 (1 unstable [i386])' aptget install breaker-x64 -s
+ Conf breaker-x64:i386 (1 unstable [i386])' aptget install breaker-x64:i386 -s
  
 -testequal 'Reading package lists...
 +testsuccessequal 'Reading package lists...
  Building dependency tree...
  The following NEW packages will be installed:
    oldconflictor
@@@ -132,8 -205,16 +205,16 @@@ The following packages have unmet depen
   foo-depender:i386 : Depends: foo:i386 but it is not installable
  E: Unable to correct problems, you have held broken packages.' aptget install foo-depender:i386 -s
  
 -testequal 'Reading package lists...
 +testsuccessequal 'Reading package lists...
  Building dependency tree...
+ The following NEW packages will be installed:
+   foo-native-depender
+ 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+ Inst foo-native-depender (1 unstable [amd64])
+ Conf foo-native-depender (1 unstable [amd64])' aptget install foo-native-depender -s
+ testequal 'Reading package lists...
+ Building dependency tree...
  The following NEW packages will be installed:
    foo-foreign-depender:i386
  0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.