Commit Graph

134 Commits

Author SHA1 Message Date
Ludovic Courtès 1af0860e8b
profiles: Build profiles in a UTF-8 locale.
Fixes <http://bugs.gnu.org/25213>.
Reported by Christopher Baines <mail@cbaines.net>.

* guix/profiles.scm (profile-derivation)[glibc-utf8-locales]: New
variable.
[builder]: Use it to set 'LOCPATH'.
2016-12-16 18:01:08 +01:00
Ludovic Courtès e74f64b9e5
store: Add 'references*'.
* guix/store.scm (references*): New procedure.
* guix/profiles.scm (manifest-lookup-package)[references*]: Remove.
* guix/scripts/system.scm (references*): Remove.
* tests/gexp.scm ("gexp->file", "gexp->file + file-append")
("gexp->derivation", "gexp->derivation, cross-compilation")
("gexp->derivation, ungexp + ungexp-native")
("scheme-file", "text-file*", "mixed-text-file"): Remove 'references*'
instead of (store-lift references).
2016-11-19 18:44:53 +01:00
Mark H Weaver 71e21fb26d
Merge branch 'master' into core-updates 2016-11-07 00:33:16 -05:00
Chris Marusich 9008debc54
profiles: Extract a procedure for getting relative generation numbers.
* guix/profiles.scm (relative-generation-spec->number): New procedure.
* guix/scripts/package.scm (switch-generation-action): Use it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-11-06 18:08:53 +01:00
Leo Famulari 205f0107bb
Merge branch 'master' into core-updates 2016-10-30 19:19:21 -04:00
Ricardo Wurmus 054f60cd31
profiles: manifest-lookup-package: Cosmetic changes.
* guix/profiles.scm (manifest-lookup-package): Rename variables; use
"string=?" instead of "equal?".
2016-10-30 07:21:15 +01:00
Ludovic Courtès 79355ae3e8
Merge branch 'master' into core-updates 2016-09-30 12:05:27 +02:00
Ricardo Wurmus 7ddc178093
profiles: Build GTK+ input module cache.
* guix/profiles.scm (gtk-im-modules): New procedure.
(%default-profile-hooks): Add it.
2016-09-26 07:58:17 +02:00
Ricardo Wurmus 2c9f4786c9
profiles: manifest-lookup-package: Optionally match version prefix.
* guix/profiles.scm (manifest-lookup-package): Optionally filter store
item matches by version prefix.
2016-09-26 07:58:17 +02:00
Ludovic Courtès 03763d6473
profiles: Export <manifest-pattern> accessors.
* guix/profiles.scm (manifest-pattern-name, manifest-pattern-version)
(manifest-pattern-output): Export.
2016-09-06 23:22:10 +02:00
Ludovic Courtès c8c25704ae
profiles: Add manifest-transaction helper procedures.
* guix/profiles.scm (manifest-transaction-install-entry)
(manifest-transaction-remove-pattern)
(manifest-transaction-null?): New procedures.
* tests/profiles.scm ("manifest-transaction-null?"): New test.
2016-09-06 23:22:10 +02:00
宋文武 d1fb4af6b8
profiles: gtk-icon-themes: Use 'gtk-update-icon-cache' from 'gtk+:bin'.
This is a followup to commit 7b808d7.

* guix/profiles.scm (gtk-icon-themes): Use 'gtk-update-icon-cache' from
the "bin" output of gtk+ package.
2016-08-23 19:45:33 +08:00
宋文武 801d316b20
profiles: xdg-mime-database: Run the hook when have GLib based applications.
* guix/profiles.scm (xdg-mime-database): Run the hook when GLIB is referenced by
the manifest.  Add SHARED-MIME-INFO to the mime packages of `update-mime-database'.
2016-08-12 22:22:43 +08:00
Ludovic Courtès 9e90fc7713
profiles: Output in 'package->manifest-entry' defaults to "out".
Fixes <http://bugs.gnu.org/24029>.
Reported by Dylan Jeffers <sapientech@openmailbox.org>.

* guix/profiles.scm (package->manifest-entry): Change #:output to
default to "out".
(packages->manifest): Add 'package?' in second 'match' clause.
* tests/profiles.scm ("package->manifest-entry defaults to \"out\""):
New test.
2016-07-26 18:18:53 +02:00
Alex Kost 9eb5a449ee
profiles: Add fonts-dir-file hook.
* guix/profiles.scm (fonts-dir-file): New procedure.
(%default-profile-hooks): Add it.
2016-07-25 17:18:52 +03:00
Ludovic Courtès 99b231dee6
profiles: Use 'with-imported-modules'.
* guix/profiles.scm (info-dir-file): Use 'with-imported-modules' instead
of the #:module argument to 'gexp->derivation'.
(ghc-package-cache-file): Likewise.
(ca-certificate-bundle): Likewise.
(gtk-icon-themes): Likewise.
(xdg-desktop-database): Likewise.
(xdg-mime-database): Likewise.
(profile-derivation): Likewise.
2016-07-12 22:47:08 +02:00
Ludovic Courtès 4d4c3614c8
profiles: Make sure hook derivations fail upon error.
Reported at
<https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00368.html>.

* guix/profiles.scm (info-dir-file)[build]: Add explicit call to
'exit'.
* guix/profiles.scm (ghc-package-cache-file)[build]: Likewise.
* guix/profiles.scm (xdg-desktop-database)[build]: Likewise.
* guix/profiles.scm (xdg-mime-database)[build]: Likewise.
2016-06-12 23:54:00 +02:00
宋文武 963521a380
profiles: manifest-lookup-package: Correctly handle package entries.
* guix/profiles.scm (manifest-lookup-package): Consider the package entry
in addition to its 'package-transitive-inputs'.
2016-06-11 11:05:18 +08:00
宋文武 359f06aac8
profiles: xdg-mime-database: Union the "share/mime/packages" directory.
* guix/profiles.scm (xdg-mime-database): Call 'union-build' for the
"share/mime/packages" directory of inputs.
2016-06-11 11:03:31 +08:00
Ludovic Courtès 40d71e44f5
profiles: 'profile-derivation' now honors #:system.
Fixes <http://bugs.gnu.org/23682>.
Reported by Ander GM <anthk@openmailbox.org>.

* guix/profiles.scm (profile-derivation): Pass #:system to
'gexp->derivation'.
* tests/guix-environment.sh: Add 'guix environment -s' test.
2016-06-05 00:05:38 +02:00
宋文武 d72d783301 profiles: Factor out 'manifest-lookup-package'.
* guix/profiles.scm (manifest-lookup-package): New procedure.
(gtk-icon-themes, xdg-desktop-database, xdg-mime-database): Use it.
2016-05-02 22:06:46 +08:00
宋文武 6c06b1fdac profiles: Add xdg-mime-database hook.
* guix/profiles.scm (xdg-mime-database): New function.
(%default-profile-hooks): Add it.
2016-05-02 22:06:46 +08:00
宋文武 842cb82097 profiles: Add xdg-desktop-database hook.
* guix/profiles.scm (xdg-desktop-database): New function.
(%default-profile-hooks): Add it.
2016-05-02 22:06:46 +08:00
Ludovic Courtès 97425486ee profiles: Use the right 'package-name->name+version'.
* guix/profiles.scm: Use 'package-name->name+version' from (guix build
utils).  Fixes 'find-among-store-items' in 'gtk-icon-themes'.
2016-04-01 00:05:42 +02:00
Ludovic Courtès e5f04c2dde profiles: Add #:system argument to profile-derivation.
Suggested by David Thompson <davet@gnu.org>.

* guix/profiles.scm (profile-derivation): Add #:system parameter and
honor it.
2016-02-12 21:54:25 +01:00
Ludovic Courtès ccda8f7d7f profiles: Honor search paths of propagated inputs.
Fixes <http://bugs.gnu.org/22073>.
Reported by Federico Beffa <beffa@ieee.org>.

* guix/profiles.scm (package->manifest-entry): Use
'package-transitive-native-search-paths' when computing
'search-paths' field.
* tests/profiles.scm ("package->manifest-entry, search paths"): New test.
2015-12-20 22:34:22 +01:00
Ludovic Courtès 4fef1e850e profiles: Silence Info installation.
* guix/profiles.scm (info-dir-file)[build]: Pass --silent to
'install-info'.
2015-12-14 19:57:42 +01:00
Ludovic Courtès 2aacd9179c profiles: Silence GTK+ icon cache creation.
Suggested by Ricardo Wurmus <rekado@elephly.net>.

* guix/profiles.scm (gtk-icon-themes)[build]: Pass --quiet to
'gtk-update-icon-cache'.
2015-12-04 23:12:02 +01:00
Ludovic Courtès 4bddf74ef2 profiles: Silence GTK+ icon theme union.
Suggested by Ricardo Wurmus <rekado@elephly.net>.

* guix/profiles.scm (gtk-icon-themes)[build]: Pass 'union-build' a
  #:log-port argument.
2015-12-04 23:12:02 +01:00
Ludovic Courtès 06d45f4566 profiles: Add generation manipulation procedures.
* guix/scripts/package.scm (delete-generations): Use
  'delete-generation*' instead of 'delete-generation'.
  (guix-package)[process-actions]: Use 'roll-back*' instead of
  'roll-back' and 'switch-to-generation*' instead of
  'switch-to-generation'.
  (link-to-empty-profile, switch-to-generation,
  switch-to-previous-generation, roll-back, delete-generation): Move
  to...
* guix/profiles.scm: ... here.  Adjust to not print messages and to
  return values that can be used by user interfaces.
* guix/ui.scm (display-generation-change, roll-back*,
  switch-to-generation*, delete-generation*): New procedures.
2015-10-27 00:01:20 +01:00
Ludovic Courtès afd3d9316c Use "normalized codesets" everywhere.
In other words, change "xx_YY.UTF-8" to "xx_YY.utf8".

* guix/profiles.scm (ca-certificate-bundle): Use "en_US.utf8" instead of
  "en_US.UTF-8".
* guix/packages.scm (patch-and-repack): Likewise.
* guix/build/gnu-build-system.scm (install-locale): Likewise.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Likewise.
* gnu/packages/python.scm (python-ipython): Likewise.
* gnu/packages/gawk.scm (gawk): Likewise.
* build-aux/hydra/demo-os.scm: Likewise.
* gnu/packages/guile.scm (guile-ncurses)[arguments]: Remove
  'change-locale' phase.
2015-10-04 00:10:03 +02:00
Ludovic Courtès f2d7bbb537 gnu: glibc: Look for locale data in versioned sub-directories.
* gnu/packages/base.scm (glibc)[native-search-paths]: Add
  'lib/locale/VERSION' for 'GUIX_LOCPATH'.
  (glibc-locales, glibc-utf8-locales): Write to a VERSION
  sub-directory.
* guix/profiles.scm (ca-certificate-bundle): Adjust LOCPATH value
  accordingly.
2015-10-03 20:17:09 +02:00
Ludovic Courtès a7a4fd9a7c profiles: Make profile-specific derivations non-substitutable.
This avoids gratuitous queries of the substituter.

* guix/profiles.scm (ghc-package-cache-file): Pass #:substitutable? #f
  to 'gexp->derivation'.
  (ca-certificate-bundle): Likewise.
  (gtk-icon-themes): Likewise.
  (profile-derivation): Likewise.
  (info-dir-file): Likewise, plus #:local-build? #t.
2015-09-24 22:16:10 +02:00
Ludovic Courtès fa96048f0a profiles: Remove duplicate entries in 'etc/profile'.
Reported by Andy Wingo
at <http://lists.gnu.org/archive/html/guix-devel/2015-08/msg00109.html>.

* guix/profiles.scm (profile-derivation)[builder]: Delete duplicates in
  SEARCH-PATHS.
2015-08-20 19:12:36 +02:00
Eric Bavier b4b1fe9d2f profiles: Process ghc conf files only once.
A package may be listed in the manifest inputs multiple times.  Avoid
copying ghc *.conf files twice by deleting duplicates.

* guix/profiles.scm (ghc-package-cache-file)[conf-files]: Delete
  duplicate manifest inputs before copying conf files.
2015-06-11 18:55:48 -05:00
Eric Bavier 84de458ba8 profiles: Search for ghc conf files only if package db exists.
This avoids having 'find-files' report warnings about searching in
non-existent directories.

* guix/profiles.scm (ghc-package-cache-file)[conf-files]: Only search
  for *.conf files if the search directory exists.
2015-06-11 18:55:48 -05:00
Ludovic Courtès 1ba4796d13 profiles: Deal with non-directory items in share/icons.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/profiles.scm (gtk-icon-themes)[build]: Check whether DIR is a directory
  before calling 'ensure-writable-directory'.
2015-05-28 14:41:15 +02:00
Ludovic Courtès 6a669bda51 profiles: Export 'ensure-writable-directory' and use it.
* guix/build/profiles.scm (ensure-writable-directory): Export.
* guix/profiles.scm (gtk-icon-themes)[build]: Remove '@@' form and use (guix
  build profiles).
2015-05-27 22:36:52 +02:00
Ludovic Courtès 102f7101b9 profiles: Don't assume all the inputs are of a package are packages.
Reported by Ricardo Wurmus.

* guix/profiles.scm (gtk-icon-themes)[entry-lookup-gtk+](find-among-packages):
  Rename to...
  (find-among-inputs): ... this.  Check whether INPUT is a package before
  calling 'package-name'.  Fixes a regression introduced in b04af0e.
2015-05-27 22:31:56 +02:00
宋文武 eeae0b3c6c profiles: Use 'derivation?' to filter hooks.
Fixes a regression introduced in 07eaecfa.

* guix/profiles.scm (profile-derivation): Use 'derivation?' instead of
  'gexp?' to filter hooks.
2015-05-27 21:03:21 +08:00
宋文武 b04af0ec67 profiles: Add gtk-icon-themes hook.
* guix/profiles.scm (gtk-icon-themes): New function.
  (%default-profile-hooks): Add it.
2015-05-27 20:58:27 +08:00
Ludovic Courtès 07eaecfae1 profiles: Hooks always return a monadic value.
Suggested by 宋文武 <iyzsong@gmail.com>.

* guix/profiles.scm (ghc-package-cache-file): Return a monadic #f, not just
  #f, when MANIFEST contains no GHC package.
  (profile-derivation): Do not filter based on the return value of HOOK;
  instead filter based on the value of items in EXTRAS.
2015-05-26 23:38:27 +02:00
David Thompson 8404ed5c3e profiles: Add 'packages->manifest' procedure.
* guix/profiles.scm (packages->manifest): New procedure.
2015-05-20 12:13:04 -04:00
Ludovic Courtès d664f1b431 profiles: Generate an 'etc/profile' file.
Suggested by 宋文武 <iyzsong@gmail.com>
in <http://bugs.gnu.org/20255>.

* guix/build/profiles.scm (abstract-profile,
  write-environment-variable-definition): New procedures.
  (build-profile): Add #:search-paths parameter.  Create
  OUTPUT/etc/profile.
* guix/profiles.scm (profile-derivation)[builder]: Add 'search-paths'
  variable and pass it to 'build-profile'.  Adjust #:modules argument.
* tests/profiles.scm ("etc/profile"): New test.
* doc/guix.texi (Invoking guix package): Mention etc/profile.
2015-05-06 18:26:54 +02:00
Ludovic Courtès 611adb1ee5 profiles: Move build code to (guix build profiles).
* guix/build/profiles.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/profiles.scm (profile-derivation)[builder]: Call out to
  'build-profile'.
  Add (guix build profiles) to the #:modules argument.
2015-05-06 18:26:54 +02:00
Ludovic Courtès 88aab8e349 profiles: Use a &message error condition instead of 'error'.
* guix/profiles.scm (sexp->manifest): Use 'raise' instead of 'error'.
2015-05-04 23:30:52 +02:00
Ludovic Courtès e89431bf01 Move search path specifications to (guix search-paths).
* guix/packages.scm (<search-path-specification>,
  search-path-specification->sexp, sexp->search-path-specification):
  Move to...
* guix/search-paths.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* guix/build-system/cmake.scm, guix/build-system/glib-or-gtk.scm,
  guix/build-system/gnu.scm, guix/build-system/haskell.scm,
  guix/build-system/perl.scm, guix/build-system/python.scm,
  guix/build-system/ruby.scm, guix/build-system/waf.scm,
  guix/profiles.scm, guix/scripts/package.scm: Use it.
2015-05-04 23:30:51 +02:00
Ludovic Courtès dedb17ad01 profiles: Store search paths in manifests.
Discussed in <http://bugs.gnu.org/20255>.

* guix/packages.scm (sexp->search-path-specification): New variable.
* guix/profiles.scm (<manifest-entry>)[search-paths]: New field.
  (package->manifest-entry): Initialize it.
  (manifest->gexp): Match it.  Wrap #$deps in (propagated-inputs ...).
  Emit (search-paths ...).  Increment version.
  (find-package): New procedure.
  (sexp->manifest)[infer-search-paths]: New procedure.
  Use it to initialize the 'search-paths' field for versions 0 and 1.
  Add case for version 2.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
  Remove.
  Use 'manifest-entry-search-paths' instead of 'manifest-entry->package'
  plus 'package-native-search-paths'.
* tests/profiles.scm ("profile-manifest, search-paths"): New test.
2015-05-02 23:57:11 +02:00
Ludovic Courtès c568191a93 profiles: Create a CA certificate bundle only when it would be non-empty.
* guix/profiles.scm (ca-certificate-bundle): Create
  $output/etc/ssl/certs if and only if CA-FILES is non-empty.
2015-04-20 15:41:41 +02:00
Ludovic Courtès aa46a028c4 profiles: Generalize "hooks" for 'profile-derivation'.
* guix/profiles.scm (info-dir-file): Remove (null? (manifest-entries
  manifest)) test.
  (ca-certificate-bundle): Likewise.
  (ghc-package-cache-file): Turn 'if' into 'and', and remove second
  arm.
  (%default-profile-hooks): New variable.
  (profile-derivation): Remove #:info-dir?, #:ghc-package-cache?, and
  #:ca-certificate-bundle?.  Add #:hooks.  Iterate over HOOKS.  Adjust
  'inputs' accordingly.
* guix/scripts/package.scm (guix-package): Adjust 'profile-derivation'
  call accordingly.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation",
  "profile-derivation, inputs"): Likewise.
2015-04-15 22:44:51 +02:00
Federico Beffa 042bc828fc profiles: Generate GHC's package database cache.
* guix/profiles.scm (ghc-package-cache-file): New procedure.
  (profile-derivation): Add 'ghc-package-cache?' keyword argument.  If true
  (the default), add the result of 'ghc-package-cache-file' to 'inputs'.
* guix/scripts/package.scm (guix-package)[process-actions]: Pass
  #:ghc-package-cache? to 'profile-generation'.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation"): Likewise.
2015-04-08 17:31:12 +02:00
Ludovic Courtès b4a4bec01a profiles: Use 'gexp-input' instead of two-element lists.
* guix/profiles.scm (package->manifest-entry): Use 'gexp-input' instead
  of two-element lists to denote specific package outputs.
  (manifest-inputs): Likewise.
  (profile-derivation)[info-dir]: Likewise.
2015-03-17 22:25:54 +01:00
Ludovic Courtès 6d0b9d03ce tests: Remove dependency on 'glibc-utf8-locales' for profile tests.
This fixes a regression introduced in commit 536c3ee.

* guix/profiles.scm (ca-certificate-bundle): When MANIFEST is empty,
  make a trivial derivation.
* guix/scripts/package.scm (guix-package)[process-actions]: Pass
  #:ca-certificate-bundle? to 'profile-generation'.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation"): Likewise.
2015-03-04 17:23:27 +01:00
Mark H Weaver 536c3ee4e3 profiles: Produce a single-file CA certificate bundle.
* guix/profiles.scm (ca-certificate-bundle): New procedure.
  (profile-derivation): Add 'ca-certificate-bundle?' keyword argument.  If
  true (the default), add the result of 'ca-certificate-bundle' to 'inputs'.

Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
2015-03-03 13:49:12 -05:00
Ludovic Courtès 3bea13bb1f profiles: Report "pseudo-upgrades" as upgrades, not downgrades.
Reported by Andreas Enge <andreas@enge.fr>
at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19764#19>.

* guix/profiles.scm (manifest-transaction-effects): Use 'version>=?'
  instead of 'version>?'.
* tests/profiles.scm ("manifest-transaction-effects and
  pseudo-upgrades"): New test.
2015-02-09 18:18:41 +01:00
Ludovic Courtès 46b23e1a43 profiles: Distinguish downgrades from upgrades.
Fixes <http://bugs.gnu.org/19764>.

* guix/profiles.scm (manifest-transaction-effects): Return downgraded
  packages as a fourth value.
* guix/ui.scm (show-manifest-transaction): Adjust accordingly.
* tests/profiles.scm ("manifest-transaction-effects and downgrades"):
  New test.
2015-02-08 19:00:39 +01:00
Ludovic Courtès e87f0591f3 monads: Move '%store-monad' and related procedures where they belong.
This turns (guix monads) into a generic module for monads, and moves the
store monad and related monadic procedures in their corresponding
module.

* guix/monads.scm (store-return, store-bind, %store-monad, store-lift,
  text-file, interned-file, package-file, package->derivation,
  package->cross-derivation, origin->derivation, imported-modules,
  compiled, modules, built-derivations, run-with-store): Move to...
* guix/store.scm (store-return, store-bind, %store-monad, store-lift,
  text-file, interned-file): ... here.
  (%guile-for-build): New variable.
  (run-with-store): Moved from monads.scm.  Remove default value for
  #:guile-for-build.
* guix/packages.scm (default-guile): Export.
  (set-guile-for-build): New procedure.
  (package-file, package->derivation, package->cross-derivation,
  origin->derivation): Moved from monads.scm.
* guix/derivations.scm (%guile-for-build): Remove.
  (imported-modules): Rename to...
  (%imported-modules): ... this.
  (compiled-modules): Rename to...
  (%compiled-modules): ... this.
  (built-derivations, imported-modules, compiled-modules): New
  procedures.
* gnu/services/avahi.scm, gnu/services/base.scm, gnu/services/dbus.scm,
  gnu/services/dmd.scm, gnu/services/networking.scm,
  gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system/install.scm,
  gnu/system/linux-initrd.scm, gnu/system/shadow.scm, guix/download.scm,
  guix/gexp.scm, guix/git-download.scm, guix/profiles.scm,
  guix/svn-download.scm, tests/monads.scm: Adjust imports accordingly.
* guix/monad-repl.scm (default-guile-derivation): New procedure.
  (store-monad-language, run-in-store): Use it.
* build-aux/hydra/gnu-system.scm (qemu-jobs): Add explicit
  'set-guile-for-build' call.
* guix/scripts/archive.scm (derivation-from-expression): Likewise.
* guix/scripts/build.scm (options/resolve-packages): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* doc/guix.texi (The Store Monad): Adjust module names accordingly.
2015-01-14 13:34:52 +01:00
Ludovic Courtès bea26837e8 profiles: Fix removal of the next-to-last item in a profile.
Fixes a bug whereby removing the next-to-last item in a profile would
lead to an obscure error, as shown at
<http://lists.gnu.org/archive/html/guix-devel/2014-12/msg00292.html>.
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

* guix/profiles.scm (profile-derivation)[inputs]: Use (list info-dir
  "out") instead of just INFO-DIR.
2014-12-15 23:01:56 +01:00
Alex Kost 3ccde08752 profiles: Add 'relative-generation'.
* guix/profiles.scm: (relative-generation): New procedure.
  (previous-generation-number): Use it.
2014-10-12 08:45:38 +04:00
Alex Kost c0c018f180 profiles: Add condition types for profiles and generations.
Suggested by Ludovic Courtès.

* guix/profiles.scm (&profile-error, &profile-not-found-error,
  &missing-generation-error): New condition types.
* guix/ui.scm (call-with-error-handling): Handle new types.
* guix/scripts/package.scm (roll-back, guix-package): Raise
  '&profile-not-found-error' where needed.
2014-10-12 08:45:37 +04:00
Alex Kost 5d7a8584f5 ui: Move 'show-manifest-transaction' from (guix profiles).
* guix/profiles.scm: Do not use (guix ui) module.
  (right-arrow, manifest-show-transaction): Move and rename to...
* guix/ui.scm (right-arrow, show-manifest-transaction): ... here.
* tests/profiles.scm ("manifest-show-transaction"): Move to...
* tests/ui.scm ("show-manifest-transaction"): ... here.
  (guile-1.8.8, guile-2.0.9): New variables.
* emacs/guix-main.scm (process-package-actions): Rename
  'manifest-show-transaction' to 'show-manifest-transaction'.
* guix/scripts/package.scm (guix-package): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-10-10 00:06:35 +02:00
Alex Kost f452e8ff10 profiles: Add 'profile-generations'.
* guix/profiles.scm (profile-generations): New procedure.
2014-09-22 13:24:52 +04:00
Ludovic Courtès c4634dfa26 profiles: Adjust for compatibility with Guile 2.0.5.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/profiles.scm (right-arrow): Use 'set-port-conversion-strategy!'
  instead of '%default-port-conversion-strategy'.  The latter is only
  available in Guile 2.0.5.
2014-09-10 23:33:30 +02:00
Ludovic Courtès 39c4563aea profiles: Use a real arrow to denote upgrades in ASCII.
Suggested by Alex Kost.

* guix/profiles.scm (right-arrow): Fall back to "->".
* tests/profiles.scm ("manifest-show-transaction"): Adjust accordingly.
2014-09-04 21:35:57 +02:00
Ludovic Courtès 9a91476431 profiles: Report version numbers in a separate column.
* guix/profiles.scm (manifest-show-transaction)[package-strings,
  upgrade-strings]: Show version number in separate column.  Show OUTPUT
  in first column, and only when it's different from "out".
2014-09-02 21:25:57 +02:00
Ludovic Courtès ef8993e2dc profiles: Report the old and new version number in upgrades.
* guix/profiles.scm (manifest-lookup): New procedure.
  (manifest-installed?): Use it.
  (manifest-transaction-effects): Return a pair of entries for upgrades.
  (right-arrow): New procedure.
  (manifest-show-transaction)[upgrade-string, →]: New variables.
  Report upgrades using 'upgrade-string'.
* tests/profiles.scm ("manifest-show-transaction"): New test.
  ("manifest-transaction-effects"): Match UPGRADE against a pair.
2014-09-02 21:12:59 +02:00
Ludovic Courtès 79601521fc profiles: Compute transaction effects in a functional way.
* guix/profiles.scm (manifest-transaction-effects): New procedure.
  (manifest-show-transaction): Use it instead of locally computing it.
* tests/profiles.scm (glibc): New variable.
  ("manifest-transaction-effects"): New test.
2014-08-30 21:52:32 +02:00
Ludovic Courtès 2f0556ae5e profiles: Add gzip to $PATH before invoking 'install-info'.
* guix/profiles.scm (info-dir-file)[gzip]: New variable.
  [build]: Add 'setenv' call.
2014-08-28 09:21:06 +02:00
Ludovic Courtès c2815c0f46 profiles: Handle packages without a 'share/info' directory.
Reported by Mark H. Weaver.

* guix/profiles.scm (info-dir-file): Handle the case where 'scandir'
  returns #f.
2014-08-25 10:27:37 +02:00
Ludovic Courtès 79ee406d51 profiles: Produce a top-level Info 'dir' file.
Fixes <http://bugs.gnu.org/18305>.
Reported by Brandon Invergo <brandon@gnu.org>.

* guix/profiles.scm (manifest-inputs, info-dir-file): New procedures.
  (profile-derivation): Use them.  Add #:info-dir? parameter and honor
  it.
* guix/scripts/package.scm (guix-package): Call 'profile-derivation'
  with #:info-dir? #f when the 'bootstrap? option is set.
* tests/profiles.scm ("profile-derivation"): Pass #:info-dir? #f.
2014-08-23 22:33:03 +02:00
Alex Kost 6b74bb0ae3 profiles: Report about upgrades.
* guix/profiles.scm (manifest-show-transaction): Report about upgrades.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-08-23 22:33:03 +02:00
Alex Kost 343745c80a profiles: Add 'manifest-transaction'.
* guix/profiles.scm (<manifest-transaction>): New record-type.
  (manifest-perform-transaction): New procedure.
  (manifest-show-transaction): New procedure.
* tests/profiles.scm ("manifest-perform-transaction"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2014-08-19 22:55:22 +02:00
Ludovic Courtès d34736c5c3 profiles: Adjust to unintended manifest format change.
Reported by Andreas Enge.

* guix/profiles.scm (sexp->manifest): Adjust to handle unintended format
  change introduced in 4ca0b41.
2014-08-12 22:09:42 +02:00
Alex Kost f755403014 profiles: Add 'manifest-add'.
* guix/profiles.scm (manifest-add): New procedure.
* tests/profiles.scm (guile-1.8.8): New variable.
  ("manifest-add"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-08-12 16:03:33 +02:00
Ludovic Courtès 462f5ccade profiles: Add 'package->manifest-entry'.
Suggested by Alex Kost <alezost@gmail.com>.

* guix/scripts/package.scm (options->installable)[package->manifest-entry]:
  Move to (guix profiles).
  [package->manifest-entry*]: New procedure.
  Use it.
* guix/profiles.scm (package->manifest-entry): New procedure.
* tests/profiles.scm (guile-for-build): New variable.
  Call '%guile-for-build'.
  ("profile-derivation"): New test.
2014-07-26 22:57:00 +02:00
Ludovic Courtès 4ca0b4101d profiles: Get rid of the 'inputs' field of 'manifest-entry'.
* guix/profiles.scm (<manifest-entry>)[inputs]: Remove.
  (profile-derivation): Rely on 'item' and 'deps' instead of 'inputs'.
  Adjust 'builder' accordingly.
* guix/scripts/package.scm (options->installable)[package->manifest-entry]:
  Remove 'inputs' field.  Change 'dependencies' field to contain
  packages.
2014-07-26 22:56:59 +02:00
Ludovic Courtès a54c94a40d profiles: Switch to gexps.
* guix/profiles.scm (<manifest-entry>)[path]: Rename to...
  [item]: ... this.  Update users.
  (manifest->sexp): Rename to...
  (manifest->gexp): ... this.  Return a gexp.
  (lower-input): Remove.
  (profile-derivation): Remove 'store' parameter, and turn into a
  monadic procedure.
  [inputs]: New variable.
  [builder]: Turn into a gexp.
  Replace call to 'build-expression->derivation' with call to
  'gexp->derivation'.
* guix/scripts/package.scm (link-to-empty-profile): Adjust call to
  'profile-derivation', and wrap it in 'run-with-store'.
  (show-what-to-remove/install): Rename 'path' to 'item'.  Check whether
  ITEM is a package, and return its output path if it is.
  (input->name+path): Remove.
  (options->installable): Set 'item' to P.
  (guix-package): Adjust call to 'profile-derivation'.
* tests/profiles.scm (guile-2.0.9): Change 'path' to 'item'.
2014-07-26 22:56:59 +02:00
Ludovic Courtès 48704e5b5c profiles: Do away with 'manifest=?'.
* guix/profiles.scm (manifest=?): Remove.
* guix/scripts/package.scm (readlink*): New procedure.
  (guix-package)[process-actions]: Use 'readlink*' and compare the
  profile to be built, PROF, with PROFILE to determine whether there's
  nothing to be done.
2014-07-26 22:56:59 +02:00
Ludovic Courtès ff838e2ce6 profiles: Remove dead code.
* guix/profiles.scm (write-manifest): Remove.
  (read-manifest): Keep private.
2014-07-25 23:42:42 +02:00
Ludovic Courtès 6ce206cb92 Prefer local builds for "small" derivations.
* gnu/system.scm (union, file-union, links): Pass #:local-build? #t to
  'derivation-expression'.
* guix/derivations.scm (imported-files, compiled-modules): Likewise.
* guix/profiles.scm (profile-derivation): Likewise.
2014-01-25 17:22:53 +01:00
Ludovic Courtès 9e55f04a4b profiles: Remove misleading message.
Fixes <http://bugs.gnu.org/16484>.
Reported by Andreas Enge <andreas@enge.fr>.

* guix/profiles.scm (profile-derivation)[builder]: Remove "building
  profile '~a' with ~a packages" message.
2014-01-25 16:20:23 +01:00
Ludovic Courtès dd1a5a152c derivations: Use more keyword parameters for 'build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation): Turn 'system' and
  'inputs' into keyword parameters.
  Adjust callers accordingly.
* gnu/system/linux.scm, gnu/system/vm.scm, guix/build-system/cmake.scm,
  guix/build-system/gnu.scm, guix/build-system/perl.scm,
  guix/build-system/python.scm, guix/build-system/trivial.scm,
  guix/download.scm, guix/packages.scm, guix/profiles.scm,
  guix/scripts/pull.scm, tests/derivations.scm, tests/guix-build.sh,
  tests/monads.scm, tests/store.scm, tests/union.scm: Adjust users of
  'build-expression->derivation' and 'derivation-expression'
  accordingly.
* doc/guix.texi (Derivations): Adjust 'build-expression->derivation'
  documentation accordingly.
  (The Store Monad): Likewise for 'derivation-expression'.
2013-12-04 16:07:53 +01:00
Ludovic Courtès a20787706c guix package: Allow removal of a specific package output.
Fixes <http://bugs.gnu.org/15756>.

* guix/profiles.scm (<manifest-pattern>): New record type.
  (remove-manifest-entry): Remove.
  (entry-predicate, manifest-matching-entries): New procedures.
  (manifest-remove): Accept a list of <manifest-pattern>.
  (manifest-installed?): Replace 'name' parameter by 'pattern', a
  <manifest-pattern>.
* guix/scripts/package.scm (options->removable): Return a list of
  <manifest-pattern>.
  (guix-package)[process-action]: Use 'manifest-matching-entries' to
  compute the list of packages to remove.
* tests/profiles.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
2013-11-01 23:21:01 +01:00
Ludovic Courtès cc4ecc2d88 Add (guix profiles).
* guix/scripts/package.scm (show-what-to-remove/install): New procedure,
  moved from...
  (guix-package): ... here.
  (<manifest>, make-manifest, <manifest-entry>,
  profile-manifest, manifest->sexp, sexp->manifest, read-manifest,
  write-manifest, remove-manifest-entry, manifest-remove,
  manifest-installed?, manifest=?, profile-regexp, generation-numbers,
  previous-generation-number, profile-derivation, generation-number,
  generation-file-name, generation-time, lower-input): Move to...
* guix/profiles.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
2013-11-01 23:21:00 +01:00