8000 Various problems with the .Files map · Issue #7 · cbednarski/mkdeb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Various problems with the .Files map #7
Open
@thomasf

Description

@thomasf

1. Directories are not included in the archive

I was just using the Files map to add in extra files..

...Files = map[string]string{
  "somefile":"/usr/share/doc/someproject/somefile",
}

This fails because the directory /usr/share/doc/someproject/ isn't explicitly
added to the archive.

2. Directories are not supported in the Files map

Files should probably also support directories which would be added recursively.

3. It's not possible to add a source file multiple times

The mapping in the Files map should be inverted to support copying one source
file to multiple destination files. The current Files map map[src]dst makes
it impossible to reuse src multiple times.

I had an actual use case for this today when I tried to put a default
configuration file both in /etc and in the documentation folder.

good solution ⊂(◉‿◉)つ

A backwards compatible solution is keep the Files struct field (map[src]dst)
and add a new field Include which probably is some functionality to properly
handle sources and destinations. It opens up for .Exclude or .Filters
fields. I will work on a suggestion.

worse solution ◔_◔

A worse solution is to change Files from map[src]dst to map[src][]dst which
breaks the current API so that any current users have to change.

worst! solution ಠ_ಠ

The worst solution is to just silently change map[src]dst to map[dst]src
which will cause errors without breaking compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0