Source: tkabber-plugins
Version: 1.1.2+20170328-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: filesystem
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0] I noticed that
tkabber-plugins could not be built reproducibly.

This is because the upstream tarball contains the following files:

  ./attline/readme
  ./checkers/readme
  ./ctcomp/readme
  ./floatingcontact/readme
  ./jidlink/readme
  ./otr/readme
  ./otr/tclotr/readme
  ./presencecmd/readme
  ./quotelastmsg/readme
  ./receipts/readme

... but the following code in debian/docify.sh that is meant to loop over
each of the `attline`, `checkers`, top-level directories to rename and move
the documentation into place did not take filesystem ordering into
consideration:

    for f in ` find "$d" -type f \( \
            -iname README \
            -o -iname proto \
            \) `; do
        mv "$f" "$DOCDIR/`basename \"$f\"`.`basename \"$d\"`"
    done

For example, when $d was pointing to $(CURDIR)/otr/, the above code was
either iterating over the filesystem in the "human expected" way:

  ./otr/README
  ./otr/tclotr/README

... but it would also process them in the following order:

  ./otr/tclotr/README
  ./otr/README

This would mean that /usr/share/doc/tkabber-plugins/README.otr in the
generated .deb would non-deterministically include `otr/tclotr/README`
or `otr/README`.

Patch attached that, via `-maxdepth 1` ensures only the top-level
version is used. Note that stopping on the first result (without
sorting) is not a solution as it would simply reverse the
non-deterministic logic result we are currently observing.

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


Regards,

--
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/docify.sh  2020-06-22 10:40:23.249097774 +0100
--- b/debian/docify.sh  2020-06-22 11:07:08.354698465 +0100
@@ -20,6 +20,7 @@
 
        for f in ` find "$d" -type f \( \
                        -iname README \
+                       -maxdepth 1 \
                        -o -iname proto \
                        \) `; do
                mv "$f" "$DOCDIR/`basename \"$f\"`.`basename \"$d\"`"

Reply via email to