Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions code/worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,22 @@ sudo chmod a+x appstreamcli-x86_64.AppImage
# License
AS_LICENSE=""
DT_LICENSE=""
if [ -f database/$INPUTBASENAME/*appdata.xml ] ; then
AS_LICENSE=$(cat database/$INPUTBASENAME/*appdata.xml | xmlstarlet sel -t -m "/component/project_license" -v .) || true
fi
DT_LICENSE=$(grep -r "X-AppImage-Payload-License=.*" database/$INPUTBASENAME/*.desktop | cut -d '=' -f 2)
AS_LICENSE=$(
xmlstarlet sel -t \
-m "/component/project_license" -v . \
$(ls database/$INPUTBASENAME/*.{appdata,metainfo}.xml 2>/dev/null)
) || true
DT_LICENSE=$(
grep -h "X-AppImage-Payload-License=" database/$INPUTBASENAME/*.desktop 2>/dev/null \
| cut -d '=' -f 2
) || true
if [ x"$AS_LICENSE" != x"" ] ; then
echo "license: $AS_LICENSE" >> apps/$INPUTBASENAME.md
elif [ x"$DT_LICENSE" != x"" ] ; then
echo "license: $DT_LICENSE" >> apps/$INPUTBASENAME.md
else
echo "No license found!"
exit 1
fi
# Icon
ICONBASENAME=$(basename "$ICONFILE")
Expand All @@ -490,9 +498,13 @@ sudo chmod a+x appstreamcli-x86_64.AppImage
# Authors
echo "" >> apps/$INPUTBASENAME.md
echo "authors:" >> apps/$INPUTBASENAME.md
GH_USER=$(grep "^https://github.com.*" data/$INPUTBASENAME | cut -d '/' -f 4 )
GH_REPO=$(grep "^https://github.com.*" data/$INPUTBASENAME | cut -d '/' -f 5 )
OBS_USER=$(grep "^http.*://download.opensuse.org/repositories/home:/" data/$INPUTBASENAME | cut -d "/" -f 6 | sed -e 's|:||g')
GH_USER=$(grep "^https://github.com/" data/$INPUTBASENAME | cut -d '/' -f 4) || true
GH_REPO=$(grep "^https://github.com/" data/$INPUTBASENAME | cut -d '/' -f 5) || true
OBS_USER=$(
grep -h "^http.*://download.opensuse.org/repositories/home:/" "data/$INPUTBASENAME" 2>/dev/null \
| cut -d "/" -f 6 \
| sed 's|:||g'
) || true
# BB_USER=$(grep "^https://bitbucket.org.*" data/$INPUTBASENAME | cut -d '/' -f 4 )
# BB_REPO=$(grep "^https://bitbucket.org.*" data/$INPUTBASENAME | cut -d '/' -f 5 )
if [ x"$GH_USER" == x"" ] ; then
Expand All @@ -518,7 +530,7 @@ sudo chmod a+x appstreamcli-x86_64.AppImage
echo " - type: Download" >> apps/$INPUTBASENAME.md
echo " url: https://github.com/$GH_USER/$GH_REPO/releases" >> apps/$INPUTBASENAME.md
fi
OBS_LINK=$(grep "^http.*://download.opensuse.org.*latest.*AppImage$" data/$INPUTBASENAME | sed -e 's|http://d|https://d|g')
OBS_LINK=$(grep "^http.*://download.opensuse.org.*latest.*AppImage$" data/$INPUTBASENAME | sed -e 's|http://d|https://d|g') || true
if [ x"$OBS_LINK" != x"" ] ; then
echo " - type: Download" >> apps/$INPUTBASENAME.md
echo " url: $OBS_LINK.mirrorlist" >> apps/$INPUTBASENAME.md
Expand Down