rpmlint/rpmlint-0.95-srcfilename.patch

20 lines
852 B
Diff
Raw Normal View History

Index: TagsCheck.py
===================================================================
--- TagsCheck.py (revision 1737)
+++ TagsCheck.py (revision 1738)
@@ -803,8 +803,12 @@
j += 1
i += 1
- expected = pkg.header.sprintf(
- rpm.expandMacro("%{_build_name_fmt}")).split("/")[-1]
+ expfmt = rpm.expandMacro("%{_build_name_fmt}")
+ if pkg.isSource():
+ # _build_name_fmt often (always?) ends up not outputting src/nosrc
+ # as arch for source packages, do it ourselves
+ expfmt = re.sub(r'(?i)%\{?ARCH\b\}?', pkg.arch, expfmt)
+ expected = pkg.header.sprintf(expfmt).split("/")[-1]
basename = os.path.basename(pkg.filename)
if basename != expected:
printWarning(pkg, 'non-coherent-filename', basename, expected)