]> code.delx.au - gnu-emacs-elpa/blob - admin/org-synch.el
* admin/org-synch.el (org-synch): Use just the current directory
[gnu-emacs-elpa] / admin / org-synch.el
1 (defun org-synch ()
2 (let* ((date (shell-command-to-string "/bin/date '+%Y%m%d'")) ; TODO: should use the Emacs built-ins
3 (archive-file "archive-contents")
4 (package-name 'org)
5 package-file contents entry)
6 (setq date (substring date 0 (- (length date) 1))
7 package-file (concat (symbol-name package-name) "-" date ".tar"))
8 (unless (file-exists-p package-file)
9 (error "No package file found"))
10 (unless (file-exists-p archive-file)
11 (error "No archive file found"))
12 (find-file archive-file)
13 (setq contents (read (current-buffer))
14 entry (assq package-name contents))
15 (unless entry
16 (error "No entry for %s in archive-contents" package-name))
17 (aset (cdr entry) 0 (version-to-list date))
18 (erase-buffer)
19 (insert (pp-to-string contents) "\n")
20 (save-buffer 0)))