Add qpkg.

This commit is contained in:
Faerbit 2018-09-15 10:36:47 +02:00
parent 06522db0aa
commit 9ace44f799
3 changed files with 27 additions and 0 deletions

View File

@ -13,5 +13,6 @@ help:
install:
install -d -m 755 $(DESTDIR)$(BINDIR)
install -m 755 src/cpkg $(DESTDIR)$(BINDIR)
install -m 755 src/qpkg $(DESTDIR)$(BINDIR)
install -m 755 src/ipkg $(DESTDIR)$(BINDIR)
install -m 755 src/rpkg $(DESTDIR)$(BINDIR)

View File

@ -10,6 +10,7 @@ something useful.
* zstd
* tar
* coreutils
* findutils
## Installation
``` bash
@ -28,6 +29,10 @@ mkdir /pkg # folder for storing packages
cd build_dir/of/foo
cpkg make install # DESTDIR is set by cpkg
```
**q**ist **p**ac**k**a**g**e version:
``` bash
qpkg foo
```
**i**nstall **p**ac**k**a**g**e:
``` bash

21
src/qpkg Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
PKGDIR="${FPKG_ROOT}/pkg"
if [ $# -ne 1 ]
then
echo "Did not specify exactly one argument"
exit 1
fi
version=$(find $PKGDIR -regex ".*/$1-[a-z.0-9]*.tar.zst" -type f -printf "%f\n" | sort -V | tail -n 1)
if [ "$version" = "" ]
then
echo "Package not found"
exit 1
else
version=${version##*-}
version=${version%.tar.zst}
echo $version
fi