[Reproducible-commits] [rdfind] 01/01: Added patch to produce deterministic output
Reiner Herrmann
reiner at reiner-h.de
Sun Aug 16 19:57:42 UTC 2015
This is an automated email from the git hooks/post-receive script.
deki-guest pushed a commit to branch pu/reproducible_builds
in repository rdfind.
commit af6f3cac2b1835f01f395ddbb251c8ca89df4e8e
Author: Reiner Herrmann <reiner at reiner-h.de>
Date: Sun Aug 16 21:59:12 2015 +0200
Added patch to produce deterministic output
---
debian/changelog | 7 ++++++
debian/patches/reproducible_build.patch | 41 +++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 49 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 873b321..7bbfd37 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+rdfind (1.3.4-2.0~reproducible1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Added patch to sort files before doing any operation.
+
+ -- Reiner Herrmann <reiner at reiner-h.de> Sun, 16 Aug 2015 19:00:44 +0200
+
rdfind (1.3.4-1) unstable; urgency=low
* Imported Upstream version 1.3.4
diff --git a/debian/patches/reproducible_build.patch b/debian/patches/reproducible_build.patch
new file mode 100644
index 0000000..8871120
--- /dev/null
+++ b/debian/patches/reproducible_build.patch
@@ -0,0 +1,41 @@
+Author: Reiner Herrmann <reiner at reiner-h.de>
+Description: sort the filelist when it is complete to get reproducible behaviour
+
+Index: rdfind-1.3.4/Fileinfo.hh
+===================================================================
+--- rdfind-1.3.4.orig/Fileinfo.hh
++++ rdfind-1.3.4/Fileinfo.hh
+@@ -189,6 +189,10 @@ public:
+ static bool compareondepth(const Fileinfo &a, const Fileinfo &b)
+ {return (a.depth() < b.depth());}
+
++ //returns true if a has lower filename than b)
++ static bool compareonfilename(const Fileinfo &a, const Fileinfo &b)
++ {return (a.name().compare(b.name()) < 0);}
++
+ //fills with bytes from the file. if lasttype is supplied,
+ //it is used to see if the file needs to be read again - useful if
+ //file is shorter than the length of the bytes field.
+@@ -235,6 +239,10 @@ public:
+ static bool equaldepth(const Fileinfo &a, const Fileinfo &b)
+ {return (a.depth()==b.depth());}
+
++ //returns true if filenames are equal
++ static bool equalfilename(const Fileinfo &a, const Fileinfo &b)
++ {return (a.name()==b.name());}
++
+ //returns true if file is a regular file. call readfileinfo first!
+ bool isRegularFile() {return m_info.is_file;}
+
+Index: rdfind-1.3.4/rdfind.cc
+===================================================================
+--- rdfind-1.3.4.orig/rdfind.cc
++++ rdfind-1.3.4/rdfind.cc
+@@ -349,6 +349,7 @@ int main(int narg, char *argv[])
+ cout<<dryruntext<<"Now have "<<filelist1.size()<<" files in total."<<endl;
+
+
++ gswd.sortlist(&Fileinfo::compareonfilename,&Fileinfo::equalfilename);
+
+ //mark files with a unique number
+ gswd.markitems();
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..b2026fe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+reproducible_build.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/rdfind.git
More information about the Reproducible-commits
mailing list