summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_xpkg_common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/ptxd_make_xpkg_common.sh')
-rw-r--r--scripts/lib/ptxd_make_xpkg_common.sh43
1 files changed, 42 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_common.sh b/scripts/lib/ptxd_make_xpkg_common.sh
index a756f20c8..5b925ec05 100644
--- a/scripts/lib/ptxd_make_xpkg_common.sh
+++ b/scripts/lib/ptxd_make_xpkg_common.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright (C) 2008, 2009 by Marc Kleine-Budde <mkl@pengutronix.de>
+# Copyright (C) 2008, 2009, 2010 by Marc Kleine-Budde <mkl@pengutronix.de>
#
# See CREDITS for details about who has contributed to this project.
#
@@ -25,6 +25,30 @@ export -f ptxd_dopermissions
#
+# ptxd_do_xpkg_map - do the mapping from package name to xpkg name(s)
+#
+# in:
+# ${@} package name(s)
+#
+# out:
+# ${ptxd_reply[@]} array of xpkg names
+#
+# return:
+# 0 if xpkg names are found
+# 1 if no xpkg names are found
+#
+# ptxd_reply (array)
+#
+ptxd_do_xpkg_map() {
+ set -- "${@/#/${ptx_state_dir}/}"
+ ptxd_reply=( $(cat "${@/%/.xpkg.map}" 2>/dev/null) )
+
+ [ ${#ptxd_reply[@]} -ne 0 ]
+}
+export -f ptxd_do_xpkg_map
+
+
+#
# initialize variables needed for packaging
#
ptxd_make_xpkg_init() {
@@ -32,6 +56,23 @@ ptxd_make_xpkg_init() {
ptxd_bailout "'pkg_xpkg' or 'pkg_xpkg_type' undefined"
fi
+ #
+ # sanitize pkg_xpkg name
+ #
+ # replace "_" by "-"
+ #
+ pkg_xpkg="${pkg_xpkg//_/-}"
+
+ #
+ # sanitize pkg_version
+ #
+ # replace "_" by "."
+ #
+ pkg_xpkg_version="${pkg_version//_/.}"
+ if [ -z ${pkg_xpkg_version} ]; then
+ ptxd_bailout "${FUNCNAME}: please define <PKG>_VERSION"
+ fi
+
ptxd_make_world_init || return
# license