reproducible_build.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Description: sort the filelist when it is complete to get reproducible behaviour
  2. Author: Reiner Herrmann <reiner@reiner-h.de>
  3. Bug-Debian: https://bugs.debian.org/795790
  4. Upstream-Status: Pending
  5. Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
  6. Index: rdfind-1.3.4/Fileinfo.hh
  7. ===================================================================
  8. --- rdfind-1.3.4.orig/Fileinfo.hh
  9. +++ rdfind-1.3.4/Fileinfo.hh
  10. @@ -189,6 +189,10 @@ public:
  11. static bool compareondepth(const Fileinfo &a, const Fileinfo &b)
  12. {return (a.depth() < b.depth());}
  13. + //returns true if a has lower filename than b)
  14. + static bool compareonfilename(const Fileinfo &a, const Fileinfo &b)
  15. + {return (a.name().compare(b.name()) < 0);}
  16. +
  17. //fills with bytes from the file. if lasttype is supplied,
  18. //it is used to see if the file needs to be read again - useful if
  19. //file is shorter than the length of the bytes field.
  20. @@ -235,6 +239,10 @@ public:
  21. static bool equaldepth(const Fileinfo &a, const Fileinfo &b)
  22. {return (a.depth()==b.depth());}
  23. + //returns true if filenames are equal
  24. + static bool equalfilename(const Fileinfo &a, const Fileinfo &b)
  25. + {return (a.name()==b.name());}
  26. +
  27. //returns true if file is a regular file. call readfileinfo first!
  28. bool isRegularFile() {return m_info.is_file;}
  29. Index: rdfind-1.3.4/rdfind.cc
  30. ===================================================================
  31. --- rdfind-1.3.4.orig/rdfind.cc
  32. +++ rdfind-1.3.4/rdfind.cc
  33. @@ -349,6 +349,7 @@ int main(int narg, char *argv[])
  34. cout<<dryruntext<<"Now have "<<filelist1.size()<<" files in total."<<endl;
  35. + gswd.sortlist(&Fileinfo::compareonfilename,&Fileinfo::equalfilename);
  36. //mark files with a unique number
  37. gswd.markitems();