User: adrian
Date: 05/10/28 00:44:33
Added: xemacs-builds/adrian/website package-get-2-download-sites.el
Log:
Change function and variable name prefixes to package-get-2-download.
Add package-get-2-download-sites-file.
Revision Changes Path
1.1
XEmacs/xemacs-builds/adrian/website/package-get-2-download-sites.el
Index: package-get-2-download-sites.el
===================================================================
; Adrian Aichner <adrian(a)xemacs.org>, The XEmacs Project, 2005-10-22.
; Hopefully someday this code will allow me to quickly sync
; information between
; xemacs/lisp/package-get.el
; and
; xemacsweb/Releases/index.content
; TODO:
; Handle sites with missing beta directories (use xemacs-21.5 instead).
; Substitution rule can take care of this.
; DONE: 2005-10-23
; xemacsweb/Download/index.content
;-> Feature link to Releases/index.content more prominently!
; DONE: 2005-10-22
; xemacsweb/Documentation/packageGuide.content
;-> LINK to package info instead!
; DONE: 2005-10-22
; xemacsweb/Install/index.content
;-> LINK to package info instead!
; 2005-10-23
; HTTP Exceptions (only ftp available!):
(defconst package-get-2-download-sites-ftp-only-regexp
(regexp-opt
'("ftp.br.xemacs.org"
"ftp.crc.ca"
"ftp.cz.xemacs.org"
"ftp.jp.xemacs.org"
"ftp.nrc.ca"
"ftp.nz.xemacs.org"
"ftp.pasteur.fr"
"ftp.pt.xemacs.org"
"ftp.ru.xemacs.org"
"ftp.stealth.net"
"ftp.sunsite.utk.edu"
"mirror.cict.fr"
"xemacs.xmundo.net")
'words))
(defconst package-get-2-download-sites-output-directory
"c:\\Hacking\\cvs.xemacs.org\\XEmacs\\xemacsweb\\Releases"
"Put output files of `package-get-2-download-sites' in this
directory.")
; Missing from package-get.el:
;
ftp://ftp.planetmirror.com/pub/xemacs/beta/experimental/packages/
; ** Ping ** ping **
ftp.au.xemacs.org
; Pinging
www.planetmirror.com [203.16.234.20] with 32 bytes of data:
; ** Ping ** ping **
ftp.planetmirror.com
; Pinging
ftp.planetmirror.com [203.16.234.86] with 32 bytes of data:
; 2005-10-23
; /beta/experimental/packages Exceptions (only /xemacs-21.5/experimental/packages
available!):
;
ftp://ftp.br.xemacs.org/pub/xemacs/xemacs-21.5/experimental/packages
;
ftp://ftp.cz.xemacs.org/MIRRORS/ftp.xemacs.org/pub/xemacs/xemacs-21.5/exp...
;
http://sunsite.sut.ac.jp/pub/archives/packages/xemacs/xemacs-21.5/experim...
; HTTP path exceptions (see xemacsweb\Download\index.content):
(defun package-get-2-download-sites-map-ftp-to-http (host path)
(cond
((string-match
(regexp-opt
'("ftp.be.xemacs.org"
"ftp.ch.xemacs.org"
"ftp.us.xemacs.org")
'words) host)
(concat "ftp/" path))
((string-match "ftp.it.xemacs.org" host)
(substring path (length "unix/packages/XEMACS/")))
(t
path)))
(defun package-get-2-download-sites-file (file site-list)
(with-temp-file
(expand-file-name file package-get-2-download-sites-output-directory)
(insert
(package-get-2-download-sites-generated-by-string))
(insert " <ul>\n")
(mapc
(lambda (e)
(if (string-match
package-get-2-download-sites-ftp-only-regexp
(second e))
(insert
(format " <li><a
href=\"ftp://%s/%s\">%s</a></li>\n"
(second e) (third e) (first e)))
(insert
(format " <li><a
href=\"http://%s/%s\">%s</a></li>\n"
(second e)
(package-get-2-download-sites-map-ftp-to-http (second e) (third e))
(first e)))))
site-list)
(insert " </ul>\n")))
(defun package-get-2-download-sites-pre-release ()
package-get-pre-release-download-sites)
(defun package-get-2-download-sites-beta ()
(mapcar
(lambda (e)
(list (replace-in-string (first e) " Pre-Releases" "")
(second e)
(replace-in-string (third e) "/experimental/packages$"
"")))
package-get-pre-release-download-sites))
(defun package-get-2-download-sites-packages ()
package-get-download-sites)
(defun package-get-2-download-sites-stable ()
(mapcar
(lambda (e)
(list (replace-in-string (first e) " Pre-Releases" "")
(second e)
(replace-in-string (third e) "/packages$" "/stable")))
package-get-download-sites))
; package-get-2-download-sites-gamma
(defun package-get-2-download-sites ()
"Generate files in `' based on current values of
`package-get-download-sites' and
`package-get-pre-release-download-sites'."
(package-get-2-download-sites-file "core-beta.txt"
(package-get-2-download-sites-beta))
(package-get-2-download-sites-file "packages-pre-release.txt"
(package-get-2-download-sites-pre-release))
(package-get-2-download-sites-file "packages-official.txt"
(package-get-2-download-sites-packages))
(package-get-2-download-sites-file "core-stable.txt"
(package-get-2-download-sites-stable)))
(defun package-get-2-download-sites-generated-by-string ()
(format
" <!-- Generated by %s\n at %s %+.4d (%s) -->\n"
emacs-version
(current-time-string)
(/
(nth 0
(current-time-zone))
36)
(nth 1
(current-time-zone))))