(fix) newdracut.sh: define initial number for 'patch 0'

otherwise last patch number is undefined and this fails the script.

Related: rhbz#2066816
This commit is contained in:
Pavel Valena 2022-06-30 14:12:13 +02:00
parent c3acc2ce2d
commit 6fa68a6f90

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/bash
bash -n "$0" || exit 1
shopt -s extglob
@ -30,6 +30,7 @@ cp dracut.spec dracut.spec.old
rm *.patch; git reset --hard HEAD
last_patch_nr=$(patchnr *.patch | sort -n | tail -n 1)
last_patch_nr=${last_patch_nr:-0000}
#for i in *.patch; do git rm -f $i;done
if rpm -ivh --define "_srcrpmdir $PWD" --define "_specdir $PWD" --define "_sourcedir $PWD" "$srcrpm"; then