aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xadmin/elpa2emacs.sh22
1 files changed, 13 insertions, 9 deletions
diff --git a/admin/elpa2emacs.sh b/admin/elpa2emacs.sh
index 891810f8c9b..bea58befa13 100755
--- a/admin/elpa2emacs.sh
+++ b/admin/elpa2emacs.sh
@@ -42,18 +42,19 @@
42# João Távora <joaotavora@gmail.com> 42# João Távora <joaotavora@gmail.com>
43# Pip Cet <pipcet@protonmail.com> 43# Pip Cet <pipcet@protonmail.com>
44 44
45# The ELPA repo will be cloned, unless a copy is provided in the "elpa" 45# The ELPA repo will be cloned into the "elpa" subdirectory of the emacs
46# subdirectory of the emacs repository. You should not use a worktree! 46# repository, unless it's already there. Don't use a worktree for that,
47# though!
47# 48#
48# Run like this: 49# Run like this:
49# 50#
50# bash -ex ./admin/elpa2emacs.sh externals/elisp-benchmarks "benchmarks==>benchmarks/benchmarks" "resources==>benchmarks/resources" "elisp-benchmarks.el==>benchmarks/elisp-benchmarks.el" 51# bash -ex ./admin/elpa2emacs.sh 03e668caf878c9b9780356e447e3fd85e0696f77 "benchmarks==>benchmarks/benchmarks" "resources==>benchmarks/resources" "elisp-benchmarks.el==>benchmarks/elisp-benchmarks.el"
51# 52#
52 53
53# arguments 54# arguments
54OLDDIR="$PWD" 55OLDDIR="$PWD"
55TMPDIR=`mktemp -d` 56TMPDIR=`mktemp -d`
56BRANCH="$1" # a branch name or commit in the ELPA repo 57COMMIT="$1" # a commit in the ELPA repo
57shift 58shift
58PATHS="$@" # paths of files or directories to be matched. 59PATHS="$@" # paths of files or directories to be matched.
59 60
@@ -72,16 +73,17 @@ NONCE=nonce"$(date +'%s')"
72 73
73pushd "$TMPDIR" 74pushd "$TMPDIR"
74# clone repos 75# clone repos
75if [ -r "$OLDDIR"/elpa/.git ]; then 76if ! [ -r "$OLDDIR"/elpa/.git ]; then
76 git clone "$OLDDIR"/elpa "$TMPDIR"/elpa 77 git clone https://git.savannah.gnu.org/git/emacs/elpa.git "$OLDDIR"/elpa
77else
78 git clone https://git.savannah.gnu.org/git/emacs/elpa.git "$TMPDIR"/elpa
79fi 78fi
79git clone "$OLDDIR"/elpa "$TMPDIR"/elpa
80COMMIT="$(cd "$TMPDIR/elpa"; git rev-parse "$COMMIT")"
81
80# filter elpa to keep only the appropriate files. This destroys the 82# filter elpa to keep only the appropriate files. This destroys the
81# newly-created copy of the elpa repo. 83# newly-created copy of the elpa repo.
82 84
83pushd elpa 85pushd elpa
84git checkout "$BRANCH" 86git checkout "$COMMIT"
85git checkout -b "$NONCE" 87git checkout -b "$NONCE"
86 88
87> tmp-list 89> tmp-list
@@ -106,3 +108,5 @@ git remote remove elpa2emacs-filtered-elpa-$NONCE
106 108
107rm -rf "$TMPDIR" 109rm -rf "$TMPDIR"
108echo "You can now commit the merge by running: git commit -n" 110echo "You can now commit the merge by running: git commit -n"
111echo
112echo "After that, you can delete the elpa/ directory in the emacs repository."