[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: binary files in diff



"Jaldhar H. Vyas" <jaldhar@debian.org> wrote:

> On Thu, 9 Nov 2006, Frank Küster wrote:
>
>> "Jaldhar H. Vyas" <jaldhar@debian.org> wrote:
>>
>>> Note perl has the ability to uudecode and encode builtin (perldoc -f
>>> pack or unpack and look at the u option.)  As perl is an essential
>>> package, by using it you can save yourself a needless dependency.
>>
>> Ah, that's great.  Can you give a short usage example - I would then
>> prepare a patch for the developer's reference.
>>
>
> This is how I handled the Debian open logo in webmin.
>
> In the clean target:
>
> perl -ne 'print pack "u", $$_;' debian/debiantheme/openlogo-50.png > debian/debiantheme/openlogo-50.uue
> -rm debian/debiantheme/openlogo-50.png
>
> And in the install target:
>
> perl -ne 'print unpack "u", $$_;' debian/debiantheme/openlogo-50.uue > debian/debiantheme/openlogo-50.png
> -rm debian/debiantheme/openlogo-50.uue

Thank you, that's nice.  Oh, well, for the non-Perlmaniacs it might be
confusing that two functions are called after the other, and hard to
understand that print just prints the result of the pack or unpack
function.  Is

perl -ne 'print(pack "u", $_);' 

better (and actually works always, not only with my test file)?

Regards, Frank
-- 
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)



Reply to: