diff --git a/patch-list-template.diff b/debian/tools/generate-patchlist.sh old mode 100644 new mode 100755 similarity index 84% rename from patch-list-template.diff rename to debian/tools/generate-patchlist.sh index c14f1e1c..3a20952a --- a/patch-list-template.diff +++ b/debian/tools/generate-patchlist.sh @@ -1,5 +1,29 @@ +#!/bin/sh +PATCH_DATA=""; + +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'); + if [ "${AUTHOR}" = "" ] && [ "${TITLE}" = "" ]; then + continue; + fi + if [ "${PATCH_DATA}" != "" ]; then + PATCH_DATA="${PATCH_DATA} +"; + fi + PATCH_DATA="${PATCH_DATA}+ { \"${UUID}:${REVISION}\", \"${AUTHOR}\", \"${TITLE}\" },"; +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 < -Subject: Autogenerated patch list. +Subject: Autogenerated patch list. --- diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c @@ -139,3 +163,4 @@ index 242bb69..aa9e585 100644 extern const char *wine_get_build_id(void); extern void wine_init_argv0_path( const char *argv0 ); extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var ); +EOF diff --git a/generate-patchlist.sh b/generate-patchlist.sh deleted file mode 100755 index b2415594..00000000 --- a/generate-patchlist.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -PATCH_DATA=""; -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'); - if [ "${AUTHOR}" = "" ] && [ "${TITLE}" = "" ]; then - continue; - fi - if [ "${PATCH_DATA}" != "" ]; then - PATCH_DATA="${PATCH_DATA} -"; - fi - PATCH_DATA="${PATCH_DATA}+ { \"${UUID}:${REVISION}\", \"${AUTHOR}\", \"${TITLE}\" },"; -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}|" -# diff --git a/patches/Makefile b/patches/Makefile index ea3d3c54..21c94256 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -4,7 +4,7 @@ PATCH:=patch -N -p0 --strip=1 install: # Update the list of patches - cd $(CURDIR)/..; ./generate-patchlist.sh > $(CURDIR)/patch-list.patch; + cd $(CURDIR)/..; ./debian/tools/generate-patchlist.sh > $(CURDIR)/patch-list.patch; # Apply our patches to Wine cd $(DESTDIR); \ diff --git a/patches/patch-list.patch b/patches/patch-list.patch index 1b09b891..f07f3d7b 100644 --- a/patches/patch-list.patch +++ b/patches/patch-list.patch @@ -1,5 +1,5 @@ From: "FDS-Team" -Subject: Autogenerated patch list. +Subject: Autogenerated patch list. --- diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c diff --git a/precommit-hook.sh b/precommit-hook.sh index 39696f4d..eb1b8f32 100755 --- a/precommit-hook.sh +++ b/precommit-hook.sh @@ -2,11 +2,11 @@ # Installation: ln -s ../../precommit-hook.sh .git/hooks/pre-commit git diff --cached --name-status | while read status file; do - if [[ "$file" =~ ^patches/ ]] || [[ "$file" =~ ^patch-list-template.diff$ ]]; then + if [[ "$file" =~ ^patches/ ]] || [[ "$file" =~ ^debian/tools/generate-patchlist.sh$ ]]; then echo "" echo "*** GENERATING patch-list.patch ***" echo "" - ./generate-patchlist.sh > patches/patch-list.patch || exit 1 + debian/tools/generate-patchlist.sh > patches/patch-list.patch || exit 1 git add patches/patch-list.patch || exit 1 break; fi