[Hackage] #794: Wildcards in data-files don't work with filenames containing multiple dots

Hackage cvs-ghc at haskell.org
Mon Jan 24 17:50:11 CET 2011

#794: Wildcards in data-files don't work with filenames containing multiple dots
  Reporter:  guest          |        Owner:         
      Type:  defect         |       Status:  new    
  Priority:  normal         |    Milestone:         
 Component:  Cabal library  |      Version:
  Severity:  normal         |     Keywords:         
Difficulty:  unknown        |   Ghcversion:         
  Platform:                 |  

Comment(by duncan):

 From the user guide:

   A limited form of * wildcards in file names, for example data-files:
 images/*.png matches all the .png files in the images directory.

   The limitation is that * wildcards are only allowed in place of the file
 name, not in the directory name or file extension. In particular,
 wildcards do not include directories contents recursively. Furthermore, if
 a wildcard is used it must be used with an extension, so data-files:
 data/* is not allowed. When matching a wildcard plus extension, a file's
 full extension must match exactly, so *.gz matches foo.gz but not
 foo.tar.gz. A wildcard that does not match any files is an error.

 So currently this is deliberate, that "*.gz matches foo.gz but not
 foo.tar.gz". It has the unfortunate side effect that "*.js" does not match
 "jquery-1.4.2.js". In this case "1.4.2" is not really a bunch of
 extensions but part of the name. On the other hand, "jquery.cookie.js" is
 exactly the sort of thing the test is there to avoid.

 Perhaps it's not a problem at all and the behavior should be reversed. Are
 there any cases anyone can think of where it would be
 misleading/dangerous, where a wildcard would accidentally pick up more
 files than was really intended (especially e.g. generated/temp files).

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/794#comment:1>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list