Harden move_to script.
If the package name is not found in the packages file (perhaps because the package was resolved to a different name through Obsoletes etc) then the move_to script could create two dependencies. Detect this and hard-fail. See also: https://bugzilla.redhat.com/show_bug.cgi?id=1568676
This commit is contained in:
parent
c251db3ac8
commit
0fc7c3e4db
@ -998,6 +998,10 @@ gzip --best installed-docs/*.xml
|
||||
pushd $RPM_BUILD_ROOT%{_libdir}/guestfs/supermin.d
|
||||
function move_to
|
||||
{
|
||||
if ! grep -Esq "^$1$" packages; then
|
||||
echo "move_to $1: package name not found in packages file"
|
||||
exit 1
|
||||
fi
|
||||
grep -Ev "^$1$" < packages > packages-t
|
||||
mv packages-t packages
|
||||
echo "$1" >> "$2"
|
||||
|
Loading…
Reference in New Issue
Block a user