Bug#920732: strip-nondeterminism should normalize file ownerships in epubs too

Chris Lamb lamby at debian.org
Tue Jan 29 14:48:02 GMT 2019


Hi Holger,

> │ │ │ │ │ --rw-r--r--  0 1111   1111      255 Jan  1  1970 epub/META
> │ │ │ │ │ +-rw-r--r--  0 2222   2222      255 Jan  1  1970 epub/META

Hm, I can confirm this in Git (currently 3f4ba2fb8). Indeed, it
appears to be already handled with:

    my $uid_len = ord(substr($field, $pos + 5, 1));
    my $gid_len = ord(substr($field, $pos + 6 + $uid_len, 1));
    $result
      .= pack("CCx${uid_len}Cx${gid_len}", 1, $uid_len, $gid_len);
      
… and this code is run, padding with enough nulls (the "x" format
identifier for Perl's pack[0] method). However, it does not seem to
result in a normalised file when shown with bsdtar -tvf.

(I would immediately commit an "xfailing" test but the .epub in
question is 800K so I will hold off on that until I find a smaller
testcase. Do let me know if you have one.)

  [0] http://perldoc.perl.org/functions/pack.html
  

> [..] this 'find epub -exec touch -d @0 {} \;' also looks like
> something strip-nondeterminism should do.

We normalise the timestamps of .zip/.epub members so this should
not be a problem.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org 🍥 chris-lamb.co.uk
       `-



More information about the Reproducible-builds mailing list