filterdiff -x '*/configure'
}
+set -e
+
if [ -d $version ]; then
cd $version
bzr pull
> .patch.spec
i=100
for patch in $(cat $version/series | filter_names); do
- file=mysql-$patch
+ # if patch already existed, use mysql- prefix
+ if [ -f mysql-$patch ]; then
+ file=mysql-$patch
+ else
+ file=$patch
+ fi
cat $version/$patch | filter_files > $file
if [ -z "$(awk -vfile=$file -F/ '$2 == file{print}' CVS/Entries)" ]; then
${branch:+cvs up -r $branch $file}
fi
- echo >&2 "Adding: $patch"
- printf "Patch%d:\t%s\n" $i %{name}-$patch >> .percona.spec
+ if [ "$patch" != "$file" ]; then
+ echo >&2 "Adding: $file ($patch)"
+ else
+ echo >&2 "Adding: $file"
+ fi
+ printf "Patch%d:\t%s\n" $i $(echo "$file" | sed -e 's,^mysql-,%{name}-,') >> .percona.spec
printf "%%patch%d -p1\n" $i >> .patch.spec
i=$((i+1))
done