File generate_patches.sh of Package MozillaFirefox

#!/bin/sh

output_directory=${PWD}

for rpm in *.spec ; do
    break
done


rm -- *.patch

git -C $1 format-patch \
    --no-numbered \
    --zero-commit \
    --no-signature \
    --full-index \
    --output-directory=${PWD} \
    release/$2.x..thaodan/release/$2.x


zeros=000
num=0

find $output_directory -maxdepth 1  -name \*.patch -printf %P\\n | sort | while read -r patch ; do
    if [ ! "$rpm" = "*.spec" ] ; then
        printf %s "Patch${zeros}${num}: "
    fi
    printf '%s\n' "$patch"
    export num=$((num+1))

    if [ $((num/100)) -eq 1 ] ; then
        zeros=0
    elif [ $((num/10)) -eq 1 ] ; then
        zeros=00
    fi
done
openSUSE Build Service is sponsored by