File: 0001-Add-support-for-Contents-udeb-.gz-files-debian-insta.patch

package info (click to toggle)
apt-file 2.5.4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 632 kB
  • ctags: 77
  • sloc: perl: 1,309; python: 132; makefile: 100; sh: 87
file content (59 lines) | stat: -rw-r--r-- 2,122 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
>From 3c6359fddd670adfe876220230f4131edfaa4bac Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Wed, 22 Oct 2014 02:25:07 +0200
Subject: [PATCH] Add support for Contents-udeb-*.gz files (debian-installer).

When <foo>/debian-installer is detected in sources.list, fetch:
  <foo>/Contents-udeb-<arch>.gz

instead of:
  <foo>/Contents-<arch>.gz

This makes apt-file search look into new files automatically. It's also
possible to filter results using a tweaked architecture e.g.:

    apt-file search -a udeb-amd64 sata_mv.ko

Signed-off-by: Cyril Brulebois <kibi@debian.org>
---
 apt-file | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/apt-file b/apt-file
index 323b0c1..5a1c63c 100755
--- a/apt-file
+++ b/apt-file
@@ -178,8 +178,13 @@ sub parse_sources_list($) {
 
             my $fetch = [];
 
+            # Transform $area/debian-installer into $area:debian-installer for
+            # easy matching below, fetching Contents-udeb-<arch>.gz instead of
+            # Contents-<arch>.gz
+            #
+            # FIXME: What do we do if $2 is different from 'debian-installer'?
             foreach (@extra) {
-                push @$fetch, m{(.*?)/(?:.*)}o ? "$dist/$1" : "$dist/$_";
+                push @$fetch, m{(.*?)/(.*)}o ? "$dist/$1:$2" : "$dist/$_";
             }
 
             foreach ( @{ ( unique $fetch) } ) {
@@ -199,6 +204,15 @@ sub parse_sources_list($) {
                 $dest = $Conf->{destination};
                 my $cache = $Conf->{cache};
                 my $arch  = $Conf->{arch};
+                # udebs are indexed separately, tweak the architecture if
+                # needed:
+                if ( $dist =~ s{:debian-installer$}{} ) {
+                    $arch = "udeb-$arch";
+                }
+                elsif ( $dist =~ m{:[^/]*$} ) {
+                    # See FIXME above, ignore this entry for now.
+                    next;
+                }
                 my $cdrom = $Conf->{cdrom_mount};
                 foreach my $var (
                     qw/host port user passwd path dist pkg
-- 
2.1.1