If the last update to a package was at midnight, ensure the HHMM part of version is "0", not ""

See purcell/emacs.d#47
This commit is contained in:
Steve Purcell 2012-09-06 14:23:41 +01:00
parent 20fdd5e145
commit 9ddf14d643

View file

@ -72,12 +72,9 @@
(message (format "%s\n" (substring-no-properties str)))
;; We remove zero-padding the HH portion, as it is lost
;; when stored in the archive-contents
(replace-regexp-in-string "\\.0+"
"."
(format-time-string
"%Y%m%d.%H%M"
(date-to-time
(substring-no-properties str)))))
(let ((time (date-to-time (substring-no-properties str))))
(concat (format-time-string "%Y%m%d." time)
(format "%d" (or (parse-integer (format-time-string "%H%M" time)) 0)))))
(defun pb/string-match-all (regex str &optional group)
"Find every match for `REGEX' within `STR', returning the full match string or group `GROUP'."