Changeset 171


Ignore:
Timestamp:
09/21/12 12:22:40 (12 years ago)
Author:
kdeugau
Message:

/trunk

Improve handling for Source: entries

  • Internal housekeeping to prevent "Use of undefined...." errors
  • Move filename-extraction into preamble parse; I have yet to see a live use case for always retrieving a file from a remote source.
  • Don't try to add a null "main" source to the source package; this would add all files in %_topdir/SOURCES to the .sdeb whether they're really listed in a SourceNN: entry or not.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r170 r171  
    179179#       Requires, Provides
    180180# 10/31/2005 Maybe this should be flatter?  -kgd
    181 my %pkgdata;
     181my %pkgdata = (main => {source => ''});
    182182my @pkglist = ('main'); #sigh
    183183# Files listing.  Embedding this in %pkgdata would be, um, messy.
     
    671671    if (/^\%prep/) {
    672672      $stage = 'prep';
    673       # This really should be local-ish, but we need just the filename for the source
    674       $pkgdata{main}{source} =~ s|.+/([^/]+)$|$1|;
    675673      # Replace some core macros
    676674      $pkgdata{main}{source} = expandmacros($pkgdata{main}{source},'gp');
     
    951949      } elsif (/^source0?:\s*(.+)/i) {
    952950        $pkgdata{main}{source} = $1;
     951        # Do this here since we don't use any URL forms elsewhere (maybe some other time)
     952        $pkgdata{main}{source} =~ s|^.+/([^/]+)$|$1|;
    953953        # .tar, .tar.gz, .tar.bz2, .tgz
    954954        die "Unknown tarball format $1\n" if $1 !~ /\.(?:tar(?:\.(?:gz|bz2))?|tgz)$/;
    955       } elsif (/^source([0-9]+):\s*(.+)/i) {
    956         $pkgdata{sources}{$1} = $2;
     955      } elsif (my ($srcnum, $src) = (/^source([0-9]+):\s*(.+)/i)) {
     956        $pkgdata{sources}{$srcnum} = $src;
     957        # Do this here since we don't use any URL forms elsewhere (maybe some other time)
     958        $pkgdata{sources}{$srcnum} =~ s|^.+/([^/]+)$|$1|;
    957959      } elsif (/^patch([^:]+):\s*(.+)$/i) {
    958960        my $patchname = "patch$1";
     
    13981400  $paxcmd = "cd $topdir; pax -w ";
    13991401
    1400 # tweak source entry into usable form.  Need it locally somewhere along the line.
    1401   (my $pkgsrc = $pkgdata{main}{source}) =~ s|.+/([^/]+)$|$1|;
    1402   $paxcmd .= "SOURCES/$pkgsrc ";
     1402  # some packages may not have a "main" source.
     1403  $paxcmd .= "SOURCES/$pkgdata{main}{source} " if $pkgdata{main}{source};
    14031404
    14041405  # create file list:  Source[nn], Patch[nn]
Note: See TracChangeset for help on using the changeset viewer.