Bug#397786: developers-reference: Please describe easy ways to add binary files in the diff.gz
Frank Küster <frank@debian.org> wrote:
> Package: developers-reference
> Version: 3.3.7
> Severity: wishlist
> Tags: patch
>
> Section "6.7.8.3 Changing binary files in diff.gz" currently describes
> how to add binary files by uuencoding them. Most people use uudecode
> for that purpose, and thus add a Build-Dependency on sharutils.
> Actually the essential perl can also do it, and I think this should be
> documented. Here's a patch:
After a conversation on -mentors, here's a version that's more legible
for non-Perl-Gurus:
--- developers-reference.sgml 17 Jul 2006 21:07:28 -0000 1.291
+++ developers-reference.sgml 9 Nov 2006 18:32:00 -0000
@@ -4941,7 +4941,19 @@
<footnote>
The file should have a name that makes it clear which binary file it
encodes. Usually, some postfix indicating the encoding should be
-appended to the original filename.
+appended to the original filename. Note that you don't need to
+depend on <package>sharutils</package> to get
+the <prgn>uudecode</prgn> program if you
+use <prgn>perl</prgn>'s <tt>pack</tt> function. The code could look
+like
+<example>
+uuencode-file:
+ perl -ne 'print(pack "u", $$_);' $(file) > $(file).uuencoded
+
+uudecode-file:
+ perl -ne 'print(unpack "u", $$_);' $(file).uuencoded > $(file)
+</example>
+
</footnote>.
The file would then be decoded and copied to its place during the
build process. Thus the change will be visible quite easy.
Regards, Frank
--
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)
Reply to: