[PATCH cygport 0/2] Add provides: and conflicts:

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 0/2] Add provides: and conflicts:

Jon TURNEY
Add the ability to specify provides: and conflicts: hints in the cygport.

Jon Turney (2):
  Add test which compares hints with expected
  Add provides: and conflicts: hints

 lib/pkg_pkg.cygpart                           | 74 ++++++++++++++++++-
 testsuite/hints/meson.build                   |  1 +
 .../libmultiple-devel-3.14-1.hint             |  6 ++
 .../libmultiple1/libmultiple1-3.14-1.hint     |  8 ++
 .../dist/multiple/multiple-3.14-1.hint        |  6 ++
 testsuite/hints/multiple/multiple.cygport     | 35 +++++++++
 testsuite/hints/multiple/multiple.list        |  1 +
 .../obsoleted-by-single-2.3.4-1.hint          |  8 ++
 .../dist/single/single-2.3.4-1.hint           |  8 ++
 testsuite/hints/single/single.cygport         | 25 +++++++
 testsuite/hints/single/single.list            |  1 +
 testsuite/meson.build                         |  2 +
 testsuite/test-driver                         | 17 ++++-
 13 files changed, 189 insertions(+), 3 deletions(-)
 create mode 100644 testsuite/hints/meson.build
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/multiple.cygport
 create mode 100644 testsuite/hints/multiple/multiple.list
 create mode 100644 testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint
 create mode 100644 testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
 create mode 100644 testsuite/hints/single/single.cygport
 create mode 100644 testsuite/hints/single/single.list

--
2.21.0

Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 1/2] Add test which compares hints with expected

Jon TURNEY
Extend test-driver so it can compare hints with expected
Add a test of hints for a cygport which creates a single package
Add a test of hints for a cygport which creates multiple packages
---
 testsuite/hints/meson.build                   |  1 +
 .../libmultiple-devel-3.14-1.hint             |  6 ++++
 .../libmultiple1/libmultiple1-3.14-1.hint     |  6 ++++
 .../dist/multiple/multiple-3.14-1.hint        |  6 ++++
 testsuite/hints/multiple/multiple.cygport     | 33 +++++++++++++++++++
 testsuite/hints/multiple/multiple.list        |  1 +
 .../obsoleted-by-single-2.3.4-1.hint          |  8 +++++
 .../dist/single/single-2.3.4-1.hint           |  6 ++++
 testsuite/hints/single/single.cygport         | 23 +++++++++++++
 testsuite/hints/single/single.list            |  1 +
 testsuite/meson.build                         |  2 ++
 testsuite/test-driver                         | 17 +++++++++-
 12 files changed, 109 insertions(+), 1 deletion(-)
 create mode 100644 testsuite/hints/meson.build
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/multiple.cygport
 create mode 100644 testsuite/hints/multiple/multiple.list
 create mode 100644 testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint
 create mode 100644 testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
 create mode 100644 testsuite/hints/single/single.cygport
 create mode 100644 testsuite/hints/single/single.list

diff --git a/testsuite/hints/meson.build b/testsuite/hints/meson.build
new file mode 100644
index 0000000..f905486
--- /dev/null
+++ b/testsuite/hints/meson.build
@@ -0,0 +1 @@
+tests += [['hints/single'], ['hints/multiple']]
diff --git a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint
new file mode 100644
index 0000000..3bb7ad8
--- /dev/null
+++ b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint
@@ -0,0 +1,6 @@
+category: libmultiple1
+requires:  
+sdesc: "Summary of hints for multiple package test"
+ldesc: "Description of hints for multiple package test"
+external-source: multiple
+
diff --git a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
new file mode 100644
index 0000000..989bfb1
--- /dev/null
+++ b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
@@ -0,0 +1,6 @@
+category: Base
+requires:  cygwin
+sdesc: "Summary of hints for multiple package test"
+ldesc: "Description of hints for multiple package test"
+external-source: multiple
+
diff --git a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint
new file mode 100644
index 0000000..3820e4e
--- /dev/null
+++ b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint
@@ -0,0 +1,6 @@
+category: Base
+requires:
+sdesc: "Summary of hints for multiple package test (source)"
+ldesc: "Description of hints for multiple package test (source)"
+skip:
+
diff --git a/testsuite/hints/multiple/multiple.cygport b/testsuite/hints/multiple/multiple.cygport
new file mode 100644
index 0000000..b269ff5
--- /dev/null
+++ b/testsuite/hints/multiple/multiple.cygport
@@ -0,0 +1,33 @@
+NAME="multiple"
+VERSION=3.14
+RELEASE=1
+SUMMARY="Summary of hints for multiple package test"
+DESCRIPTION="Description of hints for multiple package test"
+
+PKG_NAMES="libmultiple1 libmultiple-devel"
+
+multiple_SUMMARY="Summary of hints for multiple package test (source)"
+multiple_DESCRIPTION="Description of hints for multiple package test (source)"
+multiple_CATEGORY="Base"
+
+libmultiple1_CONTENTS=""
+libmultiple1_CATEGORY="Base"
+libmultiple1_REQUIRES="cygwin"
+
+libmultiple_devel_CONTENTS="usr/include"
+libmultiple_devel_CATEGORY="Devel"
+libmultiple_devel_CATEGORY="libmultiple1"
+
+src_compile() {
+  :
+}
+
+src_install() {
+  cd ${D}
+  mkdir -p usr/include
+  touch usr/include/.keep
+}
+
+src_test() {
+  :
+}
diff --git a/testsuite/hints/multiple/multiple.list b/testsuite/hints/multiple/multiple.list
new file mode 100644
index 0000000..3fa47fd
--- /dev/null
+++ b/testsuite/hints/multiple/multiple.list
@@ -0,0 +1 @@
+/usr/include/.keep
diff --git a/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint
new file mode 100644
index 0000000..bb7644a
--- /dev/null
+++ b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint
@@ -0,0 +1,8 @@
+category: _obsolete
+requires: single
+sdesc: "Obsoleted by single"
+ldesc: "The obsoleted-by-single package is obsolete.  Selecting this package for
+installation will cause the single package, which replaces this
+one, to be installed instead."
+external-source: single
+
diff --git a/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
new file mode 100644
index 0000000..aa534a0
--- /dev/null
+++ b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
@@ -0,0 +1,6 @@
+category: Base
+requires:  cygwin
+sdesc: "Summary of hints for single package test"
+ldesc: "Description of hints for single package test"
+obsoletes: obsoleted-by-single
+
diff --git a/testsuite/hints/single/single.cygport b/testsuite/hints/single/single.cygport
new file mode 100644
index 0000000..fca0706
--- /dev/null
+++ b/testsuite/hints/single/single.cygport
@@ -0,0 +1,23 @@
+NAME="single"
+VERSION=2.3.4
+RELEASE=1
+SUMMARY="Summary of hints for single package test"
+DESCRIPTION="Description of hints for single package test"
+
+CATEGORY="Base"
+REQUIRES="cygwin"
+OBSOLETES="obsoleted-by-single"
+
+src_compile() {
+  :
+}
+
+src_install() {
+  cd ${D}
+  mkdir usr
+  touch usr/.keep
+}
+
+src_test() {
+  :
+}
diff --git a/testsuite/hints/single/single.list b/testsuite/hints/single/single.list
new file mode 100644
index 0000000..1b1ac0b
--- /dev/null
+++ b/testsuite/hints/single/single.list
@@ -0,0 +1 @@
+/usr/.keep
diff --git a/testsuite/meson.build b/testsuite/meson.build
index ae2d435..cd43e41 100644
--- a/testsuite/meson.build
+++ b/testsuite/meson.build
@@ -15,6 +15,8 @@ python2 = find_program('python2', required: false)
 tests = []
 
 subdir('download')
+subdir('hints')
+
 subdir('aspell')
 subdir('autotools')
 subdir('cmake')
diff --git a/testsuite/test-driver b/testsuite/test-driver
index 00cfbda..30893c4 100755
--- a/testsuite/test-driver
+++ b/testsuite/test-driver
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 set -e
+shopt -s extglob
 
 test=$1
 
@@ -12,8 +13,22 @@ esac
 test -d ${top_builddir}/testsuite/$test || mkdir -p ${top_builddir}/testsuite/$test
 cd ${top_builddir}/testsuite/$test
 
-cp -f ${top_srcdir}/testsuite/$test/* .
+cp -f ${top_srcdir}/testsuite/$test/!(hints) .
 
 DISTDIR=${DISTDIR} ${top_builddir}/bin/cygport-inplace *.cygport clean get all
 
+# compare hints
+for hint in $(find -name \*.hint)
+do
+    if [ -a ${top_srcdir}/testsuite/$test/hints/$hint ];
+    then
+        diff -u ${top_srcdir}/testsuite/$test/hints/$hint $hint
+# uncomment to create the expected hint file for use in future testing
+#    else
+#        mkdir -p $(dirname ${top_srcdir}/testsuite/$test/hints/$hint)
+#        cp $hint ${top_srcdir}/testsuite/$test/hints/$hint
+    fi
+done
+
+# compare filelist
 cmp ${top_srcdir}/testsuite/$test/*.list <(${top_builddir}/bin/cygport-inplace *.cygport list)
--
2.21.0

Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 2/2] Add provides: and conflicts: hints

Jon TURNEY
In reply to this post by Jon TURNEY
Add the ability to specify provides: and conflicts: hints in the
cygport.
---
 lib/pkg_pkg.cygpart                           | 74 ++++++++++++++++++-
 .../libmultiple1/libmultiple1-3.14-1.hint     |  2 +
 testsuite/hints/multiple/multiple.cygport     |  2 +
 .../dist/single/single-2.3.4-1.hint           |  2 +
 testsuite/hints/single/single.cygport         |  2 +
 5 files changed, 80 insertions(+), 2 deletions(-)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 2566190..753de9e 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -648,12 +648,56 @@ __pkg_dist() {
 #  package replaces.  An empty package will be created for each listed
 #  obsoletion which will cause PKG to be installed in its place.
 #
-#  Note that the PKG_REQUIRES name is descriptive rather than literal,
+#  Note that the PKG_OBSOLETES name is descriptive rather than literal,
 #  where "PKG" should be substituted with the name of the binary package
 #  whose contents it describes.  When a package contains a character which
 #  cannot be used in a shell variable name (namely '+', '-', and '.'),
 #  that character must be substituted with an underscore ('_'), e.g.
 #  libfoo-devel will use libfoo_devel_OBSOLETES.
+#****
+#****v* Packaging/PROVIDES
+#  DESCRIPTION
+#  A single-line string containing a list of names which this package also
+#  provides.
+#  NOTE
+#  If there is more than one package in PKG_NAMES, this variable will be
+#  ignored; you must use PKG_PROVIDES instead.
+#  SEE ALSO
+#  PKG_PROVIDES
+#****
+#****v* Packaging/PKG_PROVIDES
+#  DESCRIPTION
+#  A single-line string containing a list of names which this package also
+#  provides.
+#
+#  Note that the PKG_PROVIDES name is descriptive rather than literal,
+#  where "PKG" should be substituted with the name of the binary package
+#  whose contents it describes.  When a package contains a character which
+#  cannot be used in a shell variable name (namely '+', '-', and '.'),
+#  that character must be substituted with an underscore ('_'), e.g.
+#  libfoo-devel will use libfoo_devel_PROVIDES.
+#****
+#****v* Packaging/CONFLICTS
+#  DESCRIPTION
+#  A single-line string containing a comma-separated list of packages, possibly
+#  with version relations which this package conflicts with.
+#  NOTE
+#  If there is more than one package in PKG_NAMES, this variable will be
+#  ignored; you must use PKG_CONFLICTS instead.
+#  SEE ALSO
+#  PKG_CONFLICTS
+#****
+#****v* Packaging/PKG_CONFLICTS
+#  DESCRIPTION
+#  A single-line string containing a comma-separated list of packages, possibly
+#  with version relations which this package conflicts with.
+#
+#  Note that the PKG_CONFLICTS name is descriptive rather than literal,
+#  where "PKG" should be substituted with the name of the binary package
+#  whose contents it describes.  When a package contains a character which
+#  cannot be used in a shell variable name (namely '+', '-', and '.'),
+#  that character must be substituted with an underscore ('_'), e.g.
+#  libfoo-devel will use libfoo_devel_CONFLICTS.
 #****
 
  n=0;
@@ -665,6 +709,8 @@ __pkg_dist() {
  pkg_description_var=${pkg_name[${n}]//[-+\.]/_}_DESCRIPTION;
  pkg_message_var=${pkg_name[${n}]//[-+\.]/_}_MESSAGE;
  pkg_obsoletes_var=${pkg_name[${n}]//[-+\.]/_}_OBSOLETES;
+ pkg_provides_var=${pkg_name[${n}]//[-+\.]/_}_PROVIDES;
+ pkg_conflicts_var=${pkg_name[${n}]//[-+\.]/_}_CONFLICTS;
  dbg_obsoletes_var=${PN//[-+\.]/_}_debuginfo_OBSOLETES;
 
  case ${pkg_name[${n}]} in
@@ -672,7 +718,7 @@ __pkg_dist() {
  *)      distsubdir=${pkg_name[${n}]} ;;
  esac
 
- # allow REQUIRES and OBSOLETES only for single packages
+ # allow REQUIRES, OBSOLETES etc. only for single packages
  if [ -z "${distsubdir}${!pkg_requires_var}" -a -n "${REQUIRES+yes}" ]
  then
  declare ${pkg_requires_var}="${REQUIRES}"
@@ -681,6 +727,15 @@ __pkg_dist() {
  then
  declare ${pkg_obsoletes_var}="${OBSOLETES}"
  fi
+ if [ -z "${distsubdir}${!pkg_provides_var}" -a -n "${PROVIDES+yes}" ]
+ then
+ declare ${pkg_provides_var}="${PROVIDES}"
+ fi
+
+ if [ -z "${distsubdir}${!pkg_conflicts_var}" -a -n "${CONFLICTS+yes}" ]
+ then
+ declare ${pkg_conflicts_var}="${CONFLICTS}"
+ fi
 
  if [ -f ${C}/${pkg_hint[${n}]%.hint}.hint ]
  then
@@ -710,6 +765,21 @@ _EOF
 obsoletes: ${!pkg_obsoletes_var}
 _EOF
  fi
+
+ if [ -n "${!pkg_provides_var}" ]
+ then
+ cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
+provides: ${!pkg_provides_var}
+_EOF
+ fi
+
+ if [ -n "${!pkg_conflicts_var}" ]
+ then
+ cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
+conflicts: ${!pkg_conflicts_var}
+_EOF
+ fi
+
  if defined distsubdir
  then
  cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
diff --git a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
index 989bfb1..90f0f57 100644
--- a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
+++ b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
@@ -2,5 +2,7 @@ category: Base
 requires:  cygwin
 sdesc: "Summary of hints for multiple package test"
 ldesc: "Description of hints for multiple package test"
+provides: also-provides
+conflicts: conflicts-with
 external-source: multiple
 
diff --git a/testsuite/hints/multiple/multiple.cygport b/testsuite/hints/multiple/multiple.cygport
index b269ff5..ab6ade9 100644
--- a/testsuite/hints/multiple/multiple.cygport
+++ b/testsuite/hints/multiple/multiple.cygport
@@ -13,6 +13,8 @@ multiple_CATEGORY="Base"
 libmultiple1_CONTENTS=""
 libmultiple1_CATEGORY="Base"
 libmultiple1_REQUIRES="cygwin"
+libmultiple1_PROVIDES="also-provides"
+libmultiple1_CONFLICTS="conflicts-with"
 
 libmultiple_devel_CONTENTS="usr/include"
 libmultiple_devel_CATEGORY="Devel"
diff --git a/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
index aa534a0..a59628c 100644
--- a/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
+++ b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
@@ -3,4 +3,6 @@ requires:  cygwin
 sdesc: "Summary of hints for single package test"
 ldesc: "Description of hints for single package test"
 obsoletes: obsoleted-by-single
+provides: also-provides
+conflicts: conflicts-with
 
diff --git a/testsuite/hints/single/single.cygport b/testsuite/hints/single/single.cygport
index fca0706..9908a70 100644
--- a/testsuite/hints/single/single.cygport
+++ b/testsuite/hints/single/single.cygport
@@ -7,6 +7,8 @@ DESCRIPTION="Description of hints for single package test"
 CATEGORY="Base"
 REQUIRES="cygwin"
 OBSOLETES="obsoleted-by-single"
+PROVIDES="also-provides"
+CONFLICTS="conflicts-with"
 
 src_compile() {
   :
--
2.21.0