On Mon, 2011-09-19 at 14:34:49 -0400, Joey Hess wrote:
> Guillem Jover wrote:
> > dpkg started using brace expansion [0] due to a change in debhelper
> > 4.9.5 which made wildcards expanding to nothing to error out.
> > 
> > I don't know what made Raphaël think that was supported, maybe just
> > trial and error, but it seems like a rather elegant “solution”. In any
> > case I don't want to justify the fact that dpkg is using undocumented
> > behaviour (I'm aware of #480868 and #480939) and that debhelper
> > should support it because packages are using it. Just wanted to request
> > if this could become a sanctioned behaviour because it truly seems
> > useful and elegant. In case you still don't want to support it, could
> > you consider instead to add an option to not fail on wildcards expanding
> > to nothing, so that we can revert to our old debhelper config files,
> > w/o needing to move most of the install files to debian/rules?
> 
> It doesn't seem very elegant. It relies on a quirk of perl's glob
> engine. 

I guess I didn't make myself clear, I find it elegant given the
constraints and knowledge/assumption at the time. That's why I
wrote: “solution”. Having to move the installation handling into
debian/rules does not seem very elegent to me, but we will if there's
no other alternative, of course.

Regarding perl's glob engine, it explicitly supports brace expansion
as mentioned on the documentation, so I don't see how that's a quirk.
If you mean the quirk is expecting dehelper to use perl's glob, well
as said before, sure.

> Notice that, {foo*,otherfile*} will only succeed as long as one of
> the interior globs match; if both globs fail it will stop. It's
> not really doing what you want; what you want is available via
> DH_COMPAT=4.
> 
> And if that's tweaked to {foo,otherfile*} it will, instead of only
> expanding to existing files, now it always expand to "foo" even when
> that doesn't exist.

In other cases it might not, but in dpkg case it's doing exactly what
we want regarding man page translations, this is our common pattern:

  usr/share/man/{*/*,*}/dpkg-deb.1

because usr/share/man/man1/dpkg-deb.1 should always exist (it's the
untranslated file), and things like usr/share/man/fr/man1/dpkg-deb.1
or usr/share/man/de/man1/dpkg-deb.1 might or might not exist, but we
don't really care as they are optional.

Also I don't think switching back to compat level 4 is much of an
option, being it documented as deprecated.

> And then there's the way that it conflicts with the proposed syntax
> for ${VAR} expansions in debhelper config files..

If variable expansion is always performed before globbing, then I
don't see the problem?


In any case, as stated before, anything that allows us to keep the
installation logic confined in dh_install config files would be ideal.
Either permitting brace expansion, adding an option to get back the
non-failing empty glob expansion, a way to mark optional files
as such inline, or something else you could come up with.

thanks,
guillem



--
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