dracut/newdracut.sh
Petr Šabata 77c9114cb0 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/dracut#99c74373eee952f26c7d256f12c024fe29397ae6
2020-10-14 23:52:06 +02:00

18 lines
477 B
Bash

#!/bin/bash
if [[ -f "$HOME/git/dracut/$1" ]]; then
srcrpm="$HOME/git/dracut/$1"
else
srcrpm="$1"
fi
[[ -f $srcrpm ]] || exit 0
cp dracut.spec dracut.spec.old
for i in *.patch; do git rm -f $i;done
if rpm -ivh --define "_srcrpmdir $PWD" --define "_specdir $PWD" --define "_sourcedir $PWD" "$srcrpm"; then
ls *.patch &>/dev/null && git add *.patch
perl -n -e 'if ($do_print) {print "$_" ;}; if (/^%changelog/) { $do_print=1; }' < dracut.spec.old >> dracut.spec
fi