From e4a1cf14e031fa15e20c81d9717161fc4c948de3 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Mon, 4 Jun 2018 22:30:20 -0400 Subject: [PATCH] Update gen-quilt-series.sh for new %autosetup. --- gen-quilt-series.sh | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/gen-quilt-series.sh b/gen-quilt-series.sh index 3262fba..22ebf90 100755 --- a/gen-quilt-series.sh +++ b/gen-quilt-series.sh @@ -5,29 +5,9 @@ component="glibc" rm -f series.new extra_args="--fuzz=0" count=0 -# Filter out the patches, and use `_` as our pseudo-IFS to prevent expansion. -for i in `grep '^%patch' glibc.spec | sed -e 's,%patch,,g' -e 's, ,_,g'`; do - # Split the patch into number and arguments. - # 1 - Patch number. - # 2-N - Patch arguments. - # Get back our elements by undoing pseudo-IFS change. - elements=(`echo $i | sed -e 's,_, ,g'`) - num=${elements[0]} - args=${elements[@]:1} - # Find the next patch that applies in order and write it out. - # This way we transform the patch # list into a patch file list in order. - grep "Patch${num}: " glibc.spec \ - | sed -e 's,Patch.*: ,,g' -e "s,\$, ${args[@]} ${extra_args},g" \ - | sed -e "s,%{name},${component},g" \ - >> series.new - ((count++)) -done -# Double check we processed the correct number of patches. -fcount=`wc -l series.new | sed -e 's, .*$,,g'` -if [ $fcount -ne $count ]; then - echo "Error! Processed patch count doesn't match spec file count ($fcount != $count)." - exit 1 -fi +# Transform patches into series file. +grep '^Patch.*:' glibc.spec | sed -e 's,Patch.*: ,,g' > series.new +count=`wc -l series.new | sed -e 's, .*$,,g'` echo "Processed $count patches." mv series.new series echo "Generated quilt ./series file. Please do not commit."