rpms/pkgconfig/devel pkgconfig-0.15.0-reqprov.patch, NONE, 1.1 pkgconfig.spec, 1.15, 1.16

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Mar 30 16:25:03 UTC 2005


Update of /cvs/dist/rpms/pkgconfig/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv14658

Modified Files:
	pkgconfig.spec 
Added Files:
	pkgconfig-0.15.0-reqprov.patch 
Log Message:
Add --print-provides and --print-requires commandline options


pkgconfig-0.15.0-reqprov.patch:
 main.c |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+)

--- NEW FILE pkgconfig-0.15.0-reqprov.patch ---
diff -ur pkgconfig-0.15.0/main.c pkgconfig-0.15.0/main.c
--- pkgconfig-0.15.0/main.c	2005-02-02 19:12:20.327992745 -0500
+++ pkgconfig-0.15.0/main.c	2005-02-02 19:15:45.784804237 -0500
@@ -173,6 +173,8 @@
   static int want_uninstalled = 0;
   static char *variable_name = NULL;
   static int want_exists = 0;
+  static int want_prov = 0;
+  static int want_req = 0;
   static char *required_atleast_version = NULL;
   static char *required_exact_version = NULL;
   static char *required_max_version = NULL;
@@ -244,6 +246,10 @@
     { "msvc-syntax", 0, POPT_ARG_NONE, &msvc_syntax, 0,
       "output -l and -L flags for the Microsoft compiler (cl)" },
 #endif
+    { "print-provides", 0, POPT_ARG_NONE, &want_prov, 0,
+      "print which packages the package provides" },
+    { "print-requires", 0, POPT_ARG_NONE, &want_req, 0,
+      "print which packages the package requires" },
     POPT_AUTOHELP
     { NULL, 0, 0, NULL, 0 }
   };
@@ -521,6 +527,47 @@
         }
     }
 
+  if (want_prov)
+    {
+      GSList *tmp;
+      tmp = packages;
+      while (tmp != NULL)
+        {
+          Package *pkg = tmp->data;
+          char *key;
+          key = pkg->key;
+          while (*key == '/')
+            key++;
+          if (strlen(key) > 0)
+            printf ("%s = %s\n", key, pkg->version);
+          tmp = g_slist_next (tmp);
+        }
+    }
+
+  if (want_req)
+    {
+      GSList *pkgtmp = packages;
+      while (pkgtmp != NULL)
+        {
+          Package *pkg = pkgtmp->data;
+          GSList *reqtmp = pkg->requires;
+          while (reqtmp != NULL)
+            {
+              Package *deppkg = reqtmp->data;
+              RequiredVersion *req;
+              req = g_hash_table_lookup(pkg->required_versions, deppkg->key);
+              if ((req == NULL) || (req->comparison == ALWAYS_MATCH))
+                printf ("%s\n", deppkg->key);
+              else
+                printf ("%s %s %s\n", deppkg->key,
+                        comparison_to_str(req->comparison),
+                        req->version);
+              reqtmp = g_slist_next (reqtmp);
+            }
+          pkgtmp = g_slist_next (pkgtmp);
+        }
+    }
+
   if (required_exact_version)
     {
       Package *pkg = packages->data;


Index: pkgconfig.spec
===================================================================
RCS file: /cvs/dist/rpms/pkgconfig/devel/pkgconfig.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- pkgconfig.spec	7 Mar 2005 14:47:08 -0000	1.15
+++ pkgconfig.spec	30 Mar 2005 16:25:01 -0000	1.16
@@ -1,7 +1,7 @@
 Summary: A tool for determining compilation options.
 Name: pkgconfig
 Version: 0.15.0
-Release: 5
+Release: 6
 Epoch: 1
 License: GPL
 Group: Development/Tools
@@ -14,6 +14,7 @@
 Patch3:  pkgconfig-0.15.0-quote.patch
 # https://bugs.freedesktop.org/show_bug.cgi?id=2661 
 Patch4:  pkgconfig-0.15.0-overflow.patch
+Patch5:  pkgconfig-0.15.0-reqprov.patch
 BuildRoot: %{_tmppath}/%{name}-root
 
 %description
@@ -27,6 +28,7 @@
 %patch2 -p1 -b .datadir
 %patch3 -p1 -b .quote
 %patch4 -p1 -b .overflow
+%patch5 -p1 -b .reqprov
 autoheader-2.13
 autoconf-2.13
 automake-1.4
@@ -52,6 +54,9 @@
 %{_datadir}/aclocal/*
 
 %changelog
+* Wed Mar 30 2005 Matthias Clasen <mclasen at redhat.com> 1:0.15.0-6
+- add --print-requires and --print-provide options
+
 * Mon Mar  7 2005 Matthias Clasen <mclasen at redhat.com> 1:0.15.0-5
 - fix an overflow
 




More information about the fedora-cvs-commits mailing list