GNU bug report logs - #68935
[PATCH 0/3] Add 'put' option to guix import.

Previous Next

Package: guix-patches;

Reported by: Herman Rimm <herman <at> rimm.ee>

Date: Mon, 5 Feb 2024 14:52:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #59 received at 68935 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 68935 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, Herman Rimm <herman <at> rimm.ee>
Subject: [PATCH v3 0/7] Add insert option to guix import.
Date: Tue, 20 Feb 2024 21:45:08 +0100
Hi,

Thanks for the feedback. Biggest issue I see is, e.g.:

  (define-public package-bar)
  ;; Unlikely comment about package-bar.
  
  (define for-package-foo)
  ;; Comment related to package-foo.
  (define-public package-foo)

after inserting package-baz becomes:

  (define-public package-bar)
  ;; Unlikely comment about package-bar.
  
  (define for-package-foo)
  ;; Comment related to package-foo.
+ (define-public package-baz)
+
  (define-public package-foo)

but for a language read from top-to-bottom I would rather want:

  (define-public package-bar)
+  
+ (define for-package-baz)
  ;; Unlikely comment about package-bar.

  (define for-package-foo)
  ;; Comment related to package-foo.
  (define-public package-foo)

This would be the case if package-baz is inserted after package-bar,
rather than before package-foo. I don't intend to implement this though,
and for the large gnu/packages/crates-*.scm files, where alphabetical
--insert is most useful, I believe this issue is the least likely to
occur. So despite the issue, I think these patches can be upstreamed.

Cheers,
Herman

Herman Rimm (7):
  doc: Note SVN dependency of texlive importer.
  import: Wrap package expressions with define-public.
  utils: Add insert-expression procedure.
  utils: Add find-definition-insertion-location procedure.
  import: Insert packages into modules alphabetically.
  import: Discard args after --version and --help.
  import: Do not return package name with json importer.

 doc/guix.texi           | 22 ++++++++---
 doc/package-hello.json  |  6 +--
 guix/import/json.scm    | 13 +++----
 guix/scripts/import.scm | 82 ++++++++++++++++++++++++++++-------------
 guix/utils.scm          | 30 +++++++++++++++
 tests/utils.scm         | 28 ++++++++++++++
 6 files changed, 140 insertions(+), 41 deletions(-)


base-commit: e3c612a7de679c96b9eafdb0da500dcc18d9a101
-- 
2.41.0





This bug report was last modified 1 year and 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.