Source: osc
Version: 0.154.0-2
Severity: wishlist
Tags: patch upstream
Usertags: timestamps

Dear Maintainer,

While working on the `€œreproducible builds'€ effort [1], we have noticed
that 'osc' could not be built reproducibly.

The attached patch honours the SOURCE_DATE_EPOCH environment
variable [2] to get a reproducible man page date from the last
debian changelog entry.
Once applied, osc can be built reproducibly in our current
experimental framework.

Alexis Bienvenüe.


Description: Reproducible man page date
 Set the man page date from the environment variable SOURCE_DATE_EPOCH
 (if set), to make the build reproducible.
Author: Alexis Bienvenüe <>

--- osc-0.154.0.orig/osc/
+++ osc-0.154.0/osc/
@@ -45,8 +45,8 @@ import re
 import cmd
 import optparse
 import sys
+import time
 from pprint import pprint
-from datetime import date
 # this is python 2.x style
 def introspect_handler_2(handler):
@@ -619,9 +619,13 @@ class RawCmdln(cmd.Cmd):
             ${name} man
+        if os.getenv("SOURCE_DATE_EPOCH"):
+            srcdate = time.gmtime(int(os.getenv("SOURCE_DATE_EPOCH")))
+        else:
+            srcdate = time.localtime()
             self.man_header % {
-                'date':'%b %Y'),
+                'date': time.strftime('%b %Y',srcdate),
                 'version': self.get_version(),
Reproducible-builds mailing list

Reply via email to