[Fedora-packaging] Use of dos2unix in %prep

Patrice Dumas pertusus at free.fr
Wed Jan 14 11:02:17 UTC 2009

On Wed, Jan 14, 2009 at 09:00:49AM +0000, Richard W.M. Jones wrote:
> While a package was being reviewed, the reviewer picked up on a use of
> the 'dos2unix --keepdate' command:
>   https://bugzilla.redhat.com/show_bug.cgi?id=478640
> The guidelines do indeed say not to use dos2unix, because quote "that
> can cause build fail on FC3" (like I care).
>   http://fedoraproject.org/wiki/Packaging/Guidelines#Rpmlint_Errors
> But I've used dos2unix before, and it appears that using 'dos2unix
> --keepdate' is a superior solution because it keeps the original
> timestamp, and is generally simpler and more obvious to people reading
> the specfile.

To avoid the dos2unix dependency and still keep timestamp, I use:

  sed -e 's/\r//' $file > $file.tmp
  touch -c -r $file $file.tmp
  mv $file.tmp $file

But using dos2unix --keepdate with the apropriate BuildRequires (I 
would use a file BuildRequires) is right too, in my opinion.

By the way I prefer keeping timestamps, in case it wasn't clear.


More information about the Fedora-packaging mailing list