Re: master 38fb5f4: Make make-dist more automatic

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: master 38fb5f4: Make make-dist more automatic

Glenn Morris-3

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"





Reply | Threaded
Open this post in threaded view
|

Re: master 38fb5f4: Make make-dist more automatic

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

Reply | Threaded
Open this post in threaded view
|

Re: master 38fb5f4: Make make-dist more automatic

Glenn Morris-3
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.