emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ELPA-diffs] ELPA branch, master, updated. 9c123a56704af574567af819193a8


From: Stefan Monnier
Subject: [ELPA-diffs] ELPA branch, master, updated. 9c123a56704af574567af819193a825c15899d64
Date: Tue, 13 Aug 2013 21:36:53 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ELPA".

The branch, master has been updated
       via  9c123a56704af574567af819193a825c15899d64 (commit)
       via  dc6cbe360eb4fed0f639e6c3e86323770c143102 (commit)
      from  c94a27a3ba6fb7d4dd74c80b4f6390a5bd480120 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9c123a56704af574567af819193a825c15899d64
Author: Stefan Monnier <address@hidden>
Date:   Tue Aug 13 17:36:47 2013 -0400

    Move check_copyright to the makefile

diff --git a/GNUmakefile b/GNUmakefile
index d1baf58..1067e4c 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -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"}'`; \
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index 8ef73aa..863b13e 100644
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -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)))
diff --git a/admin/update-archive.sh b/admin/update-archive.sh
index 662d8db..91090ac 100755
--- a/admin/update-archive.sh
+++ b/admin/update-archive.sh
@@ -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: address@hidden
 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
index 0000000..7f669a9
--- /dev/null
+++ b/copyright_exceptions
@@ -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.

commit dc6cbe360eb4fed0f639e6c3e86323770c143102
Author: Stefan Monnier <address@hidden>
Date:   Tue Aug 13 15:36:43 2013 -0400

    Fix up scripts to build archive from Git

diff --git a/GNUmakefile b/GNUmakefile
index 3199fcc..d1baf58 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,6 +1,6 @@
 # Makefile for GNU Emacs Lisp Package Archive.
 
-EMACS=emacs
+EMACS=emacs --batch
 
 ARCHIVE_TMP=archive-tmp
 SITE_DIR=site
@@ -23,14 +23,16 @@ process-archive:
        # FIXME, we could probably speed this up significantly with
        # rules like "%.tar: ../%/ChangeLog" so we only rebuild the packages
        # that have indeed changed.
-       cd $(ARCHIVE_TMP)/packages; $(EMACS) -batch -l 
$(CURDIR)/admin/archive-contents.el -f batch-make-archive
+       cd $(ARCHIVE_TMP)/packages; \
+         $(EMACS) -l $(CURDIR)/admin/archive-contents.el \
+           -f batch-make-archive
        @cd $(ARCHIVE_TMP)/packages; \
-       for pt in *; do \
-           if [ -d $$pt ]; then \
-               echo "Creating tarball $${pt}.tar" && \
-               tar -cf $${pt}.tar $$pt --remove-files; \
-           fi; \
-       done
+         for pt in *; do \
+             if [ -d $$pt ]; then \
+                 echo "Creating tarball $${pt}.tar" && \
+                 tar -cf $${pt}.tar $$pt --remove-files; \
+             fi; \
+         done
        mkdir -p archive/packages
        mv archive/packages archive/packages-old
        mv $(ARCHIVE_TMP)/packages archive/packages
@@ -80,12 +82,11 @@ $(foreach al, $(autoloads), $(eval $(call RULE-srcdeps, 
$(al))))
 %-autoloads.el:
        @echo 'EMACS -f package-generate-autoloads $@'
        @cd $(dir $@); \
-       $(EMACS) --batch \
-           -l $(CURDIR)/admin/archive-contents.el \
-           --eval "(archive--refresh-pkg-file)" \
-           --eval "(require 'package)" \
-           --eval "(package-generate-autoloads '$$(basename $$(pwd)) \
-                                               \"$$(pwd)\")"
+         $(EMACS) -l $(CURDIR)/admin/archive-contents.el \
+             --eval "(archive--refresh-pkg-file)" \
+             --eval "(require 'package)" \
+             --eval "(package-generate-autoloads '$$(basename $$(pwd)) \
+                                                 \"$$(pwd)\")"
 
 # Put into elcs the set of elc files we need to keep up-to-date.
 # I.e. one for each .el file except for the -pkg.el, the -autoloads.el, and
@@ -102,7 +103,7 @@ elcs := $(call SET-diff, $(naive_elcs), $(patsubst %.el, 
%.elc, $(nbc_els)))
 # '(dolist (al (quote ($(patsubst %, "%", $(autoloads))))) (load 
(expand-file-name al) nil t))'
 %.elc: %.el
        @echo 'EMACS -f batch-byte-compile $<'
-       @$(EMACS) --batch \
+       @$(EMACS) \
            --eval "(setq package-directory-list '(\"$(abspath packages)\"))" \
            --eval '(package-initialize)' \
            -L $(dir $@) -f batch-byte-compile $<
@@ -124,7 +125,7 @@ $(extra_elcs):; rm $@
 # #$(foreach al, $(single_pkgs), $(eval $(call RULE-srcdeps, $(al))))
 # %-pkg.el: %.el
 #      @echo 'EMACS -f package-generate-description-file $@'
-#      @$(EMACS) --batch \
+#      @$(EMACS) \
 #          --eval '(require (quote package))' \
 #          --eval '(setq b (find-file-noselect "$<"))' \
 #          --eval '(setq d (with-current-buffer b (package-buffer-info)))' \
@@ -138,3 +139,7 @@ all-in-place: $(extra_elcs) $(autoloads) # $(single_pkgs)
 
 ############### Rules to prepare the externals ################################
 
+.PHONY:
+externals:
+       $(EMACS) -l admin/archive-contents.el \
+           -f archive-add/remove/update-externals
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index 5a5462a..8ef73aa 100644
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -86,40 +86,64 @@ Delete backup files also."
       (pp (nreverse packages) (current-buffer))
       (write-region nil nil "archive-contents"))))
 
-(defun batch-prepare-packages ()
+(defconst archive--revno-re "[0-9a-f]+")
+
+(defun archive-prepare-packages (srcdir)
   "Prepare the `packages' directory inside the Git checkout.
 Expects to be called from within the `packages' directory.
 \"Prepare\" here is for subsequent construction of the packages and archive,
 so it is meant to refresh any generated files we may need.
 Currently only refreshes the ChangeLog files."
+  (setq srcdir (file-name-as-directory (expand-file-name srcdir)))
   (let* ((wit ".changelog-witness")
-         (prevno (or (with-temp-buffer
-                       (ignore-errors (insert-file-contents wit))
-                       (when (looking-at "[1-9][0-9]*\\'")
-                         (string-to-number (match-string 0))))
-                     1))
+         (prevno (with-temp-buffer
+                   (ignore-errors (insert-file-contents wit))
+                   (if (looking-at (concat archive--revno-re "$"))
+                       (match-string 0)
+                     (error "Can't find previous revision name"))))
          (new-revno
           (or (with-temp-buffer
-                (call-process "bzr" nil '(t) nil "revno")
-                (goto-char (point-min))
-                (when (looking-at "[1-9][0-9]*$")
-                  (string-to-number (match-string 0))))
-              (error "bzr revno did not return a number as expected")))
+                (let ((default-directory srcdir))
+                  (call-process "git" nil '(t) nil "rev-parse" "HEAD")
+                  (goto-char (point-min))
+                  (when (looking-at (concat archive--revno-re "$"))
+                    (match-string 0))))
+              (error "Couldn't find the current revision's name")))
          (pkgs '()))
-    (unless (= prevno new-revno)
+    (unless (equal prevno new-revno)
       (with-temp-buffer
-        (unless (zerop (call-process "bzr" nil '(t) nil "log" "-v"
-                                     (format "-r%d.." (1+ prevno))))
-          (error "Error signaled by bzr log -v -r%d.." (1+ prevno)))
+        (let ((default-directory srcdir))
+          (unless (zerop (call-process "git" nil '(t) nil "diff"
+                                       "--dirstat=cumulative,0"
+                                       prevno))
+            (error "Error signaled by git diff --dirstat %d" prevno)))
         (goto-char (point-min))
-        (while (re-search-forward "^  packages/\\([-[:alnum:]]+\\)/" nil t)
-          (pushnew (match-string 1) pkgs :test #'equal))))
-    (dolist (pkg pkgs)
-      (condition-case v
-          (if (file-directory-p pkg)
-              (archive--make-changelog pkg))
-        (error (message "Error: %S" v))))
-    (write-region (number-to-string new-revno) nil wit nil 'quiet)))
+        (while (re-search-forward "^[ \t.0-9%]* packages/\\([-[:alnum:]]+\\)/$"
+                                  nil t)
+          (push (match-string 1) pkgs))))
+    (let ((default-directory (expand-file-name "packages/")))
+      (dolist (pkg pkgs)
+        (condition-case v
+            (if (file-directory-p pkg)
+                (archive--make-changelog pkg (expand-file-name "packages/"
+                                                               srcdir)))
+          (error (message "Error: %S" v)))))
+    (write-region new-revno nil wit nil 'quiet)
+    ;; Also update the ChangeLog of external packages.
+    (let ((default-directory (expand-file-name "packages/")))
+      (dolist (dir (directory-files "."))
+        (and (not (member dir '("." "..")))
+             (file-directory-p dir)
+             (let ((index (expand-file-name
+                           (concat "packages/" dir "/.git/index")
+                           srcdir))
+                   (cl (expand-file-name "ChangeLog" dir)))
+               (and (file-exists-p index)
+                    (or (not (file-exists-p cl))
+                        (file-newer-than-file-p index cl))))
+             (archive--make-changelog
+              dir (expand-file-name "packages/" srcdir)))))
+    ))
 
 (defun archive--simple-package-p (dir pkg)
   "Test whether DIR contains a simple package named PKG.
@@ -131,7 +155,7 @@ Otherwise, return nil."
   (let* ((pkg-file (expand-file-name (concat pkg "-pkg.el") dir))
         (mainfile (expand-file-name (concat pkg ".el") dir))
          (files (directory-files dir nil archive-re-no-dot))
-        version description req commentary)
+        version description req)
     (dolist (file (prog1 files (setq files ())))
       (unless (string-match "\\(?:\\.elc\\|~\\)\\'" file)
         (push file files)))
@@ -157,33 +181,13 @@ Otherwise, return nil."
             (if requires-str
                 (setq req (mapcar 'archive--convert-require
                                   (car (read-from-string requires-str))))))
-          (setq commentary (lm-commentary))
-          (list version description req commentary))))
+          (list version description req))))
      ((not (file-exists-p pkg-file))
       (error "Can find single file nor package desc file in %s" dir)))))
 
-(defun archive--process-simple-package (dir pkg vers desc req commentary)
+(defun archive--process-simple-package (dir pkg vers desc req)
   "Deploy the contents of DIR into the archive as a simple package.
-Rename DIR/PKG.el to PKG-VERS.el, delete DIR, and write the
-package commentary to PKG-readme.txt.  Return the descriptor."
-  ;; Write the readme file.
-  (with-temp-buffer
-    (erase-buffer)
-    (emacs-lisp-mode)
-    (insert (or commentary
-               (prog1 "No description"
-                 (message "Missing commentary in package %s" pkg))))
-    (goto-char (point-min))
-    (while (looking-at ";*[ \t]*\\(commentary[: \t]*\\)?\n")
-      (delete-region (match-beginning 0)
-                    (match-end 0)))
-    (uncomment-region (point-min) (point-max))
-    (goto-char (point-max))
-    (while (progn (forward-line -1)
-                 (looking-at "[ \t]*\n"))
-      (delete-region (match-beginning 0)
-                    (match-end 0)))
-    (write-region nil nil (concat pkg "-readme.txt")))
+Rename DIR/PKG.el to PKG-VERS.el, delete DIR, and return the descriptor."
   ;; Write DIR/foo.el to foo-VERS.el and delete DIR
   (rename-file (expand-file-name (concat pkg ".el") dir)
               (concat pkg "-" vers ".el"))
@@ -208,8 +212,8 @@ package commentary to PKG-readme.txt.  Return the 
descriptor."
   (delete-directory dir t)
   (cons (intern pkg) (vector (version-to-list vers) req desc 'single)))
 
-(defun archive--make-changelog (dir)
-  "Export Bzr log info of DIR into a ChangeLog file."
+(defun archive--make-changelog (dir srcdir)
+  "Export Git log info of DIR into a ChangeLog file."
   (message "Refreshing ChangeLog in %S" dir)
   (let ((default-directory (file-name-as-directory (expand-file-name dir))))
     (with-temp-buffer
@@ -219,27 +223,29 @@ package commentary to PKG-readme.txt.  Return the 
descriptor."
         (if (file-readable-p "ChangeLog") (insert-file-contents "ChangeLog"))
         (let ((old-md5 (md5 (current-buffer))))
           (erase-buffer)
-          ;; git --no-pager log --date=short --format="%cd  %aN  
<%ae>%n%n%w(80,8,8)%B%n" | sed 's/^        /\t/'
-          (call-process "bzr" nil (current-buffer) nil
-                        "log" "--gnu-changelog" ".")
+          (let ((default-directory
+                  (file-name-as-directory (expand-file-name dir srcdir))))
+            (call-process "git" nil (current-buffer) nil
+                          "log" "--date=short"
+                          "--format=%cd  %aN  <%ae>%n%n%w(80,8,8)%B%n"
+                          "."))
+          (tabify (point-min) (point-max))
+          (goto-char (point-min))
+          (while (re-search-forward "\n\n\n+" nil t)
+            (replace-match "\n\n"))
           (if (equal old-md5 (md5 (current-buffer)))
               (message "ChangeLog's md5 unchanged for %S" dir)
             (write-region (point-min) (point-max) "ChangeLog" nil 'quiet)))))))
 
 (defun archive--process-multi-file-package (dir pkg)
   "Deploy the contents of DIR into the archive as a multi-file package.
-Rename DIR/ to PKG-VERS/, and write the package commentary to
-PKG-readme.txt.  Return the descriptor."
+Rename DIR/ to PKG-VERS/, and return the descriptor."
   (let* ((exp (archive--multi-file-package-def dir pkg))
         (vers (nth 2 exp))
-        (req (mapcar 'archive--convert-require (nth 4 exp)))
-        (readme (expand-file-name "README" dir)))
+        (req (mapcar 'archive--convert-require (nth 4 exp))))
     (unless (equal (nth 1 exp) pkg)
       (error (format "Package name %s doesn't match file name %s"
                     (nth 1 exp) pkg)))
-    ;; Write the readme file.
-    (when (file-exists-p readme)
-      (copy-file readme (concat pkg "-readme.txt") 'ok-if-already-exists))
     (rename-file dir (concat pkg "-" vers))
     (cons (intern pkg) (vector (version-to-list vers) req (nth 3 exp) 'tar))))
 
@@ -253,39 +259,6 @@ PKG-readme.txt.  Return the descriptor."
       (goto-char (point-min))
       (read (current-buffer)))))
 
-(defun batch-make-site-dir (package-dir site-dir)
-  (require 'package)
-  (setq package-dir (expand-file-name package-dir default-directory))
-  (setq site-dir (expand-file-name site-dir default-directory))
-  (dolist (dir (directory-files package-dir t archive-re-no-dot))
-    (if (not (file-directory-p dir))
-        (message "Skipping non-package file %s" dir)
-      (let* ((pkg (file-name-nondirectory dir))
-             (autoloads-file (expand-file-name
-                              (concat pkg "-autoloads.el") dir))
-             simple-p version)
-        ;; Omit autoloads and .elc files from the package.
-        (if (file-exists-p autoloads-file)
-            (delete-file autoloads-file))
-        (archive--delete-elc-files dir 'only-orphans)
-        ;; Test whether this is a simple or multi-file package.
-        (setq simple-p (archive--simple-package-p dir pkg))
-        (if simple-p
-            (progn
-              (apply 'archive--write-pkg-file dir pkg simple-p)
-              (setq version (car simple-p)))
-          (setq version
-                (nth 2 (archive--multi-file-package-def dir pkg))))
-        (make-symbolic-link (expand-file-name dir package-dir)
-                            (expand-file-name (concat pkg "-" version)
-                                              site-dir)
-                            t)
-        (let ((make-backup-files nil))
-          (package-generate-autoloads pkg dir))
-        (let ((load-path (cons dir load-path)))
-          ;; FIXME: Don't compile the -pkg.el files!
-          (byte-recompile-directory dir 0))))))
-
 (defun archive--refresh-pkg-file ()
   (let* ((dir (directory-file-name default-directory))
          (pkg (file-name-nondirectory dir))
@@ -297,16 +270,6 @@ PKG-readme.txt.  Return the descriptor."
       ;; (message "Not refreshing pkg description of %s" pkg)
       )))
 
-(defun batch-make-site-package (sdir)
-  (let* ((dest (car (file-attributes sdir)))
-         (pkg (file-name-nondirectory (directory-file-name (or dest sdir))))
-         (dir (or dest sdir)))
-    (let ((make-backup-files nil))
-      (package-generate-autoloads pkg dir))
-    (let ((load-path (cons dir load-path)))
-      ;; FIXME: Don't compile the -pkg.el files!
-      (byte-recompile-directory dir 0))))
-
 (defun archive--write-pkg-file (pkg-dir name version desc requires &rest 
ignored)
   (let ((pkg-file (expand-file-name (concat name "-pkg.el") pkg-dir))
        (print-level nil)
@@ -341,7 +304,7 @@ PKG-readme.txt.  Return the descriptor."
   <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
 </head>
 <body>
-<h1 align=\"center\">%s</h1>"
+<h1 align=\"center\">%s</h1>\n"
           title title))
 
 (defun archive--html-bytes-format (bytes) ;Aka memory-usage-format.
@@ -399,8 +362,33 @@ PKG-readme.txt.  Return the descriptor."
           (buffer-string)))))))
 
 (defun archive--quote (txt)
-  (replace-regexp-in-string "<" "&lt"
-                            (replace-regexp-in-string "&" "&amp" txt)))
+  (replace-regexp-in-string "<" "&lt;"
+                            (replace-regexp-in-string "&" "&amp;" txt)))
+
+(defun archive--insert-repolinks (name srcdir mainsrcfile)
+  (let ((url (archive--get-prop "URL" name srcdir mainsrcfile)))
+    (if url
+        (insert (format "<p>Origin: <a href=%S>%s</a></p>\n"
+                        url (archive--quote url)))
+      (let* ((externals
+              (with-temp-buffer
+                (insert-file-contents
+                 (expand-file-name "../../../elpa/externals-list" srcdir))
+                (read (current-buffer))))
+             (external (eq :external (nth 1 (assoc name externals))))
+             (git-sv "http://git.savannah.gnu.org/";)
+             (urls (if external
+                       '("cgit/emacs/elpa.git/?h=externals/"
+                         
"gitweb/?p=emacs/elpa.git;a=shortlog;h=refs/heads/externals/")
+                     '("cgit/emacs/elpa.git/tree/packages/"
+                       "gitweb/?p=emacs/elpa.git;a=tree;f=packages/"))))
+        (insert (format
+                 (concat "<p>Browse repository: <a href=%S>%s</a>"
+                         " or <a href=%S>%s</a></p>\n")
+                 (concat git-sv (nth 0 urls) name)
+                 'CGit
+                 (concat git-sv (nth 1 urls) name)
+                 'Gitweb))))))
 
 (defun archive--html-make-pkg (pkg files)
   (let* ((name (symbol-name (car pkg)))
@@ -420,16 +408,10 @@ PKG-readme.txt.  Return the descriptor."
       (let ((maint (archive--get-prop "Maintainer" name srcdir mainsrcfile)))
         (when maint
           (insert (format "<p>Maintainer: %s</p>\n" (archive--quote maint)))))
-      (let* ((urlkind "Origin")
-             (url
-              (or (archive--get-prop "URL" name srcdir mainsrcfile)
-                  (progn
-                    (setq urlkind "Repository")
-                    (concat 
"http://bzr.sv.gnu.org/lh/emacs/elpa/files/head:/packages/"; name)))))
-        (insert (format "<p>%s: <a href=%S>%s</a></p>"
-                        urlkind url (archive--quote url))))
+      (archive--insert-repolinks name srcdir mainsrcfile)
       (let ((readme (archive--get-section "Commentary" "README" srcdir 
mainsrcfile)))
         (when readme
+          (write-region readme nil (concat name "-readme.txt"))
           (insert "<h2>Full description</h2><pre>\n" (archive--quote readme)
                   "\n</pre>\n")))
       (unless (< (length files) 2)
@@ -489,7 +471,7 @@ PKG-readme.txt.  Return the descriptor."
 
 ;;; Maintain external packages.
 
-(defun archive-add/remove-externals ()
+(defun archive-add/remove/update-externals ()
   (let ((exts (with-current-buffer (find-file-noselect "externals-list")
                 (goto-char (point-min))
                 (read (current-buffer)))))
@@ -510,8 +492,11 @@ PKG-readme.txt.  Return the descriptor."
                 (progn (delete-directory dir 'recursive t)
                        (message "Deleted all of %s" dir))
               (message "Keeping leftover unclean %s:\n%s" dir status))))))
-      (pcase-dolist (`(,dir ,kind ,url) exts)
+      (pcase-dolist (`(,dir ,kind ,_url) exts)
         (cond
+         ((eq kind :subtree) nil)       ;Nothing to do.
+         ((not (eq kind :external))
+          (message "Unknown external package kind `%S' for %s" kind dir))
          ((not (file-exists-p dir))
           (let* ((branch (concat "externals/" dir))
                  (output
@@ -521,17 +506,22 @@ PKG-readme.txt.  Return the descriptor."
                                   branch (concat "origin/" branch))
                     (call-process "git" nil t nil "clone"
                                   "--shared" "--branch" branch "../" dir)
-                    ;; (let ((default-directory (file-name-as-directory
-                    ;;                           (expand-file-name dir))))
-                    ;;   (call-process "git" nil t nil "branch"
-                    ;;                 "-m" branch "master"))
+                    (let ((default-directory (file-name-as-directory
+                                              (expand-file-name dir))))
+                      ;; (call-process "git" nil t nil "branch"
+                      ;;               "-m" branch "master")
+                      (call-process "git" nil t nil "remote"
+                                    "set-url" "--push" "origin"
+                                    
"git+ssh://git.sv.gnu.org/srv/git/emacs/elpa.git"))
                     (buffer-string))))
             (message "Cloning branch %s:\n%s" dir output)))
          ((not (file-directory-p (concat dir "/.git")))
           (message "%s is in the way of an external, please remove!" dir))
          (t
-          (let ((default-directory (expand-file-name dir)))
+          (let ((default-directory (file-name-as-directory
+                                    (expand-file-name dir))))
             (with-temp-buffer
+              (message "Running git pull in %S" default-directory)
               (call-process "git" nil t nil "pull")
               (message "Updated %s:%s" dir (buffer-string))))
           ))))))
diff --git a/admin/package-update.sh b/admin/package-update.sh
deleted file mode 100755
index 0e8a39e..0000000
--- a/admin/package-update.sh
+++ /dev/null
@@ -1,126 +0,0 @@
-#/bin/bash
-## package-update.sh -- Create a package archive from the elpa repository
-
-## Usage: ./package-update.sh DEST [FULL-UPDATE]
-##
-## This creates a package archive beginning in DEST.
-##
-## The package archive itself is created in DEST/packages.  This dir
-## contains the package files.
-##
-## If a second argument FULL-UPDATE is specified (whatever its value),
-## also create the following:
-##   - the archive admin scripts in DEST/admin
-##   - a tarball containing the entire archive in
-##     DEST/packages/emacs-packages-latest.tgz
-##   - the Org mode daily package
-
-PATH="/bin:/usr/bin:/usr/local/bin:${PATH}"
-## Remove any trailing slash from DEST
-DEST=${1%/}
-FULL=$2
-
-EMACS=emacs
-BZR=bzr
-TAR=tar
-REPO_PACKAGES=packages
-
-## Parse arguments
-if [ -z $DEST ]; then
-    echo "Syntax: $0 DEST [fetch-extras-boolean]"
-    exit 1
-elif [ -d $DEST ]; then
-    cd $DEST
-    DEST_FULL=$(pwd)
-    PKGROOT=$DEST_FULL/packages
-    TMP_PKGROOT=$DEST_FULL/packages-new
-    echo "Installing into '$DEST_FULL'"
-    if [ -z $FULL ]; then
-       echo "Base archive update only (pass second arg for full update)."
-    else
-       echo "Performing full archive update."
-       TARBALL=$PKGROOT/emacs-packages-latest.tgz
-       TARBALL_ROOT="emacs-24.1-packages-`/bin/date +'%F'`"
-       ADMINROOT=$DEST_FULL/admin
-       REPO_ADMIN=admin
-    fi
-else
-    echo "Sorry but $DEST is not a directory, aborting."
-    exit 1
-fi
-
-## Change to the bzr root directory
-REPO_ROOT_DIR=`$BZR root`;
-if [ -z $REPO_ROOT_DIR ]; then
-    "This script should be run from a bzr repository, aborting."
-    exit 1
-else
-    cd $REPO_ROOT_DIR;
-fi
-
-## Create the working directory that will be the world-facing copy of
-## the package archive base.
-echo "Exporting packages to temporary working directory $TMP_PKGROOT"
-rm -rf $TMP_PKGROOT
-$BZR export $TMP_PKGROOT $REPO_PACKAGES
-
-## If second arg is provided, copy in the admin directory.
-if [ -z $FULL ]; then
-    echo "Skipping admin directory"
-else
-    echo "Exporting admin scripts to $ADMINROOT"
-    rm -rf $ADMINROOT
-    $BZR export $ADMINROOT $REPO_ADMIN
-fi
-
-
-cd $TMP_PKGROOT
-
-
-## If second arg is provided, grab the Org daily
-if [ -z $FULL ]; then
-    echo "Not fetching Org daily from orgmode.org"
-else
-    echo "Fetching Org daily from orgmode.org"
-    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"}'`
-    wget -q http://orgmode.org/elpa/${pkgname}.tar -O ${pkgname}.tar
-    if [ -f ${pkgname}.tar ]; then
-       tar xf ${pkgname}.tar
-       rm -f ${pkgname}.tar
-       mv ${pkgname} org
-    fi
-fi
-
-## Call `batch-make-archive' to generate archive-contents, the readme
-## files, etc.
-$EMACS -batch -l $REPO_ROOT_DIR/admin/archive-contents.el -f batch-make-archive
-
-## Tar up the multi-file packages.
-echo "Creating multi-file package tarballs in $TMP_PKGROOT"
-for pt in *; do
-    if [ -d $pt ]; then
-       echo "Creating tarball $TMP_PKGROOT/$pt.tar"
-       tar -cf $pt.tar $pt --remove-files
-    fi
-done
-
-## Move the working directory to its final location
-cd ..
-rm -rf $PKGROOT-old
-if [ -d $PKGROOT ]; then
-    mv $PKGROOT $PKGROOT-old
-fi
-mv $TMP_PKGROOT $PKGROOT
-rm -rf $PKGROOT-old
-
-## If doing a full update, make a tarball of the entire archive.
-if [ -z $FULL ]; then
-    echo "Skipping archive tarball"
-else
-    echo "Exporting packages into $TARBALL (root = $TARBALL_ROOT)"
-    cd $REPO_ROOT_DIR
-    $BZR export --format=tgz --root=$TARBALL_ROOT $TARBALL $REPO_PACKAGES
-fi
-
-chmod -R a+rX $PKGROOT
-echo "Update complete at" `/bin/date`
diff --git a/admin/update-archive.sh b/admin/update-archive.sh
index 9a37eda..662d8db 100755
--- a/admin/update-archive.sh
+++ b/admin/update-archive.sh
@@ -48,7 +48,7 @@ ENDDOC
 
 check_copyright () {
     base="copyright_exceptions"
-    (cd packages; copyright_notices) >"$base.new"
+    (cd $1/packages; copyright_notices) >"$base.new"
     if [ -r "$base.old" ] &&
        ! diff "$base.old" "$base.new" >/dev/null;
     then
@@ -60,22 +60,26 @@ check_copyright () {
     fi
 }
 
-cd ~elpa/build
+#cd ~elpa/build
 
-(cd ~elpa/elpa;
+(cd ../elpa;
 
  # Fetch changes.
  git pull || signal_error "git pull failed";
 
- # Refresh the ChangeLog files.  This needs to be done in
- # the source tree, because it needs the Bzr data!
- (cd packages;
-  emacs -batch -l ../admin/archive-contents.el -f batch-prepare-packages);
+ # Setup and update externals.
+ make externals
+ )
 
- emacs --batch -l admin/archive-contents.el -f archive-add/remove-externals;
+#check_copyright ../elpa
+
+rsync -av --delete --exclude=ChangeLog --exclude=.git ../elpa/packages ./
+
+# Refresh the ChangeLog files.  This needs to be done in
+# the source tree, because it needs the VCS data!
+emacs -batch -l admin/archive-contents.el \
+      -eval '(archive-prepare-packages "../elpa")'
 
- check_copyright
- )
 
 rm -rf archive                  # In case there's one left over!
 make archive-full >make.log 2>&1 || {
@@ -85,7 +89,8 @@ make archive-full >make.log 2>&1 || {
 latest="emacs-packages-latest.tgz"
 (cd archive
  tar zcf "$latest" packages)
-(cd ~elpa
+(cd ../
+ mkdir -p staging/packages
  # Not sure why we have `staging-old', but let's keep it for now.
  rm -rf staging-old
  cp -a staging staging-old
@@ -109,9 +114,6 @@ latest="emacs-packages-latest.tgz"
  rm -rf build/archive)
 
 # Make the HTML files.
-(cd ~elpa/staging/packages
- emacs --batch -l ~elpa/build/admin/archive-contents.el \
+(cd ../staging/packages
+ emacs --batch -l ../../build/admin/archive-contents.el \
        --eval '(batch-html-make-index)')
-
-# "make archive-full" already does fetch the daily org build.
-#admin/org-synch.sh ~elpa/staging/packages ~elpa/build/admin

-----------------------------------------------------------------------

Summary of changes:
 GNUmakefile               |   58 ++++++++---
 admin/archive-contents.el |  232 +++++++++++++++++++++-----------------------
 admin/package-update.sh   |  126 ------------------------
 admin/update-archive.sh   |   90 +++++++-----------
 copyright_exceptions      |   49 ++++++++++
 5 files changed, 236 insertions(+), 319 deletions(-)
 delete mode 100755 admin/package-update.sh
 create mode 100644 copyright_exceptions


hooks/post-receive
-- 
ELPA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]