Hello community,

here is the log from the commit of package libzypp-plugin-appdata for 
openSUSE:Factory checked in at 2018-03-24 16:08:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libzypp-plugin-appdata (Old)
 and      /work/SRC/openSUSE:Factory/.libzypp-plugin-appdata.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libzypp-plugin-appdata"

Sat Mar 24 16:08:19 2018 rev:16 rq:590704 version:1.0.1+git.20180321

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/libzypp-plugin-appdata/libzypp-plugin-appdata.changes
    2018-03-08 10:50:24.392657590 +0100
+++ 
/work/SRC/openSUSE:Factory/.libzypp-plugin-appdata.new/libzypp-plugin-appdata.changes
       2018-03-24 16:08:20.906706308 +0100
@@ -1,0 +2,7 @@
+Wed Mar 21 19:15:14 UTC 2018 - [email protected]
+
+- Update to version 1.0.1+git.20180321:
+  * ZYpp AsHelper: install AS data into system cache: new python
+    helper to be a bit smarter (part of boo#996896).
+
+-------------------------------------------------------------------

Old:
----
  InstallAppdata.sh
  openSUSE-appstream-1.0.1+git.20170629.tar.xz

New:
----
  _servicedata
  openSUSE-appstream-1.0.1+git.20180321.tar.xz

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

Other differences:
------------------
++++++ libzypp-plugin-appdata.spec ++++++
--- /var/tmp/diff_new_pack.BH5sxx/_old  2018-03-24 16:08:21.742676171 +0100
+++ /var/tmp/diff_new_pack.BH5sxx/_new  2018-03-24 16:08:21.742676171 +0100
@@ -17,22 +17,22 @@
 
 
 Name:           libzypp-plugin-appdata
-Version:        1.0.1+git.20170629
+Version:        1.0.1+git.20180321
 Release:        0
 Summary:        Extend libzypp to handle AppStream metadata
 License:        MIT AND CC0-1.0
 Group:          System/Libraries
 URL:            https://wiki.gnome.org/Design/Apps/Software
 Source0:        openSUSE-appstream-%{version}.tar.xz
-Source2:        InstallAppdata.sh
 # appstreamcli is provided by the AppStream package
 Requires:       AppStream
 # appstream-glib >= 0.3.6 is the first to correctly to appstream-util 
uninstall in /var/cache
 Requires:       appstream-glib >= 0.3.6
-# The script uses awk to find the right filename for the appdata.xml.gz file
-Requires:       awk
 # appdata hook was introduced in libzypp 14.29.4
 Requires:       libzypp >= 14.29.4
+Requires:       python3-cmdln
+# AsHelper is a python program with few dependencies
+Requires:       python3-createrepo_c
 # This is one way of providing valid appstream metadata to applications 
(currently the only implemented one)
 Provides:       appstream-provider
 BuildArch:      noarch
@@ -60,8 +60,9 @@
 install -m 0755 -d %{buildroot}%{_datadir}/appdata-extra
 cp appdata-extra/*/* %{buildroot}%{_datadir}/appdata-extra/
 
-# Install AppData zypp plugin - temporarily disabled in favor of static 
AppStream metadata
-install -Dm 0755 %{SOURCE2} 
%{buildroot}%{_prefix}/lib/zypp/plugins/appdata/$(basename %{SOURCE2})
+# Install AppData zypp plugin
+install -Dm 0755 InstallAppdata.sh 
%{buildroot}%{_prefix}/lib/zypp/plugins/appdata/InstallAppdata.sh
+install -Dm 0755 AsHelper.py %{buildroot}%{_libexecdir}/AsHelper
 
 %files
 # zypp plugin triggering AppData update on repo refresh
@@ -69,6 +70,7 @@
 %dir %{_prefix}/lib/zypp/plugins
 %dir %{_prefix}/lib/zypp/plugins/appdata/
 %{_prefix}/lib/zypp/plugins/appdata/InstallAppdata.sh
+%{_libexecdir}/AsHelper
 
 %files -n openSUSE-appdata-extra
 %{_datadir}/appdata-extra/

++++++ _service ++++++
--- /var/tmp/diff_new_pack.BH5sxx/_old  2018-03-24 16:08:21.786674586 +0100
+++ /var/tmp/diff_new_pack.BH5sxx/_new  2018-03-24 16:08:21.786674586 +0100
@@ -2,6 +2,7 @@
   <service name="tar_scm" mode="disabled">
     <param 
name="url">https://github.com/DimStar77/openSUSE-appstream.git</param>
     <param name="scm">git</param>
+    <param name="changesgenerate">enable</param>
     <param name="versionformat">1.0.1+git.%cd</param>
   </service>
   <service name="recompress" mode="disabled">

++++++ _servicedata ++++++
<servicedata>
<service name="tar_scm">
                <param 
name="url">https://github.com/DimStar77/openSUSE-appstream.git</param>
              <param 
name="changesrevision">58e1e4e128dfe67484342418afcc61efe6e592bf</param></service></servicedata>++++++
 openSUSE-appstream-1.0.1+git.20170629.tar.xz -> 
openSUSE-appstream-1.0.1+git.20180321.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openSUSE-appstream-1.0.1+git.20170629/AsHelper.py 
new/openSUSE-appstream-1.0.1+git.20180321/AsHelper.py
--- old/openSUSE-appstream-1.0.1+git.20170629/AsHelper.py       1970-01-01 
01:00:00.000000000 +0100
+++ new/openSUSE-appstream-1.0.1+git.20180321/AsHelper.py       2018-03-21 
20:05:22.000000000 +0100
@@ -0,0 +1,86 @@
+#!/usr/bin/python3
+
+# Copyright (c) 2018 Dominique Leuenberger, Muhen, Switzerland
+
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import os
+import sys
+import cmdln
+import createrepo_c as cr
+
+RPMMD="repodata"
+YAST2="suse/setup/descr"
+CMD="appstream-util install-origin \"{NAME}\" \"{APPDATA}\" \"{ICONS}\""
+
+class AsInstall(cmdln.Cmdln):
+  """
+    ${name}
+            Helper to collect information about AppStream Metadata and install
+            them into the system cache. This helper is intended to be called 
by libzypp
+
+    ${option_list}
+
+    Currently there is only one command available: install
+  """
+
+  @cmdln.option("-R", dest="alias", help="The alias of the repository")
+  @cmdln.option("-t", dest="type", help="Repsitory type (rpm-md, yast2)")
+  @cmdln.option("-p", dest="path", help="base directory for this repositories 
cache")
+  def do_install(self, subcmd, opts):
+      """
+      ${cmd_name}: Helper to collect information about AppStream Metadata and 
install
+               them into the system cache. This helper is intended to be 
called by libzypp
+      ${cmd_usage}
+      ${cmd_option_list}
+      """
+      RET={}
+      if opts.type == "yast2":
+          ### yast2 type is 'easy': the files are called appdata.xml.gz and 
appddata-icons.tar.gz
+          ROOT=os.path.join(opts.path, YAST2)
+          RET = {'appdata': os.path.join(ROOT,'appdata.xml.gz'), 
'appdata-icons': os.path.join(ROOT,'appdata-icons.tar.gz')}
+          pass
+      elif opts.type == "rpm-md":
+          RET=self.parse_rpmmd(opts.path)
+          pass
+      else:
+          print("Repotype %s unknown" % opts.type)
+
+      if RET:
+          os.system(CMD.format(NAME=opts.alias, APPDATA=RET['appdata'], 
ICONS=RET['appdata-icons']))
+      else:
+          print("could not find appdata tarball and/or icons")
+
+  def parse_rpmmd(self, repopath):
+    repomd = cr.Repomd(os.path.join(repopath ,RPMMD, 'repomd.xml'))
+    RET={}
+    for datatype in ['primary', 'appdata', 'appdata-icons']:
+        try:
+            RET[datatype] = os.path.join(repopath, 
repomd[datatype].location_href)
+        except KeyError:
+            RET={}
+            break
+    return RET
+
+
+if __name__ == "__main__":
+    asinst = AsInstall()
+    sys.exit( asinst.main() )
+    
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-appstream-1.0.1+git.20170629/InstallAppdata.sh 
new/openSUSE-appstream-1.0.1+git.20180321/InstallAppdata.sh
--- old/openSUSE-appstream-1.0.1+git.20170629/InstallAppdata.sh 1970-01-01 
01:00:00.000000000 +0100
+++ new/openSUSE-appstream-1.0.1+git.20180321/InstallAppdata.sh 2018-03-21 
20:05:22.000000000 +0100
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# Copyright (c) 2014-2018 Dominique Leuenberger, Muhen, Switzerland
+# Copyright (c) 2016 Raymond Wooninck, Vienna, Austria
+
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+# Cleanup existing appdata found on the system
+for list in $(find /var/cache/app-info/xmls/*.xml.gz 2> /dev/null); do
+       appdata=$(basename ${list} .xml.gz)
+       appstream-util uninstall "${appdata}" 2>&1 > /dev/null
+done
+
+# Install new appdata files - libzypp calls us with 6 parameters per repo:
+# -R REPO_ALIAS -t REPO_TYPE -p REPO_METADATA_PATH [-R NEXT_REPO....]
+# We can just blindly pass the parameters through to to helper
+while ([ "$1" = "-R" ]); do
+  /usr/lib/AsHelper install $1 $2 $3 $4 $5 $6
+  shift 6
+done
+
+# Fixup icon that might have uncompressed with odd permissions
+chmod 755 /var/cache/app-info/icons/*
+
+# (Re)create the Xapian database required by the KDE tools
+appstreamcli refresh-cache


Reply via email to