SHA256
1
0
forked from pool/rpmlint
rpmlint/postin-speedup.diff

48 lines
1.9 KiB
Diff

From 1436dd7bc41115af658cf8f36a3149ab90a61fcf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 1 Nov 2015 19:32:57 +0100
Subject: [PATCH] Expand postin/postun once per pkg instead once per file
---
FilesCheck.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
Index: rpmlint-rpmlint-1.8/FilesCheck.py
===================================================================
--- rpmlint-rpmlint-1.8.orig/FilesCheck.py
+++ rpmlint-rpmlint-1.8/FilesCheck.py
@@ -863,6 +863,16 @@ class FilesCheck(AbstractCheck.AbstractC
elif debuginfo_package:
printError(pkg, 'empty-debuginfo-package')
+ # Prefetch scriptlets, strip quotes from them (#169)
+ postin = pkg[rpm.RPMTAG_POSTIN] or \
+ pkg.scriptprog(rpm.RPMTAG_POSTINPROG)
+ if postin:
+ postin = quotes_regex.sub('', postin)
+ postun = pkg[rpm.RPMTAG_POSTUN] or \
+ pkg.scriptprog(rpm.RPMTAG_POSTUNPROG)
+ if postun:
+ postun = quotes_regex.sub('', postun)
+
# Unique (rdev, inode) combinations
hardlinks = {}
@@ -976,16 +986,6 @@ class FilesCheck(AbstractCheck.AbstractC
printError(pkg, 'non-standard-executable-perm', f,
"%o" % perm)
- # Prefetch scriptlets, strip quotes from them (#169)
- postin = pkg[rpm.RPMTAG_POSTIN] or \
- pkg.scriptprog(rpm.RPMTAG_POSTINPROG)
- if postin:
- postin = quotes_regex.sub('', postin)
- postun = pkg[rpm.RPMTAG_POSTUN] or \
- pkg.scriptprog(rpm.RPMTAG_POSTUNPROG)
- if postun:
- postun = quotes_regex.sub('', postun)
-
if not devel_pkg:
if lib_path_regex.search(f):
lib_file = True