summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-05-29 05:40:22 -0400
committerAnas Nashif <anas.nashif@intel.com>2013-05-29 05:40:22 -0400
commitaf4c7fad9dc3e83e738077426c018b457bba8291 (patch)
treeb1eef77bb7b8428ec4caf989c980a9be78961c30
parentabf5440010b3890365b9cd88438289f4e19d871d (diff)
downloadrpmlint-af4c7fad9dc3e83e738077426c018b457bba8291.tar.gz
rpmlint-af4c7fad9dc3e83e738077426c018b457bba8291.tar.bz2
rpmlint-af4c7fad9dc3e83e738077426c018b457bba8291.zip
handle unallowed placeholders in group and license tags
-rw-r--r--TagsCheck.py24
-rw-r--r--packaging/config2
-rw-r--r--packaging/rpmlint.spec4
3 files changed, 14 insertions, 16 deletions
diff --git a/TagsCheck.py b/TagsCheck.py
index 3d62f90..f9368f1 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -707,17 +707,16 @@ class TagsCheck(AbstractCheck.AbstractCheck):
group = pkg[rpm.RPMTAG_GROUP]
self._unexpanded_macros(pkg, 'Group', group)
- if not group:
+ if group:
+ for p in ['TBD', 'TO BE', 'FILLED', 'Unspecified', 'TO_BE' ]:
+ if p in group:
+ printWarning(pkg, 'group-placeholder-not-allowed', group)
+ elif not group:
printError(pkg, 'no-group-tag')
elif pkg.name.endswith('-devel') and not group.startswith('Development/'):
printWarning(pkg, 'devel-package-with-non-devel-group', group)
elif VALID_GROUPS and group not in VALID_GROUPS:
printWarning(pkg, 'non-standard-group', group)
- else:
- for p in ['TBD', 'TO BE', 'FILLED', 'Unspecified', 'TO_BE' ]:
- if p in group:
- printWarning(pkg, 'group-placeholder-not-allowed', group)
- break
buildhost = pkg[rpm.RPMTAG_BUILDHOST]
self._unexpanded_macros(pkg, 'BuildHost', buildhost)
@@ -787,7 +786,12 @@ class TagsCheck(AbstractCheck.AbstractCheck):
printError(pkg, 'no-license')
else:
valid_license = True
- if rpm_license not in VALID_LICENSES:
+ for p in ['TBD', 'TO BE', 'FILLED', 'Unspecified', 'TO_BE', 'TIZEN', 'samsung', 'Samsung', 'LICENSE' ]:
+ if p in rpm_license:
+ printWarning(pkg, 'license-placeholder-not-allowed', rpm_license)
+ valid_license = False
+ break
+ if valid_license and rpm_license not in VALID_LICENSES:
for l1 in split_license(rpm_license):
if l1 in VALID_LICENSES:
continue
@@ -796,12 +800,6 @@ class TagsCheck(AbstractCheck.AbstractCheck):
printWarning(pkg, 'invalid-license', l2)
valid_license = False
- if not valid_license:
- for p in ['TBD', 'TO BE', 'FILLED', 'Unspecified', 'TO_BE', 'TIZEN', 'samsung', 'Samsung', 'LICENSE' ]:
- if p in rpm_license:
- printWarning(pkg, 'license-placeholder-not-allowed', license)
- valid_license = False
- break
if not valid_license:
self._unexpanded_macros(pkg, 'License', rpm_license)
diff --git a/packaging/config b/packaging/config
index 1930417..ab2f48a 100644
--- a/packaging/config
+++ b/packaging/config
@@ -18,7 +18,7 @@ allChecks()
addCheck("CheckBuildRoot")
addCheck("CheckExecDocs")
-addCheck("LicenseCheck")
+#addCheck("LicenseCheck")
addCheck("DocFilesCheck")
addCheck("CheckPkgConfig")
addCheck("CheckCommonFiles")
diff --git a/packaging/rpmlint.spec b/packaging/rpmlint.spec
index acfbdef..a6d4e5b 100644
--- a/packaging/rpmlint.spec
+++ b/packaging/rpmlint.spec
@@ -3,9 +3,9 @@ BuildRequires: python-rpm
BuildRequires: xz
Summary: Rpm correctness checker
License: GPL-2.0+
-Group: System/Packages
+Group: Development/Tools
Version: 1.4
-Release: 100
+Release: 0
Source0: http://rpmlint.zarb.org/download/rpmlint-%{version}.tar.bz2
Source1: rpmlint-checks-master.tar.gz
Source2: config