[Pkg-xfce-devel] Bug#654468: update on waf binary data

Carsten Hey carsten at debian.org
Fri Mar 9 20:42:07 UTC 2012


[ I'm sending this to the two bugs Rhonda sent the mail I reply to and
  an additional bug tagged wontfix to avoid spamming all affected bugs ]

* Gerfried Fuchs [2011-10-13 15:12 +0200]:
>  it seems that the line 161 is actually a tar.bz2 file that gets
> extracted and then used.  Though, first there is some substitution of \r
> and \n characters so that the "file" could go on one line.
>
>  IMHO this is not acceptable because there are no tools included or
> commandline switches offered with waf (in postler and midori) to
> conveniently unpack and repack these part for a.) inspection or b.)
> modification, which are required for packages in Debian main.

Exactly regenerating tarballs is, similar to regenerating man pages that
contain a date, possible but not that easy.  Ignoring this non-relevant
difference of regenerated tarballs, I was able to regenerate an exact
copy of the waf script:

  $ rm -rf midori-0.4.3
  $ dpkg-source -x midori_0.4.3-1.dsc >/dev/null 2>&1
  $ cd midori-0.4.3
  $ sed < waf -e '1,/^#==>$/ d' -e '/^#<==$/ d' | tr -d '\n' | sed -e 's/.//' -e 's/#[*]/\n/g' -e 's/#%/\r/g' > waf.orig.tar.bz2
  $ tar tjf waf.orig.tar.bz2
  wafadmin/Logs.py
  wafadmin/Constants.py
  wafadmin/py3kfixes.py
  ...
  $ (sed -n < waf -e '1,/^#==>$/ p'; echo REPLACED BY ENCODED TAR.BZ2; sed -n < waf -e '/^#<==$/ p') > debian/waf.tmpl
  $ wc -c debian/waf.tmpl
  4097 debian/waf.tmpl
  $ (sed -n < debian/waf.tmpl -e '1,/^#==>$/ p'; printf '#'; perl -pe < waf.orig.tar.bz2 's/\n/#*/g; s/\r/#%/g;'; echo; sed -n < debian/waf.tmpl  -e '/^#<==$/ p') > waf.regen
  $ md5sum waf waf.regen
  eca3f4738d809c42cecad2e9ec39a1cc  waf
  eca3f4738d809c42cecad2e9ec39a1cc  waf.regen

I assume that it should be possible to develop a DFSG conforming
solution based on above hack.  The requirements to sed extend POSIX's
specifications, but given that it could be replaced with perl and we use
GNU sed in Debian this shouldn't be a problem.

Carsten





More information about the Pkg-xfce-devel mailing list