Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --config-files option to fpm command #1789

Merged
merged 1 commit into from
Mar 4, 2015
Merged

Conversation

kylezh
Copy link
Contributor

@kylezh kylezh commented Feb 28, 2015

This is to avoid overwritten of config file when update package.

Signed-off-by: Kai Zhang zhangk1985@gmail.com

This is to avoid overwritten of config file when update package.

Signed-off-by: Kai Zhang <zhangk1985@gmail.com>
@otoolep
Copy link
Contributor

otoolep commented Feb 28, 2015

What exactly does this change solve? What can happen?

@kylezh
Copy link
Contributor Author

kylezh commented Feb 28, 2015

@otoolep you could find something here: jordansissel/fpm#463

Let met show an example in rpm.

In short, if I update a package under Centos by rpm -U influxdb-xxx.rpm, the config file which was in /etc/opt/influxdb/influxdb.conf will be replaced by the config file in the new rpm. It means modifications on old config file will be lost, which is not expected.

If we add --config-files option to fpm command, the old config file will be remained after the package is updated.

A more sophisticated rule could be find here http://www-uxsup.csx.cam.ac.uk/~jw35/docs/rpm_config.html

However, I'm not quite familiar with deb package. But I think it should have a similar effect.

@otoolep
Copy link
Contributor

otoolep commented Feb 28, 2015

OK, this is a real issue -- thanks for bringing that option to our attention I'll need to test it out.

@toddboom -- what do you think we want to happen? I think not overwriting installed config files is probably best.

@@ -262,7 +262,7 @@ else
debian_package=influxdb_${VERSION}_amd64.deb
fi

COMMON_FPM_ARGS="-C $TMP_WORK_DIR --vendor $VENDOR --url $URL --license $LICENSE --maintainer $MAINTAINER --after-install $POST_INSTALL_PATH --name influxdb --version $VERSION ."
COMMON_FPM_ARGS="-C $TMP_WORK_DIR --vendor $VENDOR --url $URL --license $LICENSE --maintainer $MAINTAINER --after-install $POST_INSTALL_PATH --name influxdb --version $VERSION --config-files $CONFIG_ROOT_DIR ."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From reading the docs for "fpm" this option should be applied to a specific file, not a directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To quote:

--config-files CONFIG_FILES Mark a file in the package as being a config file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@otoolep Where did you find the document?

I found a different version from here

--config-files CONFIG_FILES   Mark a file in the package as being a config file. This uses 'conffiles' in debs and %config in rpm. If you have multiple files to mark as configuration files, specify this flag multiple times.  If argument is directory all files inside it will be recursively marked as config files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~/coding/bleve-test/main $ fpm -help | grep config
    --config-files CONFIG_FILES   Mark a file in the package as being a config file. This uses 'conffiles' in debs and %config in rpm. If you have multiple files to mark as configuration files, specify this flag multiple times.  If argument is directory all files inside it will be recursively marked as config files.
    --deb-config SCRIPTPATH       (deb only) Add SCRIPTPATH as debconf config file.
    --deb-default FILEPATH        (deb only) Add FILEPATH as /etc/default configuration
    --python-install-lib LIB_PATH (python only) The path to where python libs should be installed to (default depends on your python installation). Want to find out what your target platform is using? Run this: python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last sentence of the line shows If argument is directory all files inside it will be recursively marked as config files.. So I think the argument can be a directory. Right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, yeah, I see that now. Seems like this should work. I'll test it, and if it looks good, we'll merge -- thanks @kylezh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's greate! Thanks!

@otoolep
Copy link
Contributor

otoolep commented Mar 4, 2015

OK, I tested this with debian package creation, and it works well. Thanks again @kylezh .

otoolep added a commit that referenced this pull request Mar 4, 2015
add --config-files option to fpm command
@otoolep otoolep merged commit af5ae3d into influxdata:master Mar 4, 2015
@kylezh kylezh deleted the pkg branch March 5, 2015 01:17
mark-rushakoff pushed a commit that referenced this pull request Jan 11, 2019
Allow TSI cache to be dynamically altered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants