]> code.delx.au - gnu-emacs-elpa/commitdiff
Move check_copyright to the makefile
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 13 Aug 2013 21:36:47 +0000 (17:36 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 13 Aug 2013 21:36:47 +0000 (17:36 -0400)
GNUmakefile
admin/archive-contents.el
admin/update-archive.sh
copyright_exceptions [new file with mode: 0644]

index d1baf58a3db6bb72f1e732b79072d02822efb4f8..1067e4c6f0d43c8ec481ea952a9f2a50c7c2fab2 100644 (file)
@@ -9,6 +9,25 @@ SITE_DIR=site
 
 all: all-in-place
 
+CR_EXCEPTIONS=copyright_exceptions
+.PHONY: check_copyrights
+check_copyrights:
+       @echo "Compute exceptions >$(CR_EXCEPTIONS)~"
+       @(cd packages;                                                  \
+       export LANG=C;                                                  \
+       find . -name '*.el' -print0 |                                   \
+           xargs -0 grep -L 'Free Software Foundation, Inc' |          \
+           grep -v '\(\.dir-locals\|.-\(pkg\|autoloads\)\)\.el$$';     \
+       find . -name '*.el' -print |                                    \
+           while read f; do                                            \
+               fquoted="$$(echo $$f|tr '|' '_')";                      \
+               sed -n -e '/[Cc]opyright.*, *[1-9][-0-9]*,\?$$/N'       \
+                   -e '/Free Software Foundation/d'                    \
+                   -e "s|^\\(.*[Cc]opyright\\)|$$fquoted:\\1|p"        \
+                  "$$f";                                               \
+           done) | sort >$(CR_EXCEPTIONS)~
+       diff -u "$(CR_EXCEPTIONS)" "$(CR_EXCEPTIONS)~"
+
 ## Deploy the package archive to archive/, with packages in
 ## archive/packages/:
 archive: archive-tmp
@@ -46,6 +65,8 @@ archive-full: archive-tmp org-fetch
        #mkdir -p archive/admin
        #cp admin/* archive/admin/
 
+# FIXME: Turn it into an `external', which will require adding the notion of
+# "snapshot" packages.
 org-fetch: archive-tmp
        cd $(ARCHIVE_TMP)/packages; \
        pkgname=`curl -s http://orgmode.org/elpa/|perl -ne 'push @f, $$1 if m/(org-\d{8})\.tar/; END { @f = sort @f; print "$$f[-1]\n"}'`; \
index 8ef73aaa142046ccfdc5d8d9790133e7e698d338..863b13e479e8b4fb6a19d51223d6d0b44d7dd327 100644 (file)
@@ -207,7 +207,7 @@ Rename DIR/PKG.el to PKG-VERS.el, delete DIR, and return the descriptor."
         (while (progn (forward-line -1) (>= (point) start))
           (insert ";; ")))
       (set (make-local-variable 'backup-inhibited) t)
-      (save-buffer)
+      (basic-save-buffer)               ;Less chatty than save-buffer.
       (kill-buffer)))
   (delete-directory dir t)
   (cons (intern pkg) (vector (version-to-list vers) req desc 'single)))
index 662d8db2a26d6055154c454febc14abde7bcd56d..91090ac837e8f45ddf52f8374f3f01678ffb4256 100755 (executable)
@@ -1,33 +1,20 @@
 #!/bin/sh -x
 
-batchmode=no
+makelog=""
+buildir="$(pwd)"
 
 export LANG=C
 case "$1" in
-    "--batch") batchmode=yes ;;
+    "--batch")
+        makelog="$(pwd)/make.log"
+        exec >"$makelog" 2>&1
+        ;;
 esac
 
-# Return on STDOUT the files that don't seem to have the needed copyright
-# notice, or that have a copyright notice that looks suspicious.
-copyright_notices () {
-    find . -name '*.el' -print0 |
-        xargs -0 grep -L 'Free Software Foundation, Inc' |
-        grep -v '\(\.dir-locals\|.-\(pkg\|autoloads\)\)\.el$'
-
-    find . -name '*.el' -print |
-        while read f; do
-            sed -n -e '/[Cc]opyright.*, *[1-9][-0-9]*,\?$/N' \
-                -e '/Free Software Foundation/d' \
-                -e "s|^\\(.*[Cc]opyright\\)|$(echo $f | tr '|' '_'):\\1|p" "$f"
-        done
-}
-
 # Send an email to warn about a problem.
-# Takes the body on STDIN and the subject as argument.
 signal_error () {
     title="$*"
-    if [ "no" = "$batchmode" ]; then
-        cat -
+    if [ "" = "$makelog" ]; then
         echo "Error: $title"
     else
         mx_gnu_org="$(host -t mx gnu.org | sed 's/.*[  ]//')"
@@ -41,37 +28,24 @@ To: emacs-elpa-diffs@gnu.org
 Subject: $title
 
 ENDDOC
-         cat -
+         cat "$makelog"
          echo "."; sleep 1) | telnet "$mx_gnu_org" smtp
     fi
+    exit 1
 }
 
-check_copyright () {
-    base="copyright_exceptions"
-    (cd $1/packages; copyright_notices) >"$base.new"
-    if [ -r "$base.old" ] &&
-       ! diff "$base.old" "$base.new" >/dev/null;
-    then
-        diff -u "$base.old" "$base.new" |
-            signal_error "Copyright notices changed"
-        exit 1
-    else
-        mv "$base.new" "$base.old"
-    fi
-}
 
-#cd ~elpa/build
+cd ../elpa
 
-(cd ../elpa;
+# Fetch changes.
+git pull || signal_error "git pull failed"
 
- # Fetch changes.
- git pull || signal_error "git pull failed";
+# Setup and update externals.
+make externals
 
- # Setup and update externals.
- make externals
- )
+make check_copyrights || signal_error "check_copyright failed"
 
-#check_copyright ../elpa
+cd "$buildir"
 
 rsync -av --delete --exclude=ChangeLog --exclude=.git ../elpa/packages ./
 
@@ -82,9 +56,8 @@ emacs -batch -l admin/archive-contents.el \
 
 
 rm -rf archive                  # In case there's one left over!
-make archive-full >make.log 2>&1 || {
-    signal_error "make archive-full failed" <make.log
-    exit 1
+make archive-full || {
+    signal_error "make archive-full failed"
 }
 latest="emacs-packages-latest.tgz"
 (cd archive
@@ -106,14 +79,17 @@ latest="emacs-packages-latest.tgz"
          */archive-contents | *-readme.txt ) mv "$f" "$dst" ;;
          * ) if [ -r "$dst" ]
              then rm "$f"
-             else mv "$f" "$dst"
+             else
+                 # FIXME: Announce the new package/version on
+                 # gnu.emacs.sources!
+                 mv "$f" "$dst"
              fi ;;
      esac
  done
  mv build/archive/"$latest" staging/
  rm -rf build/archive)
 
-# Make the HTML files.
+# Make the HTML and readme.txt files.
 (cd ../staging/packages
  emacs --batch -l ../../build/admin/archive-contents.el \
        --eval '(batch-html-make-index)')
diff --git a/copyright_exceptions b/copyright_exceptions
new file mode 100644 (file)
index 0000000..7f669a9
--- /dev/null
@@ -0,0 +1,49 @@
+./auctex/latex.el:   "pounds" "copyright"
+./auctex/multi-prompt.el
+./auctex/style/amsart.el
+./auctex/style/amsbook.el
+./auctex/style/amsbsy.el
+./auctex/style/amsmath.el:;; FIXME: What about the copyright for <= 2001?
+./auctex/style/amsopn.el
+./auctex/style/amstext.el
+./auctex/style/article.el
+./auctex/style/beamer.el
+./auctex/style/book.el
+./auctex/style/czech.el
+./auctex/style/danish.el
+./auctex/style/dk.el
+./auctex/style/dutch.el
+./auctex/style/foils.el
+./auctex/style/german.el
+./auctex/style/graphics.el
+./auctex/style/j-article.el
+./auctex/style/j-book.el
+./auctex/style/j-report.el
+./auctex/style/jarticle.el
+./auctex/style/jbook.el
+./auctex/style/jreport.el
+./auctex/style/jsarticle.el
+./auctex/style/jsbook.el
+./auctex/style/jurabib.el:;; you assign the copyright to the FSF.
+./auctex/style/letter.el
+./auctex/style/natbib.el
+./auctex/style/ngerman.el
+./auctex/style/plfonts.el
+./auctex/style/plhb.el
+./auctex/style/report.el
+./auctex/style/scrartcl.el
+./auctex/style/scrbook.el
+./auctex/style/scrlttr2.el
+./auctex/style/scrpage2.el
+./auctex/style/scrreprt.el
+./auctex/style/slovak.el
+./auctex/style/swedish.el
+./auctex/style/virtex.el
+./auctex/tex-fold.el:    ("(C)" ("copyright"))
+./auctex/tex-info.el:   '("copyright" nil)
+./muse/htmlize-hack.el
+./uni-confusables/gen-confusables.el:      (insert ";; Copyright (C) 1991-2009, 2010 Unicode, Inc.
+./uni-confusables/gen-confusables.el:;; for the copyright and permission notice.\n\n")
+./uni-confusables/uni-confusables.el
+./uni-confusables/uni-confusables.el:;; Copyright (C) 1991-2009, 2010 Unicode, Inc.
+./uni-confusables/uni-confusables.el:;; for the copyright and permission notice.