summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-11-06 15:31:41 +0100
committerglx22 <glx22@users.noreply.github.com>2019-11-13 18:53:38 +0100
commite3511ecacd4e78973777097230a48a2a1224de56 (patch)
treea72be363af967c3a34d4ae100fc2f76dbc889b13
parent9fc63290665e6d8c5f255433225fd33efb28e1bb (diff)
downloadopenttd-e3511ecacd4e78973777097230a48a2a1224de56.tar.xz
Codechange: [AzurePipeline] add developer files section in manifest
-rwxr-xr-xazure-pipelines/manifest.sh56
1 files changed, 40 insertions, 16 deletions
diff --git a/azure-pipelines/manifest.sh b/azure-pipelines/manifest.sh
index d8f4f9aac..aa1acc065 100755
--- a/azure-pipelines/manifest.sh
+++ b/azure-pipelines/manifest.sh
@@ -31,29 +31,53 @@ DATE=$(cat .release_date | tr ' ' T | sed 's/TUTC/:00-00:00/')
VERSION=$(cat .version)
BASE="openttd-${VERSION}"
-echo "name: ${NAME}" >> manifest.yaml
+echo "name: ${NAME}" > manifest.yaml
echo "date: ${DATE}" >> manifest.yaml
echo "base: ${BASE}-" >> manifest.yaml
-echo "files:" >> manifest.yaml
error=""
-for i in $(ls ${FOLDER} | grep -v ".txt$\|.md$\|sum$" | sort); do
- if [ -n "$(echo $i | grep pdb.xz)" ]; then continue; fi
- if [ -n "$(echo $i | grep dbg.deb)" ]; then continue; fi
-
- if [ ! -e ${FOLDER}/$i.md5sum ] || [ ! -e ${FOLDER}/$i.sha1sum ] || [ ! -e ${FOLDER}/$i.sha256sum ]; then
- echo "ERROR: missing checksum file for ${i}" 1>&2
- error="y"
- continue
- fi
- echo "- id: $i" >> manifest.yaml
- echo " size: $(stat -c"%s" ${FOLDER}/$i)" >> manifest.yaml
- echo " md5sum: $(cat ${FOLDER}/$i.md5sum | cut -d\ -f1)" >> manifest.yaml
- echo " sha1sum: $(cat ${FOLDER}/$i.sha1sum | cut -d\ -f1)" >> manifest.yaml
- echo " sha256sum: $(cat ${FOLDER}/$i.sha256sum | cut -d\ -f1)" >> manifest.yaml
+FILES=
+DEV_FILES=
+for filename in $(ls ${FOLDER} | grep -v ".txt$\|.md$\|sum$" | sort); do
+ case ${filename} in
+ *dbg.deb |\
+ *pdb.xz )
+ DEV_FILES+=" ${filename}"
+ ;;
+
+ *)
+ FILES+=" ${filename}"
+ ;;
+ esac
done
+# output_files key filename...
+function output_files {
+ if [ "$#" -lt 2 ]; then return; fi
+ key=$1
+ echo "${key}:" >> manifest.yaml
+ shift
+ while (( "$#" )); do
+ filename=$1
+ if [ ! -e ${FOLDER}/${filename}.md5sum ] || [ ! -e ${FOLDER}/${filename}.sha1sum ] || [ ! -e ${FOLDER}/${filename}.sha256sum ]; then
+ echo "ERROR: missing checksum file for ${filename}" 1>&2
+ error="y"
+ continue
+ fi
+
+ echo "- id: ${filename}" >> manifest.yaml
+ echo " size: $(stat -c"%s" ${FOLDER}/${filename})" >> manifest.yaml
+ echo " md5sum: $(cat ${FOLDER}/${filename}.md5sum | cut -d\ -f1)" >> manifest.yaml
+ echo " sha1sum: $(cat ${FOLDER}/${filename}.sha1sum | cut -d\ -f1)" >> manifest.yaml
+ echo " sha256sum: $(cat ${FOLDER}/${filename}.sha256sum | cut -d\ -f1)" >> manifest.yaml
+ shift
+ done
+}
+
+output_files files ${FILES}
+output_files dev_files ${DEV_FILES}
+
if [ -n "${error}" ]; then
echo "ERROR: exiting due to earlier errors" 1>&2
exit 1