unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 38fb5f4: Make make-dist more automatic
       [not found] ` <20190201234221.F285C205D8@vcs0.savannah.gnu.org>
@ 2019-02-02 19:19   ` Glenn Morris
  2019-02-03  3:27     ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2019-02-02 19:19 UTC (permalink / raw)
  To: emacs-devel; +Cc: Paul Eggert


Hi,

> branch: master
> commit 38fb5f4d22a5d69621a8b42bf39258af0919b456

>     Make make-dist more automatic


I like the simplification, but I have some issues with the MANIFEST file.

1) I don't think it should be linked to --no-update. The MANIFEST file
is fundamental to creating a tar file and it needs to be up-to-date.
As it stands, if you use --no-update you can easily end up with a stale
MANIFEST file and a broken tar file. If it does need to be optional,
please can it have a separate eg --no-update-manifest option.

2) Running make-dist leaves a top-level MANIFEST file that nothing ever
deletes. Since in the vast majority of the time this file will be an
automatically generated file, I think it would be better to use a
temporary file. This also takes care of point 1.

Here's a possible patch.
This excludes itself MANIFEST from the tar file.
It could be re-added, but I don't know what the point would be.

--- i/make-dist
+++ w/make-dist
@@ -364,7 +364,7 @@ fi
 # Don't distribute site-init.el, site-load.el, or default.el.
 possibly_non_vc_files="
   $top_level_ChangeLog
-  MANIFEST aclocal.m4 configure
+  aclocal.m4 configure
   admin/charsets/jisx2131-filter
   src/config.in src/dmpstruct.h src/emacs-module.h
   src/fingerprint.c
@@ -381,27 +381,31 @@ else
   info_files=
 fi
 
+echo "Creating staging directory: '${tempparent}'"
+
+mkdir ${tempparent} || exit
+tempdir="${tempparent}/${emacsname}"
+
+manifest=MANIFEST
+
+[ -f $manifest ] || manifest=${tempparent}/MANIFEST
+
 # If Git is in use update the file MANIFEST, which can substitute for
 # 'git ls-files' later (e.g., after extraction from a tarball).
 # Otherwise, rely on the existing MANIFEST, which should be maintained some
 # other way when adding or deleting a distributed file while not using Git.
-if ( [ $update = yes ] || [ ! -f MANIFEST ] ) && [ -r .git ]; then
-  echo "Updating MANIFEST"
+if ( [ $update = yes ] || [ ! -f $manifest ] ) && [ -r .git ]; then
+  echo "Updating $manifest"
   if [ $with_tests = yes ]; then
-    git ls-files >MANIFEST
+    git ls-files > $manifest
   else
-    git ls-files | grep -v '^test' >MANIFEST
+    git ls-files | grep -v '^test' >$manifest
   fi || exit
-  printf '%s\n' $possibly_non_vc_files $info_files >>MANIFEST || exit
-  sort -u -o MANIFEST MANIFEST || exit
+  printf '%s\n' $possibly_non_vc_files $info_files >>$manifest || exit
+  sort -u -o $manifest $manifest || exit
 fi
 
-<MANIFEST || exit
-
-echo "Creating staging directory: '${tempparent}'"
-
-mkdir ${tempparent} || exit
-tempdir="${tempparent}/${emacsname}"
+<$manifest || exit
 
 ### This trap ensures that the staging directory will be cleaned up even
 ### when the script is interrupted in mid-career.
@@ -449,13 +453,13 @@ MANIFEST_subdir_sed='
   /^$/d
   s,^,'$tempdir'/,
 '
-tempsubdirs=$(sed "$MANIFEST_subdir_sed" MANIFEST | sort -u)
+tempsubdirs=$(sed "$MANIFEST_subdir_sed" $manifest | sort -u)
 $mkdir_verbose -p $tempsubdirs || exit
 
 echo "Making links to files"
 while read file; do
   [ $file = "$file_to_skip" ] || ln $file $tempdir/$file || exit
-done <MANIFEST
+done <$manifest
 
 if [ "${newer}" ]; then
   printf '%s\n' "Removing files older than $newer"







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

* Re: master 38fb5f4: Make make-dist more automatic
  2019-02-02 19:19   ` master 38fb5f4: Make make-dist more automatic Glenn Morris
@ 2019-02-03  3:27     ` Paul Eggert
  2019-02-05  3:54       ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2019-02-03  3:27 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

Glenn Morris wrote:
> I like the simplification, but I have some issues with the MANIFEST file.

Yes, it's a bit of a wart.

> 1) I don't think it should be linked to --no-update. The MANIFEST file
> is fundamental to creating a tar file and it needs to be up-to-date.
> As it stands, if you use --no-update you can easily end up with a stale
> MANIFEST file and a broken tar file. If it does need to be optional,
> please can it have a separate eg --no-update-manifest option.

It would be easy to change make-dist to rebuild MANIFEST regardless of 
--no-update, and I don't see any problem with that.

> 2) Running make-dist leaves a top-level MANIFEST file that nothing ever
> deletes. Since in the vast majority of the time this file will be an
> automatically generated file, I think it would be better to use a
> temporary file. This also takes care of point 1.
> 
> Here's a possible patch.
> This excludes itself MANIFEST from the tar file.
> It could be re-added, but I don't know what the point would be.

The point of shipping MANIFEST is to handle the following situation:

1. User gets an Emacs tarball and extracts it.

2. User changes the source code.

2. User runs "make dist".

Without the MANIFEST file, step (3) would fail because no Git repository is 
available to tell make-dist the names of most of the source files.

If it's OK for us to say, "You must have a Git repository in order to make a 
distribution" then we can dispense with shipping a MANIFEST file; we might even 
be able to dispense from generate a manifest file at all, even a temporary one. 
But if we want to decouple having Git from the ability to make a distribution, 
we'll need something like a MANIFEST file (unless we want to go back to the old 
approach of listing files in make-dist itself, which was error-prone).



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

* Re: master 38fb5f4: Make make-dist more automatic
  2019-02-03  3:27     ` Paul Eggert
@ 2019-02-05  3:54       ` Glenn Morris
  0 siblings, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2019-02-05  3:54 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

Paul Eggert wrote:

> 1. User gets an Emacs tarball and extracts it.
>
> 2. User changes the source code.
>
> 2. User runs "make dist".

I installed something that allows for that.




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

end of thread, other threads:[~2019-02-05  3:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20190201234220.19088.3350@vcs0.savannah.gnu.org>
     [not found] ` <20190201234221.F285C205D8@vcs0.savannah.gnu.org>
2019-02-02 19:19   ` master 38fb5f4: Make make-dist more automatic Glenn Morris
2019-02-03  3:27     ` Paul Eggert
2019-02-05  3:54       ` Glenn Morris

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).