2 (let* ((date (shell-command-to-string "/bin/date '+%Y%m%d'")) ; TODO: should use the Emacs built-ins
3 (archive-file "archive-contents")
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))
16 (error "No entry for %s in archive-contents" package-name))
17 (aset (cdr entry) 0 (version-to-list date))
19 (insert (pp-to-string contents) "\n")