[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] pkgsel: remove final use of aptitude (was: pkgsel: please clarify intention of "|| aptfailed")



Hi

Please consider reapplying the attached patch to remove the last
reliance on aptitude within d-i (pkgsel).  There is many months for
testing, though no regressions are anticipated as per the previous
mails:

On 6 August 2012 15:34, Daniel Hartwig <mandyke@gmail.com> wrote:
> On 6 August 2012 14:33, Christian PERRIER <bubulle@debian.org> wrote:
>>> These semantics could be enforced by replacing use of aptitude with
>>> equivalent calls to apt-get, or updating aptitude to 0.6.9 series (in
>>> experimental) which can report the errors similar to apt-get.  IMO
>>> apt-get is preferable because it is simpler and would ensure the most
>>> consistency possible within pkgsel.  However, there may be users who
>>> rely on the current implicit support of aptitude-only search patterns
>>> in pkgsel/include.
>>
>> I thik this is what should be done, despite this (minor)
>> inconvenience. We (IIRC) never documented that aptitude search
>> patterns are supported in pkgsel/include.
>>
>> Help in doing this is likely to be appreciated..:-)
>>
>
> Attached converts the aptitude calls to more-or-less equivalent
> apt-get.  On an installed system, aptitude is sometimes able to
> upgrade a few more packages than apt-get:
>
> $ aptitude -q --without-recommends -y full-upgrade -s | grep upgraded
> 548 packages upgraded, 18 newly installed, 5 to remove and 1 not upgraded.
> $ apt-get -q --no-install-recommends -y dist-upgrade -s | grep upgraded
> 544 upgraded, 12 newly installed, 2 to remove and 5 not upgraded.
>
> Given that the upgrade in pkgsel is performed on minimal system this
> is unlikely to be much of a difference, but note that I am not
> familiar with why pkgsel is using aptitude, or whether this use was
> introduced because apt-get was deemed to have issues sometimes.
>
> Regards
--- a/debian/postinst	2012-08-06 14:55:57.225921175 +0800
+++ b/debian/postinst	2012-08-06 14:59:32.697926026 +0800
@@ -76,13 +76,18 @@
 	tasksel_start=50
 else
 	upgrade_type="$RET"
+	# Convert to apt-get command names.
+	case "$RET" in
+	safe-upgrade) upgrade_type=upgrade;;
+	full-upgrade) upgrade_type=dist-upgrade;;
+	esac
 	db_progress INFO pkgsel/progress/upgrade
 	sleep 2 # allow the message to be seen
 
 	log "checking for (security) updates to the base system"
 	# Exclude Recommends to avoid installing new packages as part of
         # an upgrade.
-	in-target sh -c "debconf-apt-progress --from 50 --to 100 --logstderr -- aptitude -q --without-recommends -y -o DPkg::options=--force-confnew '$upgrade_type'" || aptfailed
+	in-target sh -c "debconf-apt-progress --from 50 --to 100 --logstderr -- apt-get -q --no-install-recommends -y -o DPkg::options=--force-confnew '$upgrade_type'" || aptfailed
 	tasksel_start=100
 fi
 
@@ -145,7 +150,7 @@
 	# Allow comma-separation so that this can more easily be preseeded
 	# at the kernel command line.
 	RET="$(printf '%s' "$RET" | sed 's/,/ /g')"
-	in-target sh -c "debconf-apt-progress --from 900 --to 950 --logstderr -- aptitude -q -y install -- $RET" || aptfailed
+	in-target sh -c "debconf-apt-progress --from 900 --to 950 --logstderr -- apt-get -q -y install -- $RET" || aptfailed
 fi
 
 log "finishing up"

Reply to: