From 369d20559d6118d6b6cee2adc265114ad30fa3b3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 4 Feb 2019 19:50:44 -0800 Subject: [PATCH] * make-dist: Prefer a temporary manifest file. This prevents the manifest cluttering up the build tree, and possibly getting stale if --no-update is used. --- make-dist | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/make-dist b/make-dist index ef35c87c355..4e18d77a87b 100755 --- a/make-dist +++ b/make-dist @@ -381,27 +381,33 @@ 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" +# TODO: maybe this should ignore $update, and always update MANIFEST +# if .git is present. +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 -