[Hackage] #213: allow wildcards in data-files or
extra-source-files?
Hackage
trac at galois.com
Tue Jul 29 12:28:46 EDT 2008
#213: allow wildcards in data-files or extra-source-files?
----------------------------+-----------------------------------------------
Reporter: duncan | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Cabal-1.6
Component: Cabal library | Version: 1.2.3.0
Severity: normal | Resolution:
Keywords: | Difficulty: very easy (<1 hour)
Ghcversion: 6.8.2 | Platform:
----------------------------+-----------------------------------------------
Comment (by duncan):
{{{
Tue Jul 29 16:26:24 BST 2008 Duncan Coutts <duncan at haskell.org>
* Fix the semantics of the simple file globbing to be sane
I realised when I started to document it that the behaviour
was not terribly consistent or sensible. The meaning now is:
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".
The reason for providing only a very limited form of wildcard
is to concisely express the common case of a large number of
related files of the same file type without making it too easy
to accidentally include unwanted files.
Tue Jul 29 16:40:50 BST 2008 Duncan Coutts <duncan at haskell.org>
* File globs must match at least one file or it's an error.
Tue Jul 29 16:59:20 BST 2008 Duncan Coutts <duncan at haskell.org>
* Document the wildcard behaviour in data-files and extra-source-files
fields
}}}
I'm still not completely sure about the semantics of matching file
extensions. Currently `*.gz` matches `foo.gz` but not `foo.tar.gz`, on the
theory that `foo.tar.gz` has the extension `tar.gz` and that's not the
same as the extension `gz`.
The problem with this, apart from the above example is things like
`foo-1.0.gz` where the full extensions is `0.gz` and so again would not be
matched by `*.gz`.
The alternative I suppose would be to match any of the list of extensions.
So for example `foo-1.0.1.tar.gz` has the extension list `["gz", "tar.gz",
"1.tar.gz", "0.1.tar.gz"] and we'd match `*.gz` by checking if `gz` was a
member of that extension list which of course it is.
Opinions?
--
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/213#comment:5>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects
More information about the cabal-devel
mailing list