Package: aptitude Version: 0.6.3-2 Severity: normal Tags: patch User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu maverick ubuntu-patch
When I tell aptitude to install a certain version of a package - and this version is not available - it outputs an error (Unable to find a version "..." for the package...) - but still returns 0(=OK). This is a problem when automating installs using aptitude, as it thinks all is well, when it isn't :( To reproduce, please run this command: # aptitude install subversion=1.5.1dfsg1-1ubuntu2~hardy2; echo "ret:$?" Reading package lists... Done Building dependency tree Reading state information... Done Reading extended state information Initializing package states... Done Building tag database... Done Unable to find a version "1.5.1dfsg1-1ubuntu2~hardy2" for the package "subversion" Unable to find a version "1.5.1dfsg1-1ubuntu2~hardy2" for the package "subversion" The following packages have been automatically kept back: libpq5 linux-libc-dev sun-java6-bin The following packages have been kept back: bind9-host dnsutils libbind9-30 libdns35 libisc35 libisccfg30 libkrb53 liblwres30 linux-image-server linux-server nfs-common sudo sun-java6-jre tzdata 0 packages upgraded, 0 newly installed, 0 to remove and 17 not upgraded. Need to get 0B of archives. After unpacking 0B will be used. Writing extended state information... Done Reading package lists... Done Building dependency tree Reading state information... Done Reading extended state information Initializing package states... Done Building tag database... Done ret:0 This bug was originally reported on Launchpad: https://bugs.launchpad.net/ubuntu/+source/aptitude/+bug/585408 -- Package-specific info: aptitude 0.6.3 compiled at Jul 30 2010 21:54:28 Compiler: g++ 4.4.5 20100723 (prerelease) Compiled against: apt version 4.10.0 NCurses version 5.7 libsigc++ version: 2.2.4.2 Ept support enabled. Gtk+ support disabled. Current library versions: NCurses version: ncurses 5.7.20100626 cwidget version: 0.5.16 Apt version: 4.10.0 linux-gate.so.1 => (0xb7896000) libapt-pkg.so.4.10 => /usr/lib/libapt-pkg.so.4.10 (0xb7782000) libncursesw.so.5 => /lib/libncursesw.so.5 (0xb773d000) libsigc-2.0.so.0 => /usr/lib/libsigc-2.0.so.0 (0xb7735000) libcwidget.so.3 => /usr/lib/libcwidget.so.3 (0xb7675000) libept.so.1 => /usr/lib/libept.so.1 (0xb7624000) libxapian.so.15 => /usr/lib/libxapian.so.15 (0xb74d7000) libz.so.1 => /lib/libz.so.1 (0xb74c2000) libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0xb7437000) libboost_iostreams.so.1.42.0 => /usr/lib/libboost_iostreams.so.1.42.0 (0xb741d000) libpthread.so.0 => /lib/libpthread.so.0 (0xb7403000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7318000) libm.so.6 => /lib/libm.so.6 (0xb72f2000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb72d5000) libc.so.6 => /lib/libc.so.6 (0xb7176000) libutil.so.1 => /lib/libutil.so.1 (0xb7172000) libdl.so.2 => /lib/libdl.so.2 (0xb716e000) libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb715c000) librt.so.1 => /lib/librt.so.1 (0xb7153000) /lib/ld-linux.so.2 (0xb7897000) Terminal: xterm $DISPLAY is set. `which aptitude`: /usr/bin/aptitude aptitude version information: aptitude linkage: *** /tmp/tmpcBgTt0 In Ubuntu, we've applied the attached patch to achieve the following: * src/cmdline/cmdline_action.cc: abort when wanting to install a version of a package that doesn't exist, many thanks Klavs Klavsen (LP: #585408) We thought you might be interested in doing the same. -- System Information: Debian Release: squeeze/sid APT prefers maverick-updates APT policy: (500, 'maverick-updates'), (500, 'maverick-security'), (500, 'maverick') Architecture: i386 (i686) Kernel: Linux 2.6.35-14-generic (SMP w/2 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
diff -Nru aptitude-0.6.3/debian/changelog aptitude-0.6.3/debian/changelog diff -Nru aptitude-0.6.3/debian/patches/debian-changes-0.6.3-2ubuntu4 aptitude-0.6.3/debian/patches/debian-changes-0.6.3-2ubuntu4 --- aptitude-0.6.3/debian/patches/debian-changes-0.6.3-2ubuntu4 1970-01-01 00:00:00.000000000 +0000 +++ aptitude-0.6.3/debian/patches/debian-changes-0.6.3-2ubuntu4 2010-08-13 00:54:56.000000000 +0000 @@ -0,0 +1,42 @@ +Description: Upstream changes introduced in version 0.6.3-2ubuntu4 + This patch has been created by dpkg-source during the package build. + Here's the last changelog entry, hopefully it gives details on why + those changes were made: + . + aptitude (0.6.3-2ubuntu4) maverick; urgency=low + . + * src/cmdline/cmdline_action.cc: abort when wanting to install a + version of a package that doesn't exist, many thanks Klavs Klavsen + (LP: #585408) + . + The person named in the Author field signed this changelog entry. +Author: Mohamed Amine IL Idrissi <ilidrissiam...@gmail.com> +Bug-Ubuntu: https://bugs.launchpad.net/bugs/585408 + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: <vendor|upstream|other>, <url of original patch> +Bug: <url in upstream bugtracker> +Bug-Debian: http://bugs.debian.org/<bugnumber> +Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> +Forwarded: <no|not-needed|url proving that it has been forwarded> +Reviewed-By: <name and email of someone who approved the patch> +Last-Update: <YYYY-MM-DD> + +--- aptitude-0.6.3.orig/src/cmdline/cmdline_action.cc ++++ aptitude-0.6.3/src/cmdline/cmdline_action.cc +@@ -308,6 +308,11 @@ bool cmdline_applyaction(cmdline_pkgacti + + pkgDepCache::StateCache &pkg_state((*apt_cache_file)[pkg]); + ++ if (!ver) ++ { ++ printf("Requested version not found in repositories: %s\n", sourcestr.c_str()); ++ abort(); ++ } + switch(action) + { + case cmdline_installauto: diff -Nru aptitude-0.6.3/debian/patches/series aptitude-0.6.3/debian/patches/series --- aptitude-0.6.3/debian/patches/series 2010-07-30 11:50:38.000000000 +0100 +++ aptitude-0.6.3/debian/patches/series 2010-08-13 00:54:56.000000000 +0000 @@ -12,3 +12,4 @@ 14_html2text_preferred no-google-mock 15_ftbfs_new_apt +debian-changes-0.6.3-2ubuntu4