]> granicus.if.org Git - neomutt/commitdiff
auto.def: Simplify PACKAGE_VERSION fallback case
authorFloyd Anderson <f.a@31c0.net>
Mon, 26 Mar 2018 18:14:41 +0000 (20:14 +0200)
committerRichard Russon <rich@flatcap.org>
Wed, 25 Apr 2018 02:02:17 +0000 (03:02 +0100)
get-author-date() procedure:

Assuming definition of PACKAGE_VERSION and its format never change,
allows a code simplification for parsing the value as date.

auto.def

index e8641e9db4b30e8569b6ba3d6553f0312673077e..998e7b96e2c279ba78ebb11edd66a3b99e9b99f1 100644 (file)
--- a/auto.def
+++ b/auto.def
@@ -188,16 +188,11 @@ if {1} {
         gets $fd epoch
         close $fd}] || $epoch eq ""
     } {
-      #user-notice "No author timestamp found, falling back to PACKAGE_VERSION..."
-      if {[catch {clock scan [get-define PACKAGE_VERSION] \
-                  -format {%Y%m%d} -timezone :UTC} epoch]
-      } {
-        autosetup-error "Cannot get or parse PACKAGE_VERSION as date!"
-      }
+      set epoch [clock scan \
+                   [get-define PACKAGE_VERSION] -format {%Y%m%d} -timezone :UTC]
     }
     cd $oldpwd
 
-
     return [clock format $epoch -format $format -timezone :UTC]
   }
 }