2013-11-21 18:48:41 -08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
PATCH_DATA="";
|
2013-12-02 15:12:40 -08:00
|
|
|
for FILE in patches/*/*.def; do
|
|
|
|
UUID=$(echo "${FILE}" | sed -e 's|^.*/||g' -e 's|\.def$||g');
|
|
|
|
REVISION=$(cat "${FILE}" | sed -n 's|Revision: \(.*\)|\1|p');
|
|
|
|
AUTHOR=$(cat "${FILE}" | sed -n 's|Author: \(.*\)|\1|p');
|
|
|
|
TITLE=$(cat "${FILE}" | sed -n 's|Title: \(.*\)|\1|p');
|
2013-11-22 11:06:28 -08:00
|
|
|
if [ "${AUTHOR}" = "" ] && [ "${TITLE}" = "" ]; then
|
|
|
|
continue;
|
|
|
|
fi
|
2013-11-21 18:48:41 -08:00
|
|
|
if [ "${PATCH_DATA}" != "" ]; then
|
|
|
|
PATCH_DATA="${PATCH_DATA}
|
|
|
|
";
|
|
|
|
fi
|
2013-12-02 15:12:40 -08:00
|
|
|
PATCH_DATA="${PATCH_DATA}+ { \"${UUID}:${REVISION}\", \"${AUTHOR}\", \"${TITLE}\" },";
|
2013-11-21 18:48:41 -08:00
|
|
|
done
|
|
|
|
PATCH_LINES=$(echo "${PATCH_DATA}" | grep -c '\n');
|
|
|
|
PATCH_LINES=$((${PATCH_LINES}+20));
|
|
|
|
PATCH_DATA=$(echo "${PATCH_DATA}" | sed ':a;N;$!ba;s/\n/\\n/g');
|
|
|
|
cat patch-list-template.diff | sed \
|
|
|
|
-e "s|##PATCH_LINES##|${PATCH_LINES}|" \
|
|
|
|
-e "s|##PATCH_DATA##|${PATCH_DATA}|"
|
|
|
|
#
|