[Reproducible-builds] [RFC] debbindiff

Hans-Christoph Steiner hans at guardianproject.info
Tue Sep 30 16:03:27 UTC 2014


Comparing jars gives a stacktrace, looks like a missing import.

$ ./debbindiff.py
~/code/guardianproject/cacheword/cachewordlib/cachewordlib-v0.1-1-g04cb18e.jar
/tmp/cachewordlib-v0.1-1-g04cb18e.jar
Traceback (most recent call last):
  File "./debbindiff.py", line 53, in <module>
    main()
  File "./debbindiff.py", line 43, in main
    differences = debbindiff.comparators.compare_files(parsed_args.file1,
parsed_args.file2)
  File
"/media/share/code/reproducible/debbindiff/debbindiff/comparators/__init__.py", line
85, in compare_files
    return comparator(path1, path2, source)
  File
"/media/share/code/reproducible/debbindiff/debbindiff/comparators/utils.py",
line 51, in with_fallback
    inside_differences = original_function(path1, path2, source)
  File
"/media/share/code/reproducible/debbindiff/debbindiff/comparators/zip.py",
line 57, in compare_zip_files
    zipinfo1 = get_zipinfo(path1)
  File
"/media/share/code/reproducible/debbindiff/debbindiff/comparators/zip.py",
line 31, in get_zipinfo
    return re.sub(re.escape(path), os.path.basename(path), output)
NameError: global name 're' is not defined


Also, I updated the setup.py for two small things. I recommend using code
checkers like pyflakes and pylint:

$ pyflakes *.py debbindiff/*.py
debbindiff/difference.py:20: 'difflib' imported but unused
debbindiff/difference.py:41: redefinition of function 'comment' from line 37
hans at palatschinken debbindiff $ pylint *.py debbindiff/*.py
...


.hc

Hans-Christoph Steiner wrote:
> 
> Definitely use setup.py.  It makes the packaging easy and standardized, and it
> is the standard way to build python.  It also makes it easy to publish
> releases to pypi, the central package repository for python.  I attached a
> quick untested one for you.
> 
> .hc
> 
> Jérémy Bobbio wrote:
>> Hi!
>>
>> I've been working at high pace since Sunday on a replacement for the
>> diffp script [1]. These GPLv3 lines of Python are called debbindiff.
>>
>> Get it from Git:
>>
>>     https://anonscm.debian.org/cgit/reproducible/debbindiff.git/
>>
>> Attached is an output produced for the attr package. The new tool is at
>> least as capable as diffp, is way more extensible, and the result is
>> more readable.
>>
>> Example usage:
>>
>>     $ ./debbindiff.py --html /tmp/debbindiff.html b1/*.changes b2/*.changes
>>
>> There's no requirements for actually comparing .changes. You can use it
>> to compare jar files directly if that's your kick.
>>
>> I'd love to see reviews of the code. It's scarce on comments but names
>> should be explicit enough, or so I hope.
>>
>> It's missing Debian packaging. I guess I should learn how to write a
>> setup.cfg or similar. Pointers or patches welcome.
>>
>> One thing this codebase should enable is writing “hints”. Once the tree
>> of differences is generated, it should be doable to run through it to
>> generate statements like: “Many files in data.tar have different
>> timestamps, dh_fixmtimes has probably not been called. Are you
>> using dh?” This still needs to be done though.
>>
>> Last note: I've been pushing everything else aside while I had the
>> thrills to work on this. It's unclear when will be the next time, so
>> patches are preferred rather than suggestion.
>>
>>  [1]: https://anonscm.debian.org/cgit/reproducible/misc.git/tree/diffp
>>
>>
>>
>> _______________________________________________
>> Reproducible-builds mailing list
>> Reproducible-builds at lists.alioth.debian.org
>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds
>>
> 

-- 
PGP fingerprint: 5E61 C878 0F86 295C E17D  8677 9F0F E587 374B BE81
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup.py
Type: text/x-python
Size: 737 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20140930/7ea5d4db/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20140930/7ea5d4db/attachment.sig>


More information about the Reproducible-builds mailing list