diff options
| -rwxr-xr-x | admin/elpa2emacs.sh | 22 |
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 |
| 54 | OLDDIR="$PWD" | 55 | OLDDIR="$PWD" |
| 55 | TMPDIR=`mktemp -d` | 56 | TMPDIR=`mktemp -d` |
| 56 | BRANCH="$1" # a branch name or commit in the ELPA repo | 57 | COMMIT="$1" # a commit in the ELPA repo |
| 57 | shift | 58 | shift |
| 58 | PATHS="$@" # paths of files or directories to be matched. | 59 | PATHS="$@" # paths of files or directories to be matched. |
| 59 | 60 | ||
| @@ -72,16 +73,17 @@ NONCE=nonce"$(date +'%s')" | |||
| 72 | 73 | ||
| 73 | pushd "$TMPDIR" | 74 | pushd "$TMPDIR" |
| 74 | # clone repos | 75 | # clone repos |
| 75 | if [ -r "$OLDDIR"/elpa/.git ]; then | 76 | if ! [ -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 |
| 77 | else | ||
| 78 | git clone https://git.savannah.gnu.org/git/emacs/elpa.git "$TMPDIR"/elpa | ||
| 79 | fi | 78 | fi |
| 79 | git clone "$OLDDIR"/elpa "$TMPDIR"/elpa | ||
| 80 | COMMIT="$(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 | ||
| 83 | pushd elpa | 85 | pushd elpa |
| 84 | git checkout "$BRANCH" | 86 | git checkout "$COMMIT" |
| 85 | git checkout -b "$NONCE" | 87 | git checkout -b "$NONCE" |
| 86 | 88 | ||
| 87 | > tmp-list | 89 | > tmp-list |
| @@ -106,3 +108,5 @@ git remote remove elpa2emacs-filtered-elpa-$NONCE | |||
| 106 | 108 | ||
| 107 | rm -rf "$TMPDIR" | 109 | rm -rf "$TMPDIR" |
| 108 | echo "You can now commit the merge by running: git commit -n" | 110 | echo "You can now commit the merge by running: git commit -n" |
| 111 | echo | ||
| 112 | echo "After that, you can delete the elpa/ directory in the emacs repository." | ||