]> code.delx.au - gnu-emacs-elpa/blobdiff - admin/org-synch.el
* admin/package-update.sh: Disable org-mode fetch by default. Add
[gnu-emacs-elpa] / admin / org-synch.el
index b3fb70a20248b7ca93607d0e0adf694d1bc0525b..2d9782a0c8bab4483dadcf7936e5f7868ce5e89b 100644 (file)
@@ -1,10 +1,13 @@
-(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)