~ubuntu-branches/ubuntu/trusty/dpkg/trusty-proposed

« back to all changes in this revision

Viewing changes to utils/t/100_update_alternatives.t

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-10-23 16:45:37 UTC
  • mfrom: (1.5.16 sid)
  • Revision ID: package-import@ubuntu.com-20121023164537-uvt7ie3wd3459h6s
Tags: 1.16.9ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Change the multiarch downgrade version checks in prerm/postrm
    from 1.16.2 to 1.16.0~ to reflect when multiarch landed in Ubuntu.
  - Migrate dpkg multiarch conffile (and other multi-arch-related
    conf settings) to the new DB with dpkg --add-architecture, but
    keep a copy of the old conffile if it was modified.
  - Out of paranoia, keep an option handler for foreign-architecture
    that informs people that they need to scrub their config files
    and upgrade, on the off chance that the above migration fails
    for some reason (this mitigates the chances of leaving users with
    a dpkg that fails to run due to a broken config).
  - Add DPKG_UNTRANSLATED_MESSAGES environment check so that higher-level
    tools can get untranslated dpkg terminal log messages while at the
    same time having translated debconf prompts.  This is useful for tools
    that hide the dpkg terminal by default and use apport for bug
    reporting with the untranslated error message.
  - Build-depend on gettext:any for cross-building support.
  - Apply patch from Steve McIntyre to special-case armhf/armel ELF
    objects in Shlibs/Objdump.pm, so we don't get incorrect deps.
  - lib/dpkg/pkg-spec.c: map unqualified package names of multiarch-same
    packages to the native arch instead of throwing an error, so that we
    don't break on upgrade when there are unqualified names stored in
    dpkg's own trigger database.
  - Add logic to the postinst to `dpkg --add-architecture i386' on new
    installs on amd64, and to also do so on upgrades from pre-conffile
    Ubuntu versions, mimicking our previous behaviour with the conffile.
  - Apply a workaround from mvo to consider RC packages as multiarch,
    during the dpkg consistency checks. (see LP: 1015567 and 1057367).

Show diffs side-by-side

added added

removed removed

Lines of Context:
260
260
    open(FILE, "<", "$admindir/generic-test") or die $!;
261
261
    my $content = <FILE>;
262
262
    close(FILE);
263
 
    is($content,
 
263
 
 
264
    my $expected =
264
265
"auto
265
266
$bindir/generic-test
266
267
slave1
272
273
slave4
273
274
$bindir/slave4
274
275
 
275
 
$paths{false}
276
 
10
277
 
$paths{date}
278
 
 
279
 
 
280
 
 
281
 
$paths{sleep}
282
 
5
283
 
 
284
 
 
285
 
 
286
 
 
287
 
$paths{true}
288
 
20
289
 
$paths{yes}
290
 
$paths{cat}
291
 
$paths{cat}
292
 
$paths{cat}
293
 
 
294
 
", "administrative file is as expected");
 
276
";
 
277
 
 
278
    my %slaves;
 
279
 
 
280
    # Store slaves in a hash to easily retrieve present and missing ones.
 
281
    foreach my $alt (@choices) {
 
282
        foreach my $slave (@{$alt->{slaves}}) {
 
283
            $slaves{$slave->{name}}{$alt->{path}} = $slave;
 
284
        }
 
285
    }
 
286
 
 
287
    foreach my $alt (sort { $a->{path} cmp $b->{path} } @choices) {
 
288
        $expected .= $alt->{path} . "\n";
 
289
        $expected .= $alt->{priority} . "\n";
 
290
        foreach my $slave_name (sort keys %slaves) {
 
291
            $expected .= $slaves{$slave_name}{$alt->{path}}{path} || "";
 
292
            $expected .= "\n";
 
293
        }
 
294
    }
 
295
    $expected .= "\n";
 
296
 
 
297
    is($content, $expected, "administrative file is as expected");
295
298
}
296
299
 
297
300
# manual change with --set-selections