1 (defun org-synch (package-file)
2 (let* ((archive-file "archive-contents")
4 (date (substring package-file
4 12))
5 (date-int (string-to-number date
))
7 (unless (and (integerp date-int
)
10 (error "Package date is bad"))
11 (unless (file-exists-p package-file
)
12 (error "No package file found"))
13 (when (file-exists-p archive-file
)
14 (find-file archive-file
)
15 (setq contents
(read (current-buffer))
16 entry
(assq package-name contents
))
18 (error "No entry for %s in archive-contents" package-name
))
19 (aset (cdr entry
) 0 (version-to-list date
))
21 (insert (pp-to-string contents
) "\n")