* Remove `~' from Debian package filenames (they're not allowed in the

Nix store at top-level for portability reasons).  (NIX-106)

svn path=/nixpkgs/trunk/; revision=12133
This commit is contained in:
Eelco Dolstra 2008-06-17 07:53:09 +00:00
parent 0591ccedc0
commit a3d259adf0

View File

@ -1,6 +1,7 @@
use strict; use strict;
use Dpkg::Cdata; use Dpkg::Cdata;
use Dpkg::Deps; use Dpkg::Deps;
use File::Basename;
my $packagesFile = shift @ARGV; my $packagesFile = shift @ARGV;
my $urlPrefix = shift @ARGV; my $urlPrefix = shift @ARGV;
@ -136,10 +137,15 @@ foreach my $pkgName (@order) {
print " [\n\n" if $newComponent; print " [\n\n" if $newComponent;
$newComponent = 0; $newComponent = 0;
my $origName = basename $cdata->{Filename};
my $cleanedName = $origName;
$cleanedName =~ s/~//g;
print " (fetchurl {\n"; print " (fetchurl {\n";
print " url = $urlPrefix/$cdata->{Filename};\n"; print " url = $urlPrefix/$cdata->{Filename};\n";
print " sha256 = \"$cdata->{SHA256}\";\n"; print " sha256 = \"$cdata->{SHA256}\";\n";
print " name = \"$cleanedName\";\n" if $cleanedName ne $origName;
print " })\n"; print " })\n";
print "\n"; print "\n";