summarylogtreecommitdiffstats
path: root/dpkg
diff options
context:
space:
mode:
authorMāris Vilks2021-02-14 16:56:11 +0200
committerMāris Vilks2021-02-14 16:56:11 +0200
commit1364f836ccce85e8e03e1d63bf89d3001a93c647 (patch)
treefe50fd37bc05623995f6c4d1b0474e7635e1e13b /dpkg
parent53dd82e75fbf6cb1bbb60418fc9e861e8bc0814b (diff)
downloadaur-1364f836ccce85e8e03e1d63bf89d3001a93c647.tar.gz
Dpkg drop in; some patches
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"