unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/1] Strip parent path from package descriptions for reproducibility
@ 2020-11-07 21:50 Rob Browning
  2020-11-13  4:39 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Browning @ 2020-11-07 21:50 UTC (permalink / raw)
  To: emacs-devel

Previously, the package description would include the full build tree
path which varies.  Instead, remove any duplicate slashes and any
components other than the immediate parent.

Bug-Debian: https://bugs.debian.org/972861
---

 I'm not sure this is suitable for Emacs proper, and it could likely
 use some improvement, but we've applied it in Debian for the time
 being in order to avoid introducing unreprodcible strings into
 generated packages.

 lisp/emacs-lisp/package.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 7d6be3cf4e2..60561fdb678 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -963,7 +963,11 @@ package-generate-description-file
       (write-region
        (concat
         ";;; Generated package description from "
-        (replace-regexp-in-string "-pkg\\.el\\'" ".el" pkg-file)
+        (replace-regexp-in-string ;; just the final y.el or x/y.el
+         "^.*?\\([^/]+/\\)?\\([^/]+\\)$" "\\1\\2"
+         (replace-regexp-in-string
+          "/+" "/"
+          (replace-regexp-in-string "-pkg\\.el\\'" ".el" pkg-file)))
         "  -*- no-byte-compile: t -*-\n"
         (prin1-to-string
          (nconc
-- 
2.29.2




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Strip parent path from package descriptions for reproducibility
  2020-11-07 21:50 [PATCH 1/1] Strip parent path from package descriptions for reproducibility Rob Browning
@ 2020-11-13  4:39 ` Stefan Monnier
  2020-11-15  0:38   ` Rob Browning
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2020-11-13  4:39 UTC (permalink / raw)
  To: Rob Browning; +Cc: emacs-devel

>  I'm not sure this is suitable for Emacs proper, and it could likely
>  use some improvement, but we've applied it in Debian for the time
>  being in order to avoid introducing unreprodcible strings into
>  generated packages.

Thanks, but I think the current master code made your code redundant
when the following patch was installed:

    commit 1fc9de4b81ceacabef6aafe48ecaabaf76f34bb2
    Author: Glenn Morris <rgm@gnu.org>
    Date:   Fri Oct 30 19:20:24 2020 -0700
    
        Improve reproducibility of generated -pkg.el files
        
        * lisp/emacs-lisp/package.el (package-generate-description-file):
        Don't include the full name of the source file in the header,
        since that varies non-reproducibly according to the build directory.
        https://bugs.debian.org/972861
        Note that elpa.gnu.org's admin/archive-contents.el does this by hand
        and already only includes the nondirectory part.
    
    diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
    --- a/lisp/emacs-lisp/package.el
    +++ b/lisp/emacs-lisp/package.el
    @@ -963,7 +963,8 @@
           (write-region
            (concat
             ";;; Generated package description from "
    -        (replace-regexp-in-string "-pkg\\.el\\'" ".el" pkg-file)
    +        (replace-regexp-in-string "-pkg\\.el\\'" ".el"
    +                                  (file-name-nondirectory pkg-file))
             "  -*- no-byte-compile: t -*-\n"
             (prin1-to-string
              (nconc


-- Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Strip parent path from package descriptions for reproducibility
  2020-11-13  4:39 ` Stefan Monnier
@ 2020-11-15  0:38   ` Rob Browning
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Browning @ 2020-11-15  0:38 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>  I'm not sure this is suitable for Emacs proper, and it could likely
>>  use some improvement, but we've applied it in Debian for the time
>>  being in order to avoid introducing unreprodcible strings into
>>  generated packages.
>
> Thanks, but I think the current master code made your code redundant
> when the following patch was installed:

Great, and thanks.  I'll replace Debian's patch with that one.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-15  0:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-07 21:50 [PATCH 1/1] Strip parent path from package descriptions for reproducibility Rob Browning
2020-11-13  4:39 ` Stefan Monnier
2020-11-15  0:38   ` Rob Browning

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).