From bc1b2301df73c374c59f44841e7d47861311c531 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 2 Sep 2015 17:39:05 +0200 Subject: [PATCH] Use attribute paths in the package database --- generate-programs-index.pl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/generate-programs-index.pl b/generate-programs-index.pl index af68382..d2c0169 100755 --- a/generate-programs-index.pl +++ b/generate-programs-index.pl @@ -45,18 +45,16 @@ sub process_dir { for my $system ("x86_64-linux", "i686-linux") { print STDERR "indexing programs for $system...\n"; - my $out = `nix-env -f $nixExprs -qa \\* --out-path --argstr system $system`; + my $out = `nix-env -f $nixExprs -qaP \\* --out-path --argstr system $system`; die "cannot evaluate Nix expressions for $system" if $? != 0; foreach my $line (split "\n", $out) { - my ($name, $outPath) = split ' ', $line; - die unless $name && $outPath; + my ($attrName, $name, $outPath) = split ' ', $line; + die unless $attrName && $name && $outPath; next unless defined $narFiles{$outPath}; next unless -d $outPath; - my $pkgname = $name; - $pkgname =~ s/-\d.*//; - process_dir($system, $pkgname, "$outPath/bin"); - process_dir($system, $pkgname, "$outPath/sbin"); + process_dir($system, $attrName, "$outPath/bin"); + process_dir($system, $attrName, "$outPath/sbin"); } }