summarylogtreecommitdiffstats
path: root/dpkg
diff options
context:
space:
mode:
Diffstat (limited to 'dpkg')
-rwxr-xr-xdpkg36
1 files changed, 36 insertions, 0 deletions
diff --git a/dpkg b/dpkg
new file mode 100755
index 000000000000..e9ebba4de1e6
--- /dev/null
+++ b/dpkg
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+##
+# NOTES by kaaposc@gmail.com
+#
+# Plain dumb Debian's dpkg replacement just for eparakstitajs3 package
+# version checking. Uses pacman to get info on the package and prints
+# out stripped down package info.
+#
+# Judging by verbose eparakstitajs3 output it tries to call
+# `dpkg -s package-name`
+# to see if needed packages are installed and up to date. It seems to look
+# for Version: and Status: lines, so we print them out.
+#
+##
+
+usage() {
+ echo 'dpkg -s <pkg-name>'
+ exit 1
+}
+
+if [ -z "$1" ] || [ "$1" != "-s" ] || [ -z "$2" ]; then usage; fi
+
+out=$(pacman -Qi $2 2>&1)
+
+if [ $? -ne 0 ]; then
+ echo "Package $2 not found."
+ exit 1
+fi
+
+name=$(echo "$out" | grep -e '^Name' | awk '{print $3}')
+version=$(echo "$out" | grep -e '^Version' | awk '{print $3}')
+
+echo "Package: $name"
+echo "Version: $version"
+echo "Status: install ok installed"