-(defun org-synch ()
- (let* ((date (shell-command-to-string "/bin/date '+%Y%m%d'")) ; TODO: should use the Emacs built-ins
- (archive-file "archive-contents")
+(defun org-synch (package-file)
+ (let* ((archive-file "archive-contents")
(package-name 'org)
- package-file contents entry)
- (setq date (substring date 0 (- (length date) 1))
- package-file (concat (symbol-name package-name) "-" date ".tar"))
+ (date (substring package-file 4 12))
+ (date-int (string-to-number date))
+ contents entry)
+ (unless (and (integerp date-int)
+ (> date-int 20100000)
+ (< date-int 21000000))
+ (error "Package date is bad"))
(unless (file-exists-p package-file)
(error "No package file found"))
(unless (file-exists-p archive-file)