diff options
author | Māris Vilks | 2021-02-14 16:56:11 +0200 |
---|---|---|
committer | Māris Vilks | 2021-02-14 16:56:11 +0200 |
commit | 1364f836ccce85e8e03e1d63bf89d3001a93c647 (patch) | |
tree | fe50fd37bc05623995f6c4d1b0474e7635e1e13b /dpkg | |
parent | 53dd82e75fbf6cb1bbb60418fc9e861e8bc0814b (diff) | |
download | aur-1364f836ccce85e8e03e1d63bf89d3001a93c647.tar.gz |
Dpkg drop in; some patches
Diffstat (limited to 'dpkg')
-rwxr-xr-x | dpkg | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -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" |