Message ID | DM5PR1001MB21059362E2A281295A7FA2B2C5160@DM5PR1001MB2105.namprd10.prod.outlook.com |
---|---|
State | Accepted |
Headers | show |
Series | [bug#44249] gnu: emacs: Make strip-double-wrap more robust | expand |
Context | Check | Description |
---|---|---|
cbaines/submitting builds | success | |
cbaines/issue | success | View issue |
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
Hello, Morgan.J.Smith@outlook.com writes: > * gnu/packages/emacs.scm (emacs) [strip-double-wrap]: > Use regex to find emacs executable. This works even when the version is > changed by package transformations (ex: version=git.master) Thank you. > + (copy-file > + (car Please use pattern matching, i.e. `match', instead of `car'. > + (find-files > + "bin" (file-name-predicate "^emacs-([0-9]+\\.)+[0-9]+$"))) > + "bin/emacs") Would it be even more robust to simply catch any "emacs-" prefixed file name? Regards,
Hi Morgan, Morgan.J.Smith@outlook.com skribis: > From: Morgan Smith <Morgan.J.Smith@outlook.com> > > * gnu/packages/emacs.scm (emacs) [strip-double-wrap]: > Use regex to find emacs executable. This works even when the version is > changed by package transformations (ex: version=git.master) Somehow I had forgotten about this patch, but I finally applied it! > (with-directory-excursion (assoc-ref outputs "out") > - (copy-file (string-append > - "bin/emacs-" > - ,(let ((this-version (package-version this-package))) > - (or (false-if-exception > - (version-major+minor+point this-version)) > - (version-major+minor this-version)))) > - "bin/emacs") > + (copy-file > + (car > + (find-files > + "bin" (file-name-predicate "^emacs-([0-9]+\\.)+[0-9]+$"))) Here I just remove ‘file-name-predicate’ because it’s implicit. I checked that it works with the currently-packaged version as well as ‘--with-branch=emacs-next=master’. Thank you, and apologies for the long delay! Ludo’.
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 4963379d74..5c89e4c6b6 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -196,17 +196,13 @@ (lambda* (#:key outputs #:allow-other-keys) ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped ;; twice. This also fixes a minor issue, where WMs would not be - ;; able to track emacs back to emacs.desktop. The version is - ;; accessed using using THIS-PACKAGE so it "just works" for - ;; inherited Emacs packages of different versions. + ;; able to track emacs back to emacs.desktop. (with-directory-excursion (assoc-ref outputs "out") - (copy-file (string-append - "bin/emacs-" - ,(let ((this-version (package-version this-package))) - (or (false-if-exception - (version-major+minor+point this-version)) - (version-major+minor this-version)))) - "bin/emacs") + (copy-file + (car + (find-files + "bin" (file-name-predicate "^emacs-([0-9]+\\.)+[0-9]+$"))) + "bin/emacs") #t))) (add-before 'reset-gzip-timestamps 'make-compressed-files-writable ;; The 'reset-gzip-timestamps phase will throw a permission error
From: Morgan Smith <Morgan.J.Smith@outlook.com> * gnu/packages/emacs.scm (emacs) [strip-double-wrap]: Use regex to find emacs executable. This works even when the version is changed by package transformations (ex: version=git.master) --- gnu/packages/emacs.scm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)