From da9267adcef1d0ff8842ee4a4babe3d312f5ebdd Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Jul 05 2016 08:06:57 +0000 Subject: redefine %_rpmfilename to match the default The %_rpmfilename macro dictates the output filename pattern for binary packages produced by rpmbuild. Rpmfluff is expecting to find the binary packages according to the default pattern shipped with rpm, but something else may have redefined this macro causing the binary packages to be written to a different location. For example, mock redefines %_rpmfilename to drop the arch subdirectory, which causes rpmfluff to fail: cp: cannot stat 'test-rpmbuild-b-0.1-1/RPMS/i386/b-0.1-1.i386.rpm': No such file or directory because the file is actually at RPMS/b-0.1-1.i386.rpm instead. --- diff --git a/rpmfluff.py b/rpmfluff.py index 777b223..f3b40cd 100755 --- a/rpmfluff.py +++ b/rpmfluff.py @@ -293,6 +293,7 @@ class RpmBuild(Buildable): buildArchs = (expectedArch,) for arch in buildArchs: command = ["rpmbuild", "--define", "_topdir %s" % absBaseDir, + "--define", "_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm", "-ba", "--target", arch, specFileName] log = check_output(command).splitlines(True) self.__write_log(log, arch)