[PATCH cygport 1/4] pkg_dist: use 'depends:' instead of 'requires:' in generated .hint files
Ken Brown
kbrown@cornell.edu
Mon Jun 25 15:10:00 GMT 2018
This paves the way for supporting dependencies with version relations,
which are allowed in the 'depends:' field but not in the 'requires:'
field.
---
lib/pkg_pkg.cygpart | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 3f9a9a7..91a0865 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -515,6 +515,7 @@ __pkg_dist() {
local distsubdir;
local obssubdir obspkg;
local pkg_category_var pkg_requires_var pkg_summary_var;
+ local pkg_bin_requires pkg_depends;
local pkg_description_var pkg_message_var pkg_obsoletes_var;
local pkg_tag=${1};
@@ -598,8 +599,8 @@ __pkg_dist() {
#****
#****v* Packaging/REQUIRES
# DESCRIPTION
-# A single-line strings containing a list of packages on which this
-# package depends. This will be added to the requires: field of the
+# A single-line string containing a list of packages on which this
+# package depends. This will be added to the depends: field of the
# auto-generated .hint file.
# NOTES
# * cygport attempts to automatically detect many types of package
@@ -614,8 +615,8 @@ __pkg_dist() {
#****
#****v* Packaging/PKG_REQUIRES
# DESCRIPTION
-# A single-line strings containing a list of packages on which this
-# package depends. This will be added to the requires: field of the
+# A single-line string containing a list of packages on which this
+# package depends. This will be added to the depends: field of the
# auto-generated .hint file.
#
# Note that the PKG_REQUIRES name is descriptive rather than literal,
@@ -677,6 +678,7 @@ __pkg_dist() {
then
declare ${pkg_requires_var}="${REQUIRES}"
fi
+ declare ${pkg_requires_var}="$(echo ${!pkg_requires_var} | sed -e 's/ /, /g')"
if [ -z "${distsubdir}${!pkg_obsoletes_var}" -a -n "${OBSOLETES+yes}" ]
then
declare ${pkg_obsoletes_var}="${OBSOLETES}"
@@ -691,16 +693,22 @@ __pkg_dist() {
then
pkg_bin_requires=$(__list_deps $(sort -fu ${T}/.${pkg_name[${n}]}.lst | sed -e '\|/$|d;s| |^_^|g') \
| sort -fu | sed -e "/^${pkg_name[${n}]}-[0-9].*$/d;s/-[0-9].*$//g" \
- | sed -e ':a;N;$!ba;s/\n/ /g')
- __step "${pkg_name[${n}]} requires: ${pkg_bin_requires} ${!pkg_requires_var}"
+ | sed -e ':a;N;$!ba;s/\n/, /g')
+ if [ -n "${pkg_bin_requires}" -a -n "${!pkg_requires_var}" ]
+ then
+ pkg_depends="${pkg_bin_requires}, ${!pkg_requires_var}"
+ else
+ pkg_depends="${pkg_bin_requires}${!pkg_requires_var}"
+ fi
+ __step "${pkg_name[${n}]} requires: ${pkg_depends}"
else
- pkg_bin_requires=
+ pkg_depends="${!pkg_requires_var}"
inform "ADD ${distsubdir:-${PN}} DLL DEPENDENCIES TO ${PN}${distsubdir:+/}${distsubdir}/${pkg_name[${n}]}-${PVR}.hint"
fi
cat > ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
category: ${!pkg_category_var:-${CATEGORY}}
-requires: ${pkg_bin_requires} ${!pkg_requires_var}
+depends: ${pkg_depends}
sdesc: "${!pkg_summary_var:-${SUMMARY}}"
ldesc: "${!pkg_description_var:-${DESCRIPTION:-${!pkg_summary_var:-${SUMMARY}}}}"
_EOF
--
2.17.0
More information about the Cygwin-apps
mailing list