From 84f54dd5fe9dd1a5cce2314c9cc5447ca919cdcd Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 1 Sep 2012 15:37:26 +0100 Subject: [PATCH] Ensure no zero-padding is used in the HHMM portion of version strings --- package-build.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/package-build.el b/package-build.el index b843533a..601ba5e3 100644 --- a/package-build.el +++ b/package-build.el @@ -68,12 +68,16 @@ ;;; Internal functions (defun pb/parse-time (str) - "Parse STR as a time, and format as a YYYYMMDD string." + "Parse STR as a time, and format as a YYYYMMDD.HHMM string." (message (format "%s\n" (substring-no-properties str))) - (format-time-string - "%Y%m%d.%H%M" - (date-to-time - (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))))) (defun pb/string-match-all (regex str &optional group) "Find every match for `REGEX' within `STR', returning the full match string or group `GROUP'."