Commit Graph

42 Commits

Author SHA1 Message Date
Mark H Weaver
dc5669cd65 Build newest versions unless specified, and implement upgrades.
* gnu/packages.scm (find-newest-available-packages):
  New exported procedure.

* guix-build.in (newest-available-packages, find-best-packages-by-name):
  New procedures.
  (find-package): Use find-best-packages-by-name, to guarantee that
  if a version number is not specified, only the newest versions will
  be considered.

* guix-package.in (%options): Add --upgrade/-u option.
  (newest-available-packages, find-best-packages-by-name, upgradeable?):
  New procedures.
  (find-package): Use find-best-packages-by-name, to guarantee that
  if a version number is not specified, only the newest versions will
  be considered.
  (process-actions): Implement upgrade option.

* doc/guix.texi (Invoking guix-package): In the description of --install,
  mention that if no version number is specified, the newest available
  version will be selected.
2013-02-13 22:05:19 -05:00
Ludovic Courtès
4dede022fd guix-package: Install propagated inputs.
* guix-package.in (profile-manifest): Return "version 1" manifests.
  (manifest-packages): Likewise.  When MANIFEST is "version 0", add
  '() as the list of "propagated inputs" of each package.
  (profile-derivation): Produce "version 1" manifests.  Pass each
  PACKAGES item's propagated inputs as an input for BUILDER.
  (input->name+path): New procedure.
  (guix-package)[find-package]: Add the transitive propagated inputs of
  each selected package as the last item of the tuple.
  [canonicalize-deps]: New procedure.
  [process-actions]: Adjust to support propagated inputs as the last item.
  [process-query]: Likewise.
2013-02-06 23:04:10 +01:00
Ludovic Courtès
cb09fb24ee guix-package: Make `--search' queries case-insensitive.
* guix-package.in (guix-package)[process-query]: Use `regexp/icase' for
  the `search' regexp.
2013-02-01 13:16:45 +01:00
Ludovic Courtès
299112d36e guix-package: Report `--search' matches in recutils format.
* guix/ui.scm (fill-paragraph, string->recutils, package->recutils): New
  procedures.
* guix-package.in (guix-package)[process-query]: Use `package->recutils'
  to display package meta-data.
* tests/guix-package.sh: Adjust test.
* tests/ui.scm: New file.
* Makefile.am (TESTS): Add it.
* doc/guix.texi (Invoking guix-package): Adjust `--search'
  documentation, and give an example.
2013-02-01 13:16:41 +01:00
Ludovic Courtès
aa92cf980c guix-package: Gracefully report non-existing outputs.
* guix-package.in (guix-package)[find-package](ensure-output): New
  procedure. Use it to validate SUB-DRV.
2013-02-01 09:17:59 +01:00
Ludovic Courtès
0f5378ebc4 guix-package: Reduce start-up time for queries.
* guix-package.in (guix-package): Call `open-connection' and
  `package-derivation' only after `process-query' has returned.
2013-01-31 23:24:40 +01:00
Ludovic Courtès
473b03b3c6 Gracefully handle failure to install the current locale.
* guix/ui.scm (install-locale): New procedure.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
  guix-package.in: Use it instead of (setlocale LC_ALL "").
2013-01-30 00:09:32 +01:00
Nikita Karetnikov
acc084669c guix-package: Add '--search'.
* guix-package.in (find-packages-by-description): New procedure.
  (show-help, %options): Add '--search'.
  (guix-package)[process-query]: Add support for '--search'.
* doc/guix.texi (Invoking guix-package): Document it.
* tests/guix-package.sh: Add tests.
2013-01-28 06:47:49 +00:00
Ludovic Courtès
82fe08ed20 guix-package: Always use the next number for new generations.
Suggested by Andreas Enge <andreas@enge.fr> at
<http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00325.html>.

* guix-package.in (latest-profile-number): Remove.
  (switch-symlinks): New procedure.
  (roll-back)[switch-link]: Use it.
  (guix-package)[process-actions]: Always choose NUMBER + 1 for the new
  profile.  Use `switch-symlinks' instead of `symlink'.  Remove code to
  delete PROFILE when it exists since `switch-symlinks' has the same
  effect.
* tests/guix-package.sh: Adjust existing `--roll-back' tests.
* doc/guix.texi (Invoking guix-package): Document this `--roll-back'
  behavior.
2013-01-27 17:58:46 +01:00
Ludovic Courtès
d9307267b3 guix-package: When rolling back to nothingness, point to the empty profile.
Suggested by Andreas Enge <andreas@enge.fr> at
<http://lists.gnu.org/archive/html/bug-guix/2013-01/msg00316.html>.

* guix-package.in (roll-back): Check whether PROFILE is valid using
  `file-exists?'.  When NUMBER is zero, just emit a notice.  When
  PREVIOUS-NUMBER is zero and PREVIOUS-PROFILE does not exist, build the
  empty profile, and link to it.
* tests/guix-package.sh: Add tests.
* doc/guix.texi (Invoking guix-package): Document the new behavior.
2013-01-27 17:18:55 +01:00
Ludovic Courtès
3b9c002088 guix-package: Error out when passed a non-option argument.
* guix-package.in (guix-package)[parse-options]: Call `leave' when
  passed a non-option argument.
  Reported by Andreas Enge <andreas@enge.fr>.
* tests/guix-package.sh: Add test.
2013-01-24 23:33:51 +01:00
Ludovic Courtès
67668155c5 guix-package: Fix --roll-back' when --profile' is not passed.
* guix-package.in (roll-back): Fix file name of PREVIOUS-PROFILE, which
  could end up containing the dirname twice.
  Reported by Nikita and Andreas.
* tests/guix-package.sh: Add test.
2013-01-22 22:35:16 +01:00
Ludovic Courtès
59a43334a9 distro: Rename (distro) to (gnu packages).
* distro.scm: Rename to...
* gnu/packages.scm: ... this.  Update all users accordingly.
* Makefile.am (MODULES): Adjust accordingly.
* po/POTFILES.in: Likewise.
2013-01-18 01:07:53 +01:00
Ludovic Courtès
1ffa7090b9 distro: Change the module name space to (gnu ...).
* distro: Rename to...
* gnu: ... this.  Update module names accordingly.
* Makefile.am: Adjust accordingly.
* po/POTFILES.in: Likewise.
* distro.scm: Search for files under /gnu/packages instead of
  /distro/packages.
* gnu/packages/base.scm (ld-wrapper-boot3): Likewise.
2013-01-18 01:07:31 +01:00
Ludovic Courtès
9241172c9d guix-package: Allow `--roll-back' to skip missing generations.
* guix-package.in (profile-numbers): New procedure.
  (latest-profile-number): Use it.
  (previous-profile-number): New procedure.
  (roll-back): Use it lieu of `1-'.  Check whether PREVIOUS-NUMBER is
  zero, and raise an error when it is.
* tests/guix-package.sh: Test whether we can roll back over a "hole".
2013-01-17 22:42:39 +01:00
Ludovic Courtès
24e262f086 guix-package: Add `--roll-back'.
Based on a patch by Nikita Karetnikov <nikita@karetnikov.org>.

* guix-package.in (profile-regexp): New procedure.
  (latest-profile-number): Remove `%profile-rx', and use
  `profile-regexp' instead.
  (profile-number, roll-back): New procedure.
  (show-help): Add `--roll-back'.
  (%options): Likewise.
  (guix-package)[process-actions]: First check whether `roll-back?' is
  among OPTS, and call `roll-back' if it is, followed by a recursive
  call to `process-actions'.  Emit the "nothing to be done" message only
  when INSTALL or REMOVE is non-empty.
* tests/guix-package.sh (readlink_base): New function.
  Add tests for `--roll-back'.
* doc/guix.texi (Invoking guix-package): Document `--roll-back'.
2013-01-17 22:42:39 +01:00
Ludovic Courtès
c4d645341b guix-package: Connect to the daemon only after arguments have been processed.
* guix-package.in (%store): Change to a SRFI-39 parameter.  Update all users.
  (guix-package): Parametrize %STORE to an open connection after
  `parse-options' has been called.
2013-01-15 22:39:03 +01:00
Ludovic Courtès
0ec1af59e5 guix-package: Create or diagnose missing profile directory.
Reported by Andreas Enge.

* guix-package.in (%profile-directory): Honor $NIX_STATE_DIR.
  (guix-package)[ensure-default-profile]: Use it.
  [process-actions]: Call it when the `profile' option is
  %CURRENT-PROFILE.
* tests/guix-package.sh: Add installation test with $HOME set, using the
  default profile.
2013-01-14 23:44:58 +01:00
Ludovic Courtès
ae9e328800 guix-package: Fix check for ~/.guix-profile existence.
* guix-package.in (guix-package): When testing whether
  %USER-ENVIRONMENT-DIRECTORY exists, use `lstat' instead of
  `file-exists?'.  Reported by Andreas Enge.
2013-01-13 23:47:37 +01:00
Ludovic Courtès
b9e5c0a949 guix-package: Create ~/.guix-profile when it doesn't exist.
* guix-package.in (guix-package): Create the %USER-ENVIRONMENT-DIRECTORY
  symlink if it doesn't exist yet.
* doc/guix.texi (Invoking guix-package): Document it.
2013-01-09 19:57:44 +01:00
Ludovic Courtès
44b6be7744 guix-package: Show package outputs in `--list-available'.
* guix-package.in (guix-package)[process-query]: For `list-available',
  show the outputs of each package.
* doc/guix.texi (Invoking guix-package): Update accordingly.
2013-01-09 19:26:37 +01:00
Ludovic Courtès
87009d8aa1 guix-package: Use guile-final', not guile-2.0' to build the environment.
* guix-package.in (guix-package): Use either %BOOTSTRAP-GUILE or
  GUILE-FINAL.
2013-01-08 00:05:37 +01:00
Ludovic Courtès
9762706b90 guix-package: Be verbose when Guile itself needs to be built.
* guix-package.in (guix-package)[guile-missing?]: New procedure.
  (guix-package): Always redirect `current-build-output-port' to
  `current-error-port' when (guile-missing?).
2013-01-08 00:04:46 +01:00
Ludovic Courtès
cc57f25d96 guix-package: Remove -b' shorthand for --bootstrap'.
* guix-package.in (%options): Remove #\b as an alternate for
  "bootstrap".
  (show-help): Adjust accordingly.
* tests/guix-package.sh: Use `--bootstrap' instead of `-b'.
2013-01-07 22:54:54 +01:00
Ludovic Courtès
233e76769a Update license headers.
Change all license headers, except guix/build/* and ld-wrapper.scm, with
this code:

  (use-modules (guix build utils)
	       (srfi srfi-1))

  (fluid-set! %default-port-encoding "UTF-8")

  (substitute* (remove (lambda (f)
			 (or (string-contains f ".tar.")
			     (string-contains f ".git/")
			     (string-contains f ".so")
			     (string-suffix? ".o" f)
			     (string-suffix? ".a" f)
			     (string-suffix? ".go" f)
			     (string-suffix? ".pdf" f)
			     (string-suffix? ".png" f)
			     (string-suffix? ".info" f)
			     (equal? (basename f) "guix-daemon")
			     (equal? (basename f) "nix-setuid-helper")
			     (string-contains f "nix-upstream/")
			     (string-contains f "distro/packages/bootstrap/")))
		       (find-files "." "\\.[a-z]+$"))
    (("^([[:graph:]]+) This file is part of Guix." _ comment-start)
     (string-append comment-start " This file is part of GNU Guix."))
    (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start)
     (string-append comment-start
		    " GNU Guix --- Functional package management for GNU\n"))
    (("^([[:graph:]]+) Guix is " _ comment-start)
     (string-append comment-start " GNU Guix is "))
    (("^([[:graph:]]+) along with Guix." _ comment-start)
     (string-append comment-start " along with GNU Guix."))
    (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start)
     (string-append comment-start " Copyright ©")))

Change headers using C-style comments manually.
2013-01-06 00:47:50 +01:00
Ludovic Courtès
3441e16497 ui: Factorize bug-report information in `--help'.
* guix/config.scm.in (%guix-home-page-url): New variable.
* guix/ui.scm (show-bug-report-information): New procedure.
* guix-build.in (show-help): Use it.
* guix-download.in (show-help): Likewise.
* guix-import.in (show-help): Likewise.
* guix-package.in (show-help): Likewise.
2013-01-05 15:55:47 +01:00
Ludovic Courtès
4aa52039a7 guix-package: Avoid use of the `guix' sub-directory for profiles.
* guix-package.in (%current-profile): Change to `guix-profile'.
2012-12-13 23:02:22 +01:00
Ludovic Courtès
a020d2a996 guix-package: Use directory names from (guix config).
* guix-package.in (%profile-directory): Use %STATE-DIRECTORY instead of
  a hard-coded directory.
2012-12-13 22:57:36 +01:00
Ludovic Courtès
70915c1a2e guix-package: Add `--verbose'; silence the environment's build by default.
* guix-package.in (%options): Add `--verbose'.
  (show-help): Update accordingly.
  (guix-package): Parameterize `current-build-output-port' according to
  VERBOSE?.  By default, silence the environment build's output.
2012-12-12 14:59:16 +01:00
Ludovic Courtès
1c67d639d5 guix-package: Gracefully handle multiple installs of the same path.
* guix-package.in (guix-package)[process-actions]: Compute PACKAGES such
  that packages listed in INSTALL* are first removed from the remainder
  of the list.  When PROF is equal to the previous profile's store path,
  do nothing.  Reported by Andreas Enge <andreas@enge.fr>.
* tests/guix-package.sh: Test the behavior of installing the same store
  path twice.  When removing a package, omit its version number.
2012-12-12 00:01:17 +01:00
Ludovic Courtès
5075e28305 guix-package: Extract version strings when installing a direct store path.
* guix-package.in (guix-package)[process-actions]: Extract the version
  string from store paths.
* tests/guix-package.sh: Adjust accordingly.
2012-11-19 23:53:32 +01:00
Ludovic Courtès
d9d0536340 guix-package: Record the correct version string in manifests.
* guix-package.in (guix-package)[find-package]: Return (package-version p),
  not VERSION.
2012-11-19 23:21:54 +01:00
Ludovic Courtès
64fc89b6ec guix-package: Add `--list-available'.
* guix-package.in (show-help, %options): Add `--list-available'.
  (guix-package)[process-query]: Add support for `--list-available'.
* doc/guix.texi (Invoking guix-package): Document it.
* tests/guix-package.sh: Add test.

* guix/ui.scm (location->string): New procedure.
* guix/utils.scm: Export <location>.
2012-11-19 23:04:38 +01:00
Ludovic Courtès
733b4130d7 guix-package: Add `--list-installed'.
* guix-package.in (show-help, %options): Add `--list-installed'.
  (guix-package): Move main body to...
  [process-actions]: ... here.  New internal procedure.
  [process-query]: New procedure.
* tests/guix-package.sh: Add tests for `--list-installed'.
* doc/guix.texi (Invoking guix-package): Document it.
2012-11-19 23:04:35 +01:00
Ludovic Courtès
c6f09dfade guix-package: Fix typo.
* guix-package.in (guix-package)[find-package]: Don't use `_' as the
  wildcard, to avoid collision with `gettext'.
2012-11-19 22:19:26 +01:00
Ludovic Courtès
9518856b9b guix-package: Fix handling of the PACKAGE:OUTPUT syntax.
* guix-package.in (guix-package)[find-package]: Return the correct NAME
  and SUB-DRV when NAME contains #\:.

* tests/guix-package.sh (profile): Add test.
2012-11-07 19:14:22 +01:00
Ludovic Courtès
1227fabb65 guix-package: Fix invalid module use.
* guix-package.in: Use (distro packages guile), not (... base).
2012-11-07 19:13:10 +01:00
Ludovic Courtès
5901471cec guix-package: Remove extraneous procedures.
* guix-package.in (_, N_): Remove.
2012-11-04 18:19:28 +01:00
Ludovic Courtès
9b48fb88ca utils: Add `package-name->name+version'.
* guix/utils.scm (package-name->name+version): New procedure.
* guix-package.in (guix-package)[find-package]: Use it.
* tests/utils.scm ("package-name->name+version"): New test.
2012-11-04 01:29:18 +01:00
Ludovic Courtès
1275baeba7 guix-package: Use more (guix ui) features.
* guix-package.in (leave): Remove.
  (guix-package): Wrap body in `with-error-handling'.
2012-11-03 21:23:16 +01:00
Ludovic Courtès
cdd5d6f95f ui: Factorize `--version'.
* guix/ui.scm (show-version-and-exit): New procedure.
* guix-build.in (show-version): Remove.
  (%options)["version"]: Use `show-version-and-exit'.
* guix-download.in: Likewise.
* guix-package.in: Likewise.
2012-11-03 21:19:43 +01:00
Ludovic Courtès
0afdc48532 Add a preliminary `guix-package' command-line tool.
* guix-package.in, tests/guix-package.sh: New files.
* configure.ac: Output `guix-package'.
* Makefile.am (TESTS): Add `tests/guix-package.sh'.
  (bin_SCRIPTS): Add `guix-package'.
2012-11-01 01:46:15 +01:00