summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGeorge McCollister <george.mccollister@gmail.com>2011-04-28 16:13:21 -0500
committerMichael Olbrich <m.olbrich@pengutronix.de>2011-04-29 09:53:13 +0200
commitca658def2e83d13b3f88fb758c94f28a673ea97f (patch)
treee2a0f69a0ac04cc477885240d71cf12123bb9173 /scripts
parent4d6606b03a66c1cab75698f16231bc4573b9dc7e (diff)
downloadptxdist-ca658def2e83d13b3f88fb758c94f28a673ea97f.tar.gz
ptxdist-ca658def2e83d13b3f88fb758c94f28a673ea97f.tar.xz
Added install_config
I added install_config which is the same as install_alternative except it also adds the file name to conffiles inside of the .ipk file so it is handled by the package manager as a config file. Signed-off-by: George McCollister <george.mccollister@gmail.com> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/ptxd_make_ipkg_common.sh1
-rw-r--r--scripts/lib/ptxd_make_xpkg_pkg.sh20
2 files changed, 18 insertions, 3 deletions
diff --git a/scripts/lib/ptxd_make_ipkg_common.sh b/scripts/lib/ptxd_make_ipkg_common.sh
index eb7151c3a..b23fcff71 100644
--- a/scripts/lib/ptxd_make_ipkg_common.sh
+++ b/scripts/lib/ptxd_make_ipkg_common.sh
@@ -16,5 +16,6 @@ ptxd_make_ipkg_init() {
pkg_ipkg_tmp="${pkg_xpkg_tmp}/ipkg"
pkg_ipkg_control_dir="${pkg_ipkg_tmp}/CONTROL"
pkg_ipkg_control="${pkg_ipkg_control_dir}/control"
+ pkg_xpkg_conffiles="${pkg_xpkg_control_dir}/conffiles"
}
export -f ptxd_make_ipkg_init \ No newline at end of file
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index 1947410db..4e5878a58 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -54,7 +54,7 @@ ptxd_install_setup_src() {
local -a list
- if [ "${cmd}" = "alternative" ]; then
+ if [ "${cmd}" = "alternative" -o "${cmd}" = "config" ]; then
#
# if pkg_dir is empty we'll have some some empty entries in
# the array, but that's no problem for the "-e" below.
@@ -205,9 +205,10 @@ install ${cmd}:
fi
;;
*)
- if [ "${strip:0:1}" = "/" -a "${cmd}" = "alternative" ]; then
+ if [ "${strip:0:1}" = "/" ] && \
+ [ "${cmd}" = "alternative" -o "${cmd}" = "config" ]; then
ptxd_bailout "
-the 6th parameter of 'install_alternative' is strip, not the destination.
+the 6th parameter of 'install_${cmd}' is strip, not the destination.
Usually, just remove the 6th parameter and everything works fine.
"
fi
@@ -303,6 +304,19 @@ ptxd_install_alternative() {
}
export -f ptxd_install_alternative
+ptxd_install_config() {
+ local cmd="config"
+ local src="${1}"
+ local dst="${2}"
+ shift 2
+ ptxd_install_file_impl "${src}" "${dst:-${src}}" "${@}" &&
+ # this is a config file add it to conffiles so it's handled correctly
+ echo "${dst:-${src}}" >> "${pkg_xpkg_conffiles}" &&
+ chown 0:0 "${pkg_xpkg_conffiles}" ||
+ ptxd_install_error "install_config failed!"
+}
+export -f ptxd_install_config
+
ptxd_install_file() {
local cmd="file"
ptxd_install_file_impl "$@" ||