]>
code.delx.au - gnu-emacs-elpa/blob - admin/update-archive.sh
662d8db2a26d6055154c454febc14abde7bcd56d
7 "--batch") batchmode
=yes ;;
10 # Return on STDOUT the files that don't seem to have the needed copyright
11 # notice, or that have a copyright notice that looks suspicious.
12 copyright_notices
() {
13 find .
-name '*.el' -print0 |
14 xargs -0 grep -L 'Free Software Foundation, Inc' |
15 grep -v '\(\.dir-locals\|.-\(pkg\|autoloads\)\)\.el$'
17 find .
-name '*.el' -print |
19 sed -n -e '/[Cc]opyright.*, *[1-9][-0-9]*,\?$/N' \
20 -e '/Free Software Foundation/d' \
21 -e "s|^\\(.*[Cc]opyright\\)|$(echo $f | tr '|' '_'):\\1|p" "$f"
25 # Send an email to warn about a problem.
26 # Takes the body on STDIN and the subject as argument.
29 if [ "no" = "$batchmode" ]; then
33 mx_gnu_org
="$(host -t mx gnu.org | sed 's/.*[ ]//')"
34 (sleep 5; echo "HELO elpa.gnu.org"
35 sleep 1; echo "MAIL FROM: <elpa@elpa.gnu.org>"
36 sleep 1; echo "RCPT TO: <emacs-elpa-diffs@gnu.org>"
39 From: ELPA update <elpa@elpa.gnu.org>
40 To: emacs-elpa-diffs@gnu.org
45 echo "."; sleep 1) |
telnet "$mx_gnu_org" smtp
50 base
="copyright_exceptions"
51 (cd $1/packages
; copyright_notices
) >"$base.new"
52 if [ -r "$base.old" ] &&
53 ! diff "$base.old" "$base.new" >/dev
/null
;
55 diff -u "$base.old" "$base.new" |
56 signal_error
"Copyright notices changed"
59 mv "$base.new" "$base.old"
68 git pull || signal_error
"git pull failed";
70 # Setup and update externals.
74 #check_copyright ../elpa
76 rsync
-av --delete --exclude=ChangeLog
--exclude=.git ..
/elpa
/packages .
/
78 # Refresh the ChangeLog files. This needs to be done in
79 # the source tree, because it needs the VCS data!
80 emacs
-batch -l admin
/archive-contents.el \
81 -eval '(archive-prepare-packages "../elpa")'
84 rm -rf archive
# In case there's one left over!
85 make archive-full
>make.log
2>&1 ||
{
86 signal_error
"make archive-full failed" <make.log
89 latest
="emacs-packages-latest.tgz"
91 tar zcf
"$latest" packages
)
93 mkdir
-p staging
/packages
94 # Not sure why we have `staging-old', but let's keep it for now.
96 cp -a staging staging-old
97 # Move new files into place but don't throw out old package versions.
98 for f
in build
/archive
/packages
/*; do
99 dst
="staging/packages/$(basename "$f")"
100 # Actually, let's never overwrite an existing version. So changes can
101 # be installed without causing a new package to be built until the
102 # version field is changed. Some files need to be excluded from the
103 # "immutable" policy, most importantly "archive-contents"
104 # and "*-readme.txt".
106 */archive-contents |
*-readme.txt
) mv "$f" "$dst" ;;
113 mv build
/archive
/"$latest" staging
/
114 rm -rf build
/archive
)
116 # Make the HTML files.
117 (cd ..
/staging
/packages
118 emacs
--batch -l ..
/..
/build
/admin
/archive-contents.el \
119 --eval '(batch-html-make-index)')