On Fri, 23 Aug 2013, Bastien ROUCARIES wrote:
> Find -print0
> 
> And replacing read by read -r -d $'\0' is safer but I do not know if it is
> portable.
> 
> Or xargs but we need to fork for each file and we get the portability
> problem of find print0.
> 
> What do you prefer ?

find -print0 is fine, dpkg-deb already uses it.
read -d is likely a problem however (I believe it's bash specific).

I don't think that I have any good answer if we want to support newlines
in filenames. But it's probably not an important use case as dpkg itself
doesn't cope very well with it. dpkg-deb builds it fine and it installs
fine but when you do "dpkg -L" you get this back (with a single
"hello\nworld" file):
$ dpkg -L foo
/.
/hello
/world

(This is because the /var/lib/dpkg/info/*.list files are line based)

So I would go ahead ignoring this specific problem. Otherwise you could
write that specific part in perl but it would be a regression to reintroduce
perl in dpkg itself.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to