Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

--config-files should recurse if argument is a directory #171

Closed
jordansissel opened this Issue · 11 comments

4 participants

@jordansissel

It should be as easy as --config-files etc/myproject

@kwilczynski

+1 for that. I wanted to have this for quite some time, as adding multiple --config-files can be annoying :)

@kwilczynski

Actually, do you plan this for 0.4.x or still for 0.3.x?

@jordansissel

0.3.x will not receive any further updates from me :)

@kwilczynski

Um, harsh :)

@igalic
--config-files CONFIG_FILES   Mark a file in the package as being a config file. This uses 'conffiles' in debs and %config in rpm. You can specify a directory to have it scanned marking all files found as config files

But right now that's not true:

% dpkg -I /build/bwtoolsdl/trafficserver-3.2.3-0_amd64.deb
 new debian package, version 2.0.
 size 91674856 bytes: control archive= 419 bytes.
      21 bytes,     1 lines      conffiles

# dpkg -i /build/bwtoolsdl/trafficserver-3.2.3-0_amd64.deb
Selecting previously unselected package trafficserver.
(Reading database ... 94657 files and directories currently installed.)
Unpacking trafficserver (from .../trafficserver-3.2.3-0_amd64.deb) ...
dpkg: warning: trafficserver: conffile 'etc/bw/trafficserver' is not a plain file or symlink (= '/etc/bw/trafficserver')
Setting up trafficserver (3.2.3-0) ... 
dpkg: warning: trafficserver: conffile '/etc/bw/trafficserver' is not a plain file or symlink (= '/etc/bw/trafficserver')
@kwilczynski

I never had issues with this, provided that "conffiles" has fully-qualified path to each file, and there is one file per line. This means that you have to use --config-files for each file separately (the recursive nature of --config-files is not yet there as far as I can tell).

You can extract relevant bits of your .deb file and see what is inside "conffiles" and whether it has expected paths:

ar p trafficserver-3.2.3-0_amd64.deb control.tar.gz | tar zxf - -O conffiles

You should see content of the "conffiles" on the console, and it should have one file per line that has fully-qualified path.

@j4m3s

This is a bit dangerous as-is. I've come to rely heavily on fpm, it's a great tool - but the documentation regarding --config-files is totally incorrect, it does not recursively mark the contents of a directory as conffiles. This could cause some quite serious destruction - a deb built with fpm will overwrite customised config files with the "standard" ones included in the package, as if they were standard files. Anyone without a backup of their original files will have to go back to square 1 and recreate the contents of their config files.

I know a massive amount of work has gone into fpm, and it's a brilliant tool, but I think the documentation should be updated asap - people using the tool may be heading for a nasty surprise.

(just saw it's a wiki - with your permission I'll update it...)

Thanks, James

@jordansissel
Owner

@j4m3s sorry, this area doesn't have much testing because I never put any config files in any packages at all. I'll try to add tests to cover this area soon.

With respect to the --help output, I've updated master to not claim directory recursion in --config-files

@j4m3s

Wow that is staggeringly responsive! I tried all sorts so have tested that there is no way you can specify a directory and have it expanded to individual conffiles :)

Congratulations on such a useful bit of software, I couldn't do without it now.

@jordansissel
Owner

I'll add recursion soon (and will close this bug when it's committed/tested), sorry again for the confusion :)

@igalic
@jordansissel jordansissel closed this in #506
@prof-milki prof-milki referenced this issue from a commit in prof-milki/xpm
jls Remove lie about recursing in directories (#171) b76cdb8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.