Bug#966280: dpkg-source should ignore CRLF vs. LF differences
Martin Quinson <[email protected]> Mon, 08 Jun 2026 10:44:44 +0200
| Newsgroups | gmane.linux.debian.devel.dpkg.bugs |
|---|---|
| Message-ID | <184c88c85472c10b2cd5c48450dd255918ff1bd7.camel__4830.69918570749$1780908927$gmane$org@ens-rennes.fr> |
--=-25+zfMkJf7f9LI2bVQod Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Guillem, thanks for your answer, and thanks for maintaining dpkg. Le dimanche 07 juin 2026 =C3=A0 03:35 +0200, Guillem Jover a =C3=A9crit=C2= =A0: > Hi! >=20 > On Sat, 2020-07-25 at 22:42:02 +0200, Martin Quinson wrote: > > Package: dpkg > > Version: 1.19.7 > > Severity: normal >=20 > > when trying to build the new upstream version of Widelands with git- > > buildpackage, I had an error message saying that some files were modifi= ed > > out > > of the debian/ directory. It turns out that the difference is only abou= t > > the > > line endings: some files of the upstream tarball are encoded with CRLF > > while > > most of them are LF only. > >=20 > > When importing the files in the upstream branch of my git, the CRLF are > > automatically converted to LF by git, but when dpkg-source compares the > > content > > of the current dir (ie, the checkout) with the content of the tarball, = it > > fails > > with a rather uninformative error message: > >=20 > > =C2=A0 dpkg-source: info: local changes detected, the modified files ar= e: > > =C2=A0=C2=A0 widelands-21/cmake/Modules/FindSDL2_image.cmake > > =C2=A0=C2=A0 widelands-21/cmake/Modules/FindSDL2_mixer.cmake > > =C2=A0=C2=A0 widelands-21/cmake/Modules/FindSDL2_ttf.cmake > > =C2=A0=C2=A0 widelands-21/data/maps/Twin_Lagoons_v2.wmf/elemental > > =C2=A0=C2=A0 widelands-21/src/third_party/eris/README.eris > > =C2=A0 dpkg-source: error: aborting due to unexpected upstream changes,= see > > /tmp/widelands_21-1.diff.YyKJqP > >=20 > > My first glance at the diff was not enough to understand the pb, stupid= me. > > Instead it took me several hours to understand the issue. I repacked an= d > > reimported my upstream tarball quite a few times before that. Then, I h= ad > > to > > manually repack the upstream archive after dos2unix'ing the relevant fi= les > > to > > fix it. > >=20 > > I think that it'd be really better if dpkg-source would ignore those > > difference > > in the first place. I'm not completely sure, but I think that this is w= hat > > the > > --strip-trailing-cr option of diff is meant for. >=20 > I don't think using --strip-trailing-cr is safe, because (AFAICT) > patch(1) would reject applying patches on different line endings, so > this could accept diffs that then could not be applied. >=20 > I guess we could add a message hint mentioning the potential issue of > CRLF vs LF, but I'm not sure if that's too niche for such message to > be shown always? Otherwise I think I'd close this. The best solution would certainly to do an appropriate error message when t= his niche case occurs. Maybe this issue should be reassigned to diff or whichev= er program you use to compute the patch. That program should add a comment if/= when the only changes come from differing line endings. I don't have the /tmp/widelands_21-1.diff.YyKJqP anymore, but it would have been really help= ful if it could contain a comment about this fact. Thanks again for your time, Mt --=-25+zfMkJf7f9LI2bVQod Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEET76cTupS7xPVQWYSmL2XJE9zvqcFAmomgPwACgkQmL2XJE9z vqfO+Q//UfYE0896xdlv4TtStu3rJlKbANUlEPGURSAjECCOdgEOdMJMOu1d3nWH 7QtWKs63H5O+MGjvXVCE7WtL8Bio+qt5RnRIrWZACQXoNnfVckdqSOHIAe/DFFeQ 5NLgUJvsOgba4dHKivzbGgH6vWEoTO8N19a/zKjTcMeN9NDMcOrv3pAhbX18psAM WLciAU8FPnl316obdXa3w0KBZ7zmJF4Awk6oFgeotJoNhM/LXAXGdpbNb70yg/Im 7mLgdrCGaM3/JPc4ANF0yHiKtjiiUSH23GCR8hWIc/YjqCg+d8HAaNXIruF5P6Pl PORo1d1G9xUePYaRs6gApoyX+VBtH5SIhVAvPFLzKWZFaDTuH7wHEWPD+mXjmSJz vqUJISLupR6qnHxG5ydWeJG1Rd69bMcM797IxZqUe6qYmixXPXrLF1m6g1uWHsUl 9emDhVH9XQfwNSXfkUMzcLMtjxaRbWVnVlhiSr8mkVz25fY+DpM/gMgILaow7YoZ eLcYABxCShxzeHE96XKHVDhG25FAKWbSWOfrNDz8PZSsqE8tPpB8H5whFXU93v/h p1ZcrZePgBCfe/k4KkpWmzdIIAKvKq5A/QBVoAkZ+WvAf17k746qV5nqYqwYgUvK SDVYTpReZC0hfYvENj4rDaUZyQVemARAmG1D3OfksxXc092m+IA= =B5VI -----END PGP SIGNATURE----- --=-25+zfMkJf7f9LI2bVQod--