-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
This is to avoid overwritten of config file when update package. Signed-off-by: Kai Zhang <zhangk1985@gmail.com>
What exactly does this change solve? What can happen? |
@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 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. |
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 ." |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()'
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's greate! Thanks!
OK, I tested this with debian package creation, and it works well. Thanks again @kylezh . |
add --config-files option to fpm command
Allow TSI cache to be dynamically altered
This is to avoid overwritten of config file when update package.
Signed-off-by: Kai Zhang zhangk1985@gmail.com