* This may be useful in the future.

This commit is contained in:
Eelco Dolstra 2006-05-31 09:24:54 +00:00
parent 1390ce4142
commit 04cf72287b
3 changed files with 21 additions and 2 deletions

View File

@ -5,13 +5,14 @@ bin_SCRIPTS = nix-collect-garbage \
noinst_SCRIPTS = nix-profile.sh generate-patches.pl
nix-pull nix-push: readmanifest.pm download-using-manifests.pl
nix-pull nix-push: readmanifest.pm readconfig.pm download-using-manifests.pl
install-exec-local: readmanifest.pm download-using-manifests.pl
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/profile.d
$(INSTALL_PROGRAM) nix-profile.sh $(DESTDIR)$(sysconfdir)/profile.d/nix.sh
$(INSTALL) -d $(DESTDIR)$(libexecdir)/nix
$(INSTALL_DATA) readmanifest.pm $(DESTDIR)$(libexecdir)/nix
$(INSTALL_DATA) readconfig.pm $(DESTDIR)$(libexecdir)/nix
$(INSTALL_PROGRAM) download-using-manifests.pl $(DESTDIR)$(libexecdir)/nix
$(INSTALL) -d $(DESTDIR)$(sysconfdir)/nix
@ -22,6 +23,7 @@ EXTRA_DIST = nix-collect-garbage.in \
nix-prefetch-url.in nix-install-package.in \
nix-channel.in \
readmanifest.pm.in \
readconfig.pm.in \
nix-build.in \
download-using-manifests.pl.in \
generate-patches.pl.in \

View File

@ -26,7 +26,7 @@ $stateDir = "@localstatedir@/nix" unless defined $stateDir;
umask 0022;
# Obtain URLs either from the command line or from a configuration file.
# Process the URLs specified on the command line.
my %narFiles;
my %patches;
my %successors;

17
scripts/readconfig.pm.in Normal file
View File

@ -0,0 +1,17 @@
use strict;
sub readConfig {
my %config;
my $config = "@sysconfdir@/nix/nix.conf";
return unless -f $config;
open CONFIG, "<$config" or die "cannot open `$config'";
while (<CONFIG>) {
/^\s*([\w|-]+)\s*=\s*(.*)$/ or next;
$config{$1} = $2;
print "|$1| -> |$2|\n";
}
close CONFIG;
}
return 1;