piston/repo/mkindex.sh

23 lines
547 B
Bash
Raw Normal View History

2021-03-06 07:20:07 +01:00
BASEURL=http://piston_fs_repo:8000/
2021-02-20 23:39:03 +01:00
2021-03-06 07:20:07 +01:00
i=0
2021-02-20 23:39:03 +01:00
2021-03-06 07:20:07 +01:00
echo "" > index
2021-02-20 23:39:03 +01:00
for pkg in $(find ../packages -type f -name "*.pkg.tar.gz")
do
2021-03-06 07:20:07 +01:00
2021-02-20 23:39:03 +01:00
cp $pkg .
2021-03-06 07:20:07 +01:00
2021-02-20 23:39:03 +01:00
PKGFILE=$(basename $pkg)
PKGFILENAME=$(echo $PKGFILE | sed 's/\.pkg\.tar\.gz//g')
2021-03-06 07:20:07 +01:00
2021-02-20 23:39:03 +01:00
PKGNAME=$(echo $PKGFILENAME | grep -oP '^\K.+(?=-)')
PKGVERSION=$(echo $PKGFILENAME | grep -oP '^.+-\K.+')
2021-03-06 07:20:07 +01:00
PKGCHECKSUM=$(sha256sum $PKGFILE | awk '{print $1}')
2021-02-20 23:39:03 +01:00
2021-03-06 07:20:07 +01:00
echo "$PKGNAME,$PKGVERSION,$PKGCHECKSUM,$BASEURL$PKGFILE" >> index
2021-03-14 06:27:28 +01:00
echo "Adding package $PKGNAME-$PKGVERSION"
2021-02-20 23:39:03 +01:00
2021-03-06 07:20:07 +01:00
((i=i+1))
2021-02-20 23:39:03 +01:00
done