Hello community,

here is the log from the commit of package createrepo_c for openSUSE:Factory 
checked in at 2017-03-12 20:04:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/createrepo_c (Old)
 and      /work/SRC/openSUSE:Factory/.createrepo_c.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "createrepo_c"

Sun Mar 12 20:04:46 2017 rev:4 rq:477979 version:0.10.0.git20170131.04828e6

Changes:
--------
--- /work/SRC/openSUSE:Factory/createrepo_c/createrepo_c.changes        
2016-11-01 09:59:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.createrepo_c.new/createrepo_c.changes   
2017-03-12 20:04:47.351056704 +0100
@@ -1,0 +2,19 @@
+Sun Feb 19 12:57:21 UTC 2017 - ngomp...@gmail.com
+
+- Enable Python bindings for openSUSE Leap.
+
+-------------------------------------------------------------------
+Sun Feb 19 02:27:30 UTC 2017 - ngomp...@gmail.com
+
+- Enable Python bindings for openSUSE Tumbleweed.
+
+-------------------------------------------------------------------
+Wed Feb  8 17:42:57 UTC 2017 - ngomp...@gmail.com
+
+- Updated upstream sources
+- Removed patch 
000-Ensure_that_provides-requires_versions_are_factored_into_dep_filtering.diff
+  (upstream included equal patch)
+- Added missing copyright statements
+- Fixed license tag and other misc cleanups
+
+-------------------------------------------------------------------

Old:
----
  
000-Ensure_that_provides-requires_versions_are_factored_into_dep_filtering.diff
  createrepo_c-0.10.0.git20160929.547b5db.tar.gz

New:
----
  createrepo_c-0.10.0.git20170131.04828e6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ createrepo_c.spec ++++++
--- /var/tmp/diff_new_pack.ldrDkc/_old  2017-03-12 20:04:48.062955968 +0100
+++ /var/tmp/diff_new_pack.ldrDkc/_new  2017-03-12 20:04:48.066955402 +0100
@@ -1,7 +1,8 @@
 #
 # spec file for package createrepo_c
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2015-2017 Neal Gompa <ngomp...@gmail.com>.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,21 +17,35 @@
 #
 
 
+# Enable Python bindings selectively
+%if (0%{?suse_version} == 1315 && 0%{?is_opensuse}) || 0%{?leap_version} || 
0%{?suse_version} >= 1330
+# Python bindings are enabled for openSUSE Leap and Tumbleweed
+%bcond_without python
+%bcond_without python3
+%else
+# Python bindings are disabled for older SUSE
+%bcond_with python
+%bcond_with python3
+%endif
+
+# Enable enhanced DeltaRPM support
+%bcond_with drpm
+
 %define major 0
 %define libname lib%{name}%{major}
 %define devname lib%{name}-devel
 
-%define version_unconverted 0.10.0.git20160929.547b5db
+%define version_unconverted 0.10.0.git20170131.04828e6
 
 Name:           createrepo_c
 Summary:        Creates a common metadata repository
-License:        GPL-2.0
+License:        GPL-2.0+
 Group:          System/Packages
-Version:        0.10.0.git20160929.547b5db
+Version:        0.10.0.git20170131.04828e6
 Release:        0
 Url:            https://github.com/rpm-software-management/createrepo_c
 Source0:        %{name}-%{version}.tar.gz
-Patch0:         
000-Ensure_that_provides-requires_versions_are_factored_into_dep_filtering.diff
+
 BuildRequires:  bash-completion
 
 %if 0%{?suse_version} >= 1330 
@@ -51,6 +66,17 @@
 BuildRequires:  rpm-devel >= 4.9.0
 BuildRequires:  sqlite3-devel
 BuildRequires:  zlib-devel
+%if %{with python}
+BuildRequires:  python-devel
+BuildRequires:  python-nose
+%if %{with python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-nose
+%endif
+%endif
+%if %{with drpm}
+BuildRequires:  drpm-devel
+%endif
 
 Requires:       %{libname} = %{version}-%{release}
 
@@ -65,9 +91,9 @@
 
 %package -n %{libname}
 Summary:        Library for repodata manipulation
-Group:          System/Libraries
 # The function to create DeltaRPMs calls /usr/bin/makedeltarpm,
 # which is part of the 'deltarpm' package
+Group:          System/Libraries
 Requires:       deltarpm
 
 %description -n %{libname}
@@ -85,9 +111,29 @@
 This package contains the createrepo_c C library and header files.
 These development files are for easy manipulation with a repodata.
 
+%if %{with python}
+%package -n python2-%{name}
+Summary:        Python 2 bindings for the createrepo_c library
+Group:          Development/Libraries/Python
+Provides:       python-%{name} = %{version}-%{release}
+Requires:       %{libname} = %{version}-%{release}
+
+%description -n python2-createrepo_c
+Python 2 bindings for the createrepo_c library.
+
+%if %{with python3}
+%package -n python3-%{name}
+Summary:        Python 3 bindings for the createrepo_c library
+Group:          Development/Libraries/Python
+Requires:       %{libname} = %{version}-%{release}
+
+%description -n python3-createrepo_c
+Python 3 bindings for the createrepo_c library.
+%endif
+%endif
+
 %prep
 %setup -q
-%patch0 -p1
 
 %if %{with python3}
 rm -rf py3
@@ -95,21 +141,40 @@
 %endif
 
 %build
-%cmake -DENABLE_LEGACY_WEAKTAGS=1 -DENABLE_DRPM=OFF -DENABLE_PYTHON=OFF
+%cmake -DENABLE_LEGACY_WEAKTAGS=1 %{!?with_drpm:-DENABLE_DRPM=OFF} 
%{!?with_python:-DENABLE_PYTHON=OFF}
 make %{?_smp_mflags}
 make doc-c
 
-%check
-pushd ./build
-make tests
-make ARGS="-V" test
+%if %{with python}
+%if %{with python3}
+pushd ../py3
+%cmake -DPYTHON_DESIRED:str=3 ../../
+make %{?_smp_mflags}
 popd
+%endif
+%endif
+
+%check
+make tests -C build
+make ARGS="-V" test -C build
+
+%if %{with python}
+%if %{with python3}
+make tests -C py3/build
+make ARGS="-V" test -C py3/build
+%endif
+%endif
 
 %install
-pushd ./build
-%make_install
-popd
-%fdupes %buildroot/%_prefix
+%make_install -C build
+
+%if %{with python}
+%if %{with python3}
+%make_install -C py3/build
+%endif
+%endif
+
+%fdupes %{buildroot}%{_prefix}
 
 %post -n %{libname} -p /sbin/ldconfig
 
@@ -117,10 +182,10 @@
 
 %files
 %doc README.md COPYING
-%_mandir/man8/createrepo_c.8.*
-%_mandir/man8/mergerepo_c.8.*
-%_mandir/man8/modifyrepo_c.8.*
-%_mandir/man8/sqliterepo_c.8.*
+%{_mandir}/man8/createrepo_c.8*
+%{_mandir}/man8/mergerepo_c.8*
+%{_mandir}/man8/modifyrepo_c.8*
+%{_mandir}/man8/sqliterepo_c.8*
 %{_datadir}/bash-completion/completions/
 %{_bindir}/createrepo_c
 %{_bindir}/mergerepo_c
@@ -133,9 +198,21 @@
 %{_libdir}/libcreaterepo_c.so.%{major}.*
 
 %files -n %{devname}
+%doc build/doc/html COPYING
 %{_libdir}/libcreaterepo_c.so
 %{_libdir}/pkgconfig/createrepo_c.pc
 %{_includedir}/createrepo_c/
-%doc build/doc/html COPYING
+
+%if %{with python}
+%files -n python2-%{name}
+%doc COPYING
+%{python_sitearch}/createrepo_c/
+
+%if %{with python3}
+%files -n python3-%{name}
+%doc COPYING
+%{python3_sitearch}/createrepo_c/
+%endif
+%endif
 
 %changelog

++++++ createrepo_c-0.10.0.git20160929.547b5db.tar.gz -> 
createrepo_c-0.10.0.git20170131.04828e6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/createrepo_c-0.10.0.git20160929.547b5db/src/parsehdr.c 
new/createrepo_c-0.10.0.git20170131.04828e6/src/parsehdr.c
--- old/createrepo_c-0.10.0.git20160929.547b5db/src/parsehdr.c  2016-09-29 
08:49:45.000000000 +0200
+++ new/createrepo_c-0.10.0.git20170131.04828e6/src/parsehdr.c  2017-01-31 
10:07:14.000000000 +0100
@@ -319,7 +319,10 @@
     };
 
     // Hastable with filenames from provided
-    GHashTable *provided_hashtable = g_hash_table_new(g_str_hash, g_str_equal);
+    GHashTable *provided_hashtable = g_hash_table_new_full(g_str_hash,
+                                                           g_str_equal,
+                                                           g_free,
+                                                           NULL);
 
     // Hashtable with already processed files from requires
     GHashTable *ap_hashtable = g_hash_table_new_full(g_str_hash,
@@ -350,6 +353,12 @@
                 const char *flags = cr_flag_to_str(num_flags);
                 const char *full_version = rpmtdGetString(fileversions);
 
+                _cleanup_free_ char *depnfv = NULL;  // Dep NameFlagsVersion
+                depnfv = g_strconcat(filename,
+                                     flags ? flags : "",
+                                     full_version ? full_version : "",
+                                     NULL);
+
                 // Requires specific stuff
                 if (deptype == DEP_REQUIRES) {
                     // Skip requires which start with "rpmlib("
@@ -358,14 +367,14 @@
                     }
 
                     // Skip package primary files
-                    if (g_hash_table_lookup_extended(filenames_hashtable, 
filename, NULL, NULL)) {
+                    if (*filename == '/' && 
g_hash_table_lookup_extended(filenames_hashtable, filename, NULL, NULL)) {
                         if (cr_is_primary(filename)) {
                             continue;
                         }
                     }
 
                     // Skip files which are provided
-                    if (g_hash_table_lookup_extended(provided_hashtable, 
filename, NULL, NULL)) {
+                    if (g_hash_table_lookup_extended(provided_hashtable, 
depnfv, NULL, NULL)) {
                         continue;
                     }
 
@@ -412,10 +421,12 @@
                 g_free(evr);
 
                 switch (deptype) {
-                    case DEP_PROVIDES:
-                        g_hash_table_replace(provided_hashtable, 
dependency->name, dependency->name);
+                    case DEP_PROVIDES: {
+                        char *depnfv_dup = g_strdup(depnfv);
+                        g_hash_table_replace(provided_hashtable, depnfv_dup, 
NULL);
                         pkg->provides = g_slist_prepend(pkg->provides, 
dependency);
                         break;
+                    }
                     case DEP_CONFLICTS:
                         pkg->conflicts = g_slist_prepend(pkg->conflicts, 
dependency);
                         break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/createrepo_c-0.10.0.git20160929.547b5db/src/python/updaterecord-py.c 
new/createrepo_c-0.10.0.git20170131.04828e6/src/python/updaterecord-py.c
--- old/createrepo_c-0.10.0.git20160929.547b5db/src/python/updaterecord-py.c    
2016-09-29 08:49:45.000000000 +0200
+++ new/createrepo_c-0.10.0.git20170131.04828e6/src/python/updaterecord-py.c    
2017-01-31 10:07:14.000000000 +0100
@@ -272,14 +272,14 @@
     if (str == NULL)
         Py_RETURN_NONE;
 
-    struct tm *dt = malloc(sizeof(struct tm));
+    struct tm *dt = g_malloc0(sizeof(struct tm));
     char *res = strptime(str, "%Y-%m-%d %H:%M:%S", dt);
     if (res == NULL) {
-        memset(res,0,sizeof(dt));
+        memset(dt, 0, sizeof(struct tm));
         res = strptime(str, "%Y-%m-%d", dt);
         if (res == NULL)
            PyErr_SetString(CrErr_Exception, "Invalid date");
-        }
+    }
     PyObject *py_dt = PyDateTime_FromDateAndTime(dt->tm_year + 1900,
                                       dt->tm_mon + 1, dt->tm_mday,
                                       dt->tm_hour, dt->tm_min, dt->tm_sec, 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/createrepo_c-0.10.0.git20160929.547b5db/src/repomd.c 
new/createrepo_c-0.10.0.git20170131.04828e6/src/repomd.c
--- old/createrepo_c-0.10.0.git20160929.547b5db/src/repomd.c    2016-09-29 
08:49:45.000000000 +0200
+++ new/createrepo_c-0.10.0.git20170131.04828e6/src/repomd.c    2017-01-31 
10:07:14.000000000 +0100
@@ -682,6 +682,14 @@
                      cr_RepomdRecord *record)
 {
     if (!repomd || !record) return;
+
+    cr_RepomdRecord *delrec = NULL;
+    // Remove all existing record of the same type
+    while((delrec = cr_repomd_get_record(repomd, record->type)) != NULL) {
+       cr_repomd_detach_record(repomd, delrec);
+       cr_repomd_record_free(delrec);
+    }
+
     repomd->records = g_slist_append(repomd->records, record);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/createrepo_c-0.10.0.git20160929.547b5db/tests/python/tests/test_repomd.py 
new/createrepo_c-0.10.0.git20170131.04828e6/tests/python/tests/test_repomd.py
--- 
old/createrepo_c-0.10.0.git20160929.547b5db/tests/python/tests/test_repomd.py   
    2016-09-29 08:49:45.000000000 +0200
+++ 
new/createrepo_c-0.10.0.git20170131.04828e6/tests/python/tests/test_repomd.py   
    2017-01-31 10:07:14.000000000 +0100
@@ -99,6 +99,10 @@
 
         self.assertEqual(len(md.records), 1)
 
+        md.set_record(rec)
+
+        self.assertEqual(len(md.records), 1)
+
         md.repoid = None
         md.contenthash = None
 


Reply via email to