Shifting tracking of package metadata mostly to git; cleaning depends; efficiency update in testing

This commit is contained in:
DarkFeather 2019-05-10 16:21:14 -05:00
parent 7376f12a27
commit 216021b633
5 changed files with 25 additions and 25 deletions

2
.gitignore vendored
View File

@ -1,7 +1,7 @@
HelloWorld HelloWorld
HelloWorld.class HelloWorld.class
HelloWorld.exe HelloWorld.exe
tests/__pycache__/* tests/__pycache__
*.tar.xz *.tar.xz
pkg/ pkg/
src/ src/

View File

@ -1,6 +1,8 @@
compile: c cs java bash php perl python
pkgdirname != basename `git config remote.origin.url` | sed 's/.git$$//' pkgdirname != basename `git config remote.origin.url` | sed 's/.git$$//'
compile: c cs java bash php perl python
@echo Done
install: clean install: clean
mkdir -p ${pkgdir}/opt/aninix/${pkgdirname}/ mkdir -p ${pkgdir}/opt/aninix/${pkgdirname}/
rsync -avzp HelloWorld* ${pkgdir}/opt/aninix/${pkgdirname}/ rsync -avzp HelloWorld* ${pkgdir}/opt/aninix/${pkgdirname}/
@ -9,7 +11,7 @@ test: compile
python3 -m pytest python3 -m pytest
clean: clean:
cat .gitignore | xargs -n 1 rm -Rf cat .gitignore | xargs rm -Rf
diff: diff:
@echo Nothing to do. @echo Nothing to do.

View File

@ -1,23 +1,22 @@
# Maintainer: Shikoba Kage <darkfeather@aninix.net> pkgname="$(git config remote.origin.url | rev | cut -f 1 -d '/' | rev | sed 's/.git$//' | tr '[[:upper:]]' '[[:lower:]]')"
pkgname=helloworld pkgver="$(git describe --tag --abbrev=0)"."$(git rev-parse --short HEAD)"
pkgver=0.1.4310ab732341ac3317c9aa706b3058b8e7162486
pkgver() {
printf "0.1.""$(git rev-parse HEAD)"
}
pkgrel=1 pkgrel=1
pkgrel() {
git log "$(git describe --tag --abbrev=0)"..HEAD | grep -c commit
}
epoch= epoch=
pkgdesc="AniNIX::HelloWorld \\\\ Sample HelloWorld Source" pkgdesc="$(head -n 1 README)"
arch=("x86_64") arch=("x86_64")
url="https://aninix.net/foundation/HelloWorld" url="https://aninix.net/foundation/${pkgname}"
license=('custom') license=('custom')
groups=() groups=()
depends=('bash>=4.4') depends=('bash>=4.4' 'php' 'perl' 'java-environment' 'python>=3.7')
makedepends=('make>=4.2' 'mono>5.0.0' 'php' 'perl' 'java-environment' 'python>=3.7' 'gcc') makedepends=('make>=4.2' 'mono>5.0.0' 'gcc')
checkdepends=() checkdepends=()
optdepends=() optdepends=()
provides=('helloworld') provides=("${pkgname}")
conflicts=() conflicts=()
replaces=('aninix-helloworld') replaces=()
backup=() backup=()
options=() options=()
install= install=
@ -32,13 +31,12 @@ prepare() {
} }
build() { build() {
git config remote.origin.url make -C ..
} }
check() { check() {
cd "${srcdir}/.." chmod -R u+r ../pkg
chmod a+r "${srcdir}/../pkg" make -C .. test
make test
} }
package() { package() {

2
README
View File

@ -1 +1,3 @@
AniNIX::HelloWorld \\ Sample HelloWorld Source
This project is enabled for AniNIX::Foundation. You can check it out remotely with the git package. It is intended to display example source for all of our projects. This project is enabled for AniNIX::Foundation. You can check it out remotely with the git package. It is intended to display example source for all of our projects.

View File

@ -2,28 +2,26 @@ import os
import re import re
import shutil import shutil
# c cs java bash php perl python
def CheckOutput(output): def CheckOutput(output):
return output == 'Hello world!\n' return output == 'Hello world!\n'
def test_c(): def test_c():
print(os.getcwd()) print(os.getcwd())
fh = os.popen("make c &>/dev/null; ./HelloWorld", mode='r', buffering=-1) fh = os.popen("./HelloWorld", mode='r', buffering=-1)
output = fh.read() output = fh.read()
retcode = fh.close() retcode = fh.close()
assert retcode == None and CheckOutput(output) assert retcode == None and CheckOutput(output)
def test_cs(): def test_cs():
print(os.getcwd()) print(os.getcwd())
fh = os.popen("make cs &>/dev/null; mono ./HelloWorld.exe", mode='r', buffering=-1) fh = os.popen("mono ./HelloWorld.exe", mode='r', buffering=-1)
output = fh.read() output = fh.read()
retcode = fh.close() retcode = fh.close()
assert retcode == None and CheckOutput(output) assert retcode == None and CheckOutput(output)
def test_java(): def test_java():
print(os.getcwd()) print(os.getcwd())
fh = os.popen("make java &>/dev/null; java HelloWorld", mode='r', buffering=-1) fh = os.popen("java HelloWorld", mode='r', buffering=-1)
output = fh.read() output = fh.read()
retcode = fh.close() retcode = fh.close()
assert retcode == None and CheckOutput(output) assert retcode == None and CheckOutput(output)