diff options
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 10 | ||||
-rw-r--r-- | apt-pkg/install-progress.cc | 2 | ||||
-rw-r--r-- | cmdline/apt-get.cc | 2 | ||||
-rwxr-xr-x | test/integration/test-apt-get-source | 2 | ||||
-rwxr-xr-x | test/integration/test-apt-key-net-update | 21 | ||||
-rwxr-xr-x | test/integration/test-apt-progress-fd-conffile | 43 |
6 files changed, 73 insertions, 7 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index b4bfd1400..0d73733d5 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -44,6 +44,7 @@ #include <unistd.h> #include <sys/ioctl.h> #include <pty.h> +#include <stdio.h> #include <apti18n.h> /*}}}*/ @@ -596,7 +597,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line) errors look like this: 'status: /var/cache/apt/archives/krecipes_0.8.1-0ubuntu1_i386.deb : error : trying to overwrite `/usr/share/doc/kde/HTML/en/krecipes/krectip.png', which is also in package krecipes-data and conffile-prompt like this - 'status: conffile-prompt: conffile : 'current-conffile' 'new-conffile' useredited distedited + 'status:/etc/compiz.conf/compiz.conf : conffile-prompt: 'current-conffile' 'new-conffile' useredited distedited */ if (prefix == "status") { @@ -608,7 +609,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line) WriteApportReport(list[1].c_str(), list[3].c_str()); return; } - else if(action == "conffile") + else if(action == "conffile-prompt") { d->progress->ConffilePrompt(list[1], PackagesDone, PackagesTotal, list[3]); @@ -1036,7 +1037,10 @@ void pkgDPkgPM::StartPtyMagic() if (tcgetattr(STDOUT_FILENO, &d->tt) == 0) { ioctl(1, TIOCGWINSZ, (char *)&win); - if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0) + if (_config->FindB("Dpkg::Use-Pty", true) == false) + { + d->master = d->slave = -1; + } else if (openpty(&d->master, &d->slave, NULL, &d->tt, &win) < 0) { _error->Errno("openpty", _("Can not write log (%s)"), _("Is /dev/pts mounted?")); d->master = d->slave = -1; diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index b82b7efde..0caf62b61 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -9,7 +9,7 @@ #include <sys/ioctl.h> #include <sstream> #include <fcntl.h> - +#include <stdio.h> namespace APT { namespace Progress { diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0b980cdf4..730d3ea18 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -419,7 +419,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, if (Last != 0 || VerTag.empty() == true) break; - _error->Error(_("Ignore unavailable version '%s' of package '%s'"), VerTag.c_str(), TmpSrc.c_str()); + _error->Error(_("Can not find version '%s' of package '%s'"), VerTag.c_str(), TmpSrc.c_str()); return 0; } diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index c8db4edbe..3ee7a9e23 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -62,7 +62,7 @@ Need to get 0 B of source archives. # unavailable one testequal "$HEADER -E: Ignore unavailable version '9.9-not-there' of package 'foo' +E: Can not find version '9.9-not-there' of package 'foo' E: Unable to find a source package for foo" aptget source -q --print-uris foo=9.9-not-there # version and release diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update index d5205836f..73545aff7 100755 --- a/test/integration/test-apt-key-net-update +++ b/test/integration/test-apt-key-net-update @@ -21,10 +21,29 @@ TRUSTEDFILE=./etc/apt/trusted.gpg mkdir -p ./var/lib/apt/keyrings TMP_KEYRING=./var/lib/apt/keyrings/maybe-import-keyring.gpg GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring" + +# FIXME: instead of copying this use apt-key and the buildin apt webserver +# to do a real test + +# COPYIED from apt-key.in -------------- + +# gpg needs a trustdb to function, but it can't be invalid (not even empty) +# so we create a temporary directory to store our fresh readable trustdb in +TRUSTDBDIR="$(mktemp -d)" +CURRENTTRAP="${CURRENTTRAP} rm -rf '${TRUSTDBDIR}';" +trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM +chmod 700 "$TRUSTDBDIR" +# We also don't use a secret keyring, of course, but gpg panics and +# implodes if there isn't one available - and writeable for imports +SECRETKEYRING="${TRUSTDBDIR}/secring.gpg" +touch $SECRETKEYRING +GPG_CMD="$GPG_CMD --secret-keyring $SECRETKEYRING" +GPG_CMD="$GPG_CMD --trustdb-name ${TRUSTDBDIR}/trustdb.gpg" +#----------------------------------------- END COPY + GPG="$GPG_CMD --keyring $TRUSTEDFILE" MASTER_KEYRING=/usr/share/keyrings/ubuntu-master-keyring.gpg - msgtest "add_keys_with_verify_against_master_keyring" if [ ! -e $MASTER_KEYRING ]; then echo -n "No $MASTER_KEYRING found" diff --git a/test/integration/test-apt-progress-fd-conffile b/test/integration/test-apt-progress-fd-conffile new file mode 100755 index 000000000..0b42b1b2f --- /dev/null +++ b/test/integration/test-apt-progress-fd-conffile @@ -0,0 +1,43 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'native' + +# old conffile +setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable' +BUILDDIR='incoming/compiz-core-1.0' +mkdir -p ${BUILDDIR}/debian/compiz-core/etc +echo 'foo=bar;' > ${BUILDDIR}/compiz.conf +echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' 'native' +rm -rf "$BUILDDIR" + +# new conffile +setupsimplenativepackage 'compiz-core' 'native' '2.0' 'unstable' +BUILDDIR='incoming/compiz-core-2.0' +mkdir -p ${BUILDDIR}/debian/compiz-core/etc +echo 'foo2=bar2;' > ${BUILDDIR}/compiz.conf +echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' 'native' +rm -rf "$BUILDDIR" + +setupaptarchive + +testsuccess aptget install compiz-core=1.0 + +# fake conffile change +echo "meep" >> rootdir/etc/compiz.conf/compiz.conf + +# install +exec 3> apt-progress.log +echo n | aptget install compiz-core=2.0 -o APT::Status-Fd=3 -o Dpkg::Use-Pty=false + +# and ensure there is a conffile message in the file +msgtest "Conffile prompt in apt-progress.log" +grep -q "pmconffile:/etc/compiz.conf/compiz.conf" apt-progress.log && msgpass || (cat apt-progress.log && msgfail) + +cat apt-progress.log
\ No newline at end of file |