Bug#861443: ora2pg: please make the build reproducible

Chris Lamb lamby at debian.org
Sat Apr 29 08:08:22 UTC 2017


Source: ora2pg
Version: 18.0-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that ora2pg could not be built reproducibly.

This is because it encodes the build process's current PID in the
default configuration file.


Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/03_reproducible_build.diff	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/03_reproducible_build.diff	2017-04-29 09:06:38.343116627 +0100
@@ -0,0 +1,57 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2017-04-29
+
+--- ora2pg-18.0.orig/Makefile.PL
++++ ora2pg-18.0/Makefile.PL
+@@ -51,6 +51,8 @@ if ($^O !~ /MSWin32|dos/i) {
+ 
+ my $oracle_home = $ENV{ORACLE_HOME} || '/usr/local/oracle/10g';
+ 
++my $T = $ENV{SOURCE_DATE_EPOCH} || $$;
++
+ # Setup ok. generating default ora2pg.conf config file
+ unless(open(OUTCFG, ">$DEST_CONF_FILE")) {
+ 	print "\nError: can't write config file $DEST_CONF_FILE, $!\n";
+@@ -288,7 +290,7 @@ CONTEXT_AS_TRGM		0
+ # To automatically update the column when a modification in the title column
+ # appears, Ora2Pg adds the following trigger:
+ #
+-# CREATE FUNCTION tsv_t_document_title() RETURNS trigger AS $$
++# CREATE FUNCTION tsv_t_document_title() RETURNS trigger AS $T
+ # BEGIN
+ #        IF TG_OP = 'INSERT' OR new.title != old.title THEN
+ #                new.tsv_title :=
+@@ -296,7 +298,7 @@ CONTEXT_AS_TRGM		0
+ #        END IF;
+ #        return new;
+ # END
+-# $$ LANGUAGE plpgsql;
++# $T LANGUAGE plpgsql;
+ # CREATE TRIGGER trig_tsv_t_document_title BEFORE INSERT OR UPDATE
+ #  ON t_document
+ #  FOR EACH ROW EXECUTE PROCEDURE tsv_t_document_title();
+@@ -325,9 +327,9 @@ FTS_INDEX_ONLY	1
+ #
+ #	CREATE OR REPLACE FUNCTION unaccent_immutable(text)
+ #	RETURNS text AS
+-#	$$
++#	$T
+ #		SELECT public.unaccent('public.unaccent', $1)
+-#	$$  LANGUAGE sql IMMUTABLE
++#	$T  LANGUAGE sql IMMUTABLE
+ #	    COST 1;
+ #
+ # indexes are exported as follow:
+@@ -347,9 +349,9 @@ USE_UNACCENT		0
+ #
+ #      CREATE OR REPLACE FUNCTION unaccent_immutable(text)
+ #      RETURNS text AS
+-#      $$
++#      $T
+ #          SELECT lower(public.unaccent('public.unaccent', $1));
+-#      $$ LANGUAGE sql IMMUTABLE;
++#      $T LANGUAGE sql IMMUTABLE;
+ #
+ USE_LOWER_UNACCENT	0
+ 
--- a/debian/patches/series	2017-04-29 09:03:13.670357628 +0100
--- b/debian/patches/series	2017-04-29 09:04:46.710702421 +0100
@@ -1,2 +1,3 @@
 01_Ora2Pg.pod.diff
 02_remove_unnecessary_files.diff
+03_reproducible_build.diff


More information about the Reproducible-bugs mailing list