From 785e54b3112e96f34ac026cec15385d22574bcc2 Mon Sep 17 00:00:00 2001
From: Daniel Heule <hda@sfs.biz>
Date: Wed, 11 Dec 2013 13:44:01 +0100
Subject: [PATCH] =?UTF-8?q?vorbereitung=20um=20mit=20zypper=20auch=20spezi?=
 =?UTF-8?q?fische=20versionen=20zu=20unterst=C3=BCtzen=20parameter=20ptype?=
 =?UTF-8?q?=20auch=20beim=20package=20type=20zulassen,=20analog=20anderer?=
 =?UTF-8?q?=20parameter=20von=20subtypes=20...?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 cdist/conf/type/__package/parameter/optional          | 1 +
 cdist/conf/type/__package_zypper/explorer/pkg_version | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/cdist/conf/type/__package/parameter/optional b/cdist/conf/type/__package/parameter/optional
index 9982507e..5a89ffc6 100644
--- a/cdist/conf/type/__package/parameter/optional
+++ b/cdist/conf/type/__package/parameter/optional
@@ -3,3 +3,4 @@ version
 type
 pkgsite
 state
+pstate
diff --git a/cdist/conf/type/__package_zypper/explorer/pkg_version b/cdist/conf/type/__package_zypper/explorer/pkg_version
index 64fd64c0..aaa1da89 100644
--- a/cdist/conf/type/__package_zypper/explorer/pkg_version
+++ b/cdist/conf/type/__package_zypper/explorer/pkg_version
@@ -35,11 +35,14 @@ else
 fi
 
 case "$ptype" in
-    package|patch|pattern|product|srcpackage)
-        zypper se --match-exact -i -t "$ptype" "$name" | grep -E '^i' | cut -d " " -f 3 || true
+    package)
+        zypper search --details --match-exact --installed-only --type "$ptype" "$name" | grep -E '^i' | cut -d " " -f 3,7 || true
+    ;;
+    patch|pattern|product|srcpackage)
+        zypper search --match-exact --installed-only --type "$ptype" "$name" | grep -E '^i' | cut -d " " -f 3 || true
     ;;
     *)
-        echo "unknown type in __package_zypper explorer" &>2
+        echo "unknown ptype in __package_zypper explorer" &>2
         exit 1
     ;;
 esac