diff --git a/InstallAppdata.sh b/InstallAppdata.sh
deleted file mode 100644
index d8b883c..0000000
--- a/InstallAppdata.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) 2014 Dominique Leuenberger, Amsterdam, The Netherlands
-# 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.
-
-
-RPMMD=/repodata
-YAST2=/suse/setup/descr
-
-# 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
-while ([ "$1" = "-R" ]); do
- case $4 in
- rpm-md)
- if appstream-util validate-relax --nonet "$6$RPMMD/"*appdata.xml.gz 2>&1 > /dev/null; then
- appstream-util install-origin "$2" "$6$RPMMD/"*appdata.xml.gz "$6$RPMMD/"*app-icons.tar.gz 2>&1 > /dev/null
- fi
- ;;
- yast2)
- # We do not validate an appdata.xml.gz in a yast2 repo: those are created by appstream-builder, and we can trust them
- #if appstream-util validate-relax --nonet "$6$YAST2/appdata.xml.gz" 2>&1 > /dev/null; then
- # get the real appdata.xml.gz file name out of content
- APPDATA=$(awk '/appdata.*xml.gz/ && !/failed|ignore/ {print $4}' "$6/content")
- appstream-util install-origin "$2" "$6$YAST2/${APPDATA}" "$6$YAST2/"appdata-icons*.tar.gz 2>&1 > /dev/null
- #fi
- ;;
- *)
- echo "unknown repo type - Appstream data not considered"
- esac
- 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
-
diff --git a/_service b/_service
index f802abe..ca20889 100644
--- a/_service
+++ b/_service
@@ -2,6 +2,7 @@
https://github.com/DimStar77/openSUSE-appstream.git
git
+ enable
1.0.1+git.%cd
diff --git a/_servicedata b/_servicedata
new file mode 100644
index 0000000..0b5fdf5
--- /dev/null
+++ b/_servicedata
@@ -0,0 +1,4 @@
+
+
+ https://github.com/DimStar77/openSUSE-appstream.git
+ 58e1e4e128dfe67484342418afcc61efe6e592bf
\ No newline at end of file
diff --git a/libzypp-plugin-appdata.changes b/libzypp-plugin-appdata.changes
index da60485..0619521 100644
--- a/libzypp-plugin-appdata.changes
+++ b/libzypp-plugin-appdata.changes
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Wed Mar 21 19:15:14 UTC 2018 - dimstar@opensuse.org
+
+- 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).
+
-------------------------------------------------------------------
Wed Feb 28 16:36:57 UTC 2018 - dimstar@opensuse.org
diff --git a/libzypp-plugin-appdata.spec b/libzypp-plugin-appdata.spec
index 77118e2..8ea83d5 100644
--- a/libzypp-plugin-appdata.spec
+++ b/libzypp-plugin-appdata.spec
@@ -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 @@ This package contains extra appstream metadata to be used by appstream-builder
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 @@ install -Dm 0755 %{SOURCE2} %{buildroot}%{_prefix}/lib/zypp/plugins/appdata/$(ba
%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/
diff --git a/openSUSE-appstream-1.0.1+git.20170629.tar.xz b/openSUSE-appstream-1.0.1+git.20170629.tar.xz
deleted file mode 100644
index 0fd1887..0000000
--- a/openSUSE-appstream-1.0.1+git.20170629.tar.xz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:096322515588a52dfb6b382889ca28bc8127bc3b2cdf1abee67f27573d5fdf0e
-size 89260
diff --git a/openSUSE-appstream-1.0.1+git.20180321.tar.xz b/openSUSE-appstream-1.0.1+git.20180321.tar.xz
new file mode 100644
index 0000000..0a97b5b
--- /dev/null
+++ b/openSUSE-appstream-1.0.1+git.20180321.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9d4a955125b1b5462902b5a50a31203e749c866c4160e42052166f8b91dd77c8
+size 90984