From 15c035c13f3c452ffef3960e97bd0e9b38d98ec2 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 10 Aug 2016 08:20:51 -0400 Subject: [PATCH] Remove nix-install-package. Refs #831 --- .gitignore | 1 - .../command-ref/nix-install-package.xml | 208 ------------------ doc/manual/command-ref/utilities.xml | 1 - doc/manual/introduction/quick-start.xml | 12 - doc/manual/local.mk | 2 +- doc/manual/packages/one-click.xml | 37 ---- doc/manual/packages/package-management.xml | 1 - scripts/local.mk | 1 - scripts/nix-install-package.in | 127 ----------- tests/install-package.sh | 20 -- tests/local.mk | 2 +- 11 files changed, 2 insertions(+), 410 deletions(-) delete mode 100644 doc/manual/command-ref/nix-install-package.xml delete mode 100644 doc/manual/packages/one-click.xml delete mode 100755 scripts/nix-install-package.in delete mode 100644 tests/install-package.sh diff --git a/.gitignore b/.gitignore index a524e9b6a..245b89f3c 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,6 @@ Makefile.config /scripts/nix-switch /scripts/nix-collect-garbage /scripts/nix-prefetch-url -/scripts/nix-install-package /scripts/nix-channel /scripts/nix-build /scripts/nix-copy-closure diff --git a/doc/manual/command-ref/nix-install-package.xml b/doc/manual/command-ref/nix-install-package.xml deleted file mode 100644 index e17166caa..000000000 --- a/doc/manual/command-ref/nix-install-package.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - - nix-install-package - 1 - Nix - - - - - nix-install-package - install a Nix Package file - - - - - nix-install-package - - - - - - - path - - - - - - - url - - - file - - - - - - -Description - -The command nix-install-package interactively -installs a Nix Package file (*.nixpkg), which is -a small file that contains a store path to be installed along with the -URL of a binary cache. The Nix Package file is either -file, or automatically downloaded from -url if the switch is -used. - -nix-install-package is used in one-click installs to download and -install pre-built binary packages with all necessary dependencies. -nix-install-package is intended to be associated -with the MIME type application/nix-package in a web -browser so that it is invoked automatically when you click on -*.nixpkg files. When invoked, it restarts itself -in a terminal window (since otherwise it would be invisible when run -from a browser), asks the user to confirm whether to install the -package, and if so downloads and installs the package into the user’s -current profile. - -To obtain a window, nix-install-package tries -to restart itself with xterm, -konsole and -gnome-terminal. - - - - -Options - - - - - - Do not open a new terminal window and do not ask - for confirmation. - - - - - - - Install the package into the specified profile - rather than the user’s current profile. - - - - - - Install the package as the profile so that the - profile contains exactly the contents of the package. - - - - - - - - -Examples - -To install subversion-1.4.0.nixpkg into the -user’s current profile, without any prompting: - - -$ nix-install-package --non-interactive subversion-1.4.0.nixpkg - - - -To install the same package from some URL into a different -profile: - - -$ nix-install-package --non-interactive -p /nix/var/nix/profiles/eelco \ - --url http://nix.cs.uu.nl/dist/nix/nixpkgs-0.10pre6622/pkgs/subversion-1.4.0-i686-linux.nixpkg - - - - - - -Format of <literal>nixpkg</literal> files - -A Nix Package file consists of a single line with the following -format: - - -NIXPKG1 manifestURL name system drvPath outPath - -The elements are as follows: - - - - NIXPKG1 - - The version of the Nix Package - file. - - - - manifestURL - - Obsolete. - - - - name - - The symbolic name and version of the - package. - - - - system - - The platform identifier of the platform for which - this binary package is intended. - - - - drvPath - - The path in the Nix store of the derivation from - which outPath was built. Not currently - used. - - - - outPath - - The path in the Nix store of the - package. - - - - binaryCacheURL - - The URL of a binary cache containing the closure - of outPath. - - - - - - - -An example follows: - - -NIXPKG1 http://.../nixpkgs-0.10pre6622/MANIFEST subversion-1.4.0 i686-darwin \ - /nix/store/4kh60jkp...-subversion-1.4.0.drv \ - /nix/store/nkw7wpgb...-subversion-1.4.0 - -(The line breaks (\) are for presentation purposes -and not part of the actual file.) - - - - - - - diff --git a/doc/manual/command-ref/utilities.xml b/doc/manual/command-ref/utilities.xml index 25e457e4e..0800b5380 100644 --- a/doc/manual/command-ref/utilities.xml +++ b/doc/manual/command-ref/utilities.xml @@ -14,7 +14,6 @@ work with Nix. - diff --git a/doc/manual/introduction/quick-start.xml b/doc/manual/introduction/quick-start.xml index 0d13651e0..5ae9f6ad5 100644 --- a/doc/manual/introduction/quick-start.xml +++ b/doc/manual/introduction/quick-start.xml @@ -95,18 +95,6 @@ The latter command will upgrade each installed package for which there is a “newer” version (as determined by comparing the version numbers). - - If you're unhappy with the result of a nix-env action (e.g., an upgraded package turned out not to work properly), you can go back: diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 3c4fc52df..9a1123638 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -41,7 +41,7 @@ man-pages := $(foreach n, \ nix-env.1 nix-build.1 nix-shell.1 nix-store.1 nix-instantiate.1 \ nix-collect-garbage.1 nix-push.1 \ nix-prefetch-url.1 nix-channel.1 \ - nix-install-package.1 nix-hash.1 nix-copy-closure.1 \ + nix-hash.1 nix-copy-closure.1 \ nix.conf.5 nix-daemon.8, \ $(d)/$(n)) diff --git a/doc/manual/packages/one-click.xml b/doc/manual/packages/one-click.xml deleted file mode 100644 index cef9a2bbf..000000000 --- a/doc/manual/packages/one-click.xml +++ /dev/null @@ -1,37 +0,0 @@ - - -One-Click Installation - -Often, when you want to install a specific package (e.g., from -the Nix -Packages collection), subscribing to a channel is a bit -cumbersome. And channels don’t help you at all if you want to install -an older version of a package than the one provided by the current -contents of the channel, or a package that has been removed from the -channel. That’s when one-click installs come in -handy: you can just go to the web page that contains the package, -click on it, and it will be installed with all the necessary -dependencies. - -For instance, you can go to and click on any link for the individual packages for your -platform. The first time you do this, your browser will ask what to -do with application/nix-package files. You should -open them with /nix/bin/nix-install-package. -This will open a window that asks you to confirm that you want to -install the package. When you answer Y, the -package and all its dependencies will be installed. This is a binary -deployment mechanism — you get packages pre-compiled for the selected -platform type. - -You can also install application/nix-package -files from the command line directly. See for details. - - \ No newline at end of file diff --git a/doc/manual/packages/package-management.xml b/doc/manual/packages/package-management.xml index 5cc5c381b..61e55faeb 100644 --- a/doc/manual/packages/package-management.xml +++ b/doc/manual/packages/package-management.xml @@ -18,7 +18,6 @@ who want to create packages should consult - diff --git a/scripts/local.mk b/scripts/local.mk index edaf44cc4..46b3fe3cf 100644 --- a/scripts/local.mk +++ b/scripts/local.mk @@ -2,7 +2,6 @@ nix_bin_scripts := \ $(d)/nix-build \ $(d)/nix-channel \ $(d)/nix-copy-closure \ - $(d)/nix-install-package \ $(d)/nix-push bin-scripts += $(nix_bin_scripts) diff --git a/scripts/nix-install-package.in b/scripts/nix-install-package.in deleted file mode 100755 index ba349774a..000000000 --- a/scripts/nix-install-package.in +++ /dev/null @@ -1,127 +0,0 @@ -#! @perl@ -w @perlFlags@ - -use utf8; -use strict; -use Nix::Config; -use Nix::Utils; - -binmode STDERR, ":encoding(utf8)"; - - -# Parse the command line arguments. -my @args = @ARGV; - -my $source; -my $fromURL = 0; -my @extraNixEnvArgs = (); -my $interactive = 1; -my $op = "--install"; - -while (scalar @args) { - my $arg = shift @args; - if ($arg eq "--help") { - exec "man nix-install-package" or die; - } - elsif ($arg eq "--url") { - $fromURL = 1; - } - elsif ($arg eq "--profile" || $arg eq "-p") { - my $profile = shift @args; - die "$0: ‘--profile’ requires an argument\n" if !defined $profile; - push @extraNixEnvArgs, "-p", $profile; - } - elsif ($arg eq "--set") { - $op = "--set"; - } - elsif ($arg eq "--non-interactive") { - $interactive = 0; - } - else { - $source = $arg; - } -} - -die "$0: please specify a .nixpkg file or URL\n" unless defined $source; - - -# Re-execute in a terminal, if necessary, so that if we're executed -# from a web browser, the user gets to see us. -if ($interactive && !defined $ENV{"NIX_HAVE_TERMINAL"}) { - $ENV{"NIX_HAVE_TERMINAL"} = "1"; - $ENV{"LD_LIBRARY_PATH"} = ""; - foreach my $term ("xterm", "konsole", "gnome-terminal", "xterm") { - exec($term, "-e", "$Nix::Config::binDir/nix-install-package", @ARGV); - } - die "cannot execute ‘xterm’"; -} - - -my $tmpDir = mkTempDir("nix-install-package"); - - -sub barf { - my $msg = shift; - print "\nInstallation failed: $msg\n"; - if $interactive; - exit 1; -} - - -# Download the package description, if necessary. -my $pkgFile = $source; -if ($fromURL) { - $pkgFile = "$tmpDir/tmp.nixpkg"; - system("@curl@", "-L", "--silent", $source, "-o", $pkgFile) == 0 - or barf "curl failed: $?"; -} - - -# Read and parse the package file. -open PKGFILE, "<$pkgFile" or barf "cannot open ‘$pkgFile’: $!"; -my $contents = ; -close PKGFILE; - -my $nameRE = "(?: [A-Za-z0-9\+\-\.\_\?\=]+ )"; # see checkStoreName() -my $systemRE = "(?: [A-Za-z0-9\+\-\_]+ )"; -my $pathRE = "(?: \/ [\/A-Za-z0-9\+\-\.\_\?\=]* )"; - -# Note: $pathRE doesn't check that whether we're looking at a valid -# store path. We'll let nix-env do that. - -$contents =~ - / ^ \s* (\S+) \s+ (\S+) \s+ ($nameRE) \s+ ($systemRE) \s+ ($pathRE) \s+ ($pathRE) ( \s+ ($Nix::Utils::urlRE) )? /x - or barf "invalid package contents"; -my $version = $1; -my $manifestURL = $2; -my $drvName = $3; -my $system = $4; -my $drvPath = $5; -my $outPath = $6; -my $binaryCacheURL = $8; - -barf "invalid package version ‘$version’" unless $version eq "NIXPKG1"; - - -if ($interactive) { - # Ask confirmation. - print "Do you want to install ‘$drvName’ (Y/N)? "; - my $reply = ; - chomp $reply; - exit if $reply ne "y" && $reply ne "Y"; -} - - -die "$0: package does not supply a binary cache\n" unless defined $binaryCacheURL; - -push @extraNixEnvArgs, "--option", "extra-binary-caches", $binaryCacheURL; - - -print "\nInstalling package...\n"; -system("$Nix::Config::binDir/nix-env", $op, $outPath, "--force-name", $drvName, @extraNixEnvArgs) == 0 - or barf "nix-env failed: $?"; - - -if ($interactive) { - print "\nInstallation succeeded! Press Enter to continue.\n"; - ; -} diff --git a/tests/install-package.sh b/tests/install-package.sh deleted file mode 100644 index 1916f7271..000000000 --- a/tests/install-package.sh +++ /dev/null @@ -1,20 +0,0 @@ -source common.sh - -drvPath=$(nix-instantiate ./dependencies.nix) -outPath=$(nix-store -r $drvPath) -nix-push --dest $cacheDir $outPath - -clearStore -clearProfiles - -cat > $TEST_ROOT/foo.nixpkg <