Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-03-01 19:13:01 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2019-05-29 14:30:44 +0300
commit9088dbed4223bfc2ba47c1971c44d7b699268ef4 (patch)
tree3dc418987b0dbeb102a4d1c005031e6df65550a2 /calm/hint.py
parent0089c50d8bb9338941ac56c82d571721adfa7597 (diff)
Remove reading setup.hint files
Diffstat (limited to 'calm/hint.py')
-rwxr-xr-xcalm/hint.py53
1 files changed, 16 insertions, 37 deletions
diff --git a/calm/hint.py b/calm/hint.py
index e32d095..6e1a948 100755
--- a/calm/hint.py
+++ b/calm/hint.py
@@ -29,15 +29,6 @@ from collections import OrderedDict
import re
import argparse
-
-# helper function to merge dicts
-def merge_dicts(x, *y):
- z = x.copy()
- for i in y:
- z.update(i)
- return z
-
-
# types of key:
# 'multilineval' - always have a value, which may be multiline
# 'val' - always have a value
@@ -46,24 +37,32 @@ def merge_dicts(x, *y):
keytypes = ['multilineval', 'val', 'optval', 'noval']
# kinds of hint file, and their allowed keys
-setup, pvr, override = range(3)
+pvr, override = range(2)
+
+hintkeys = {}
-commonkeys = {
+hintkeys[pvr] = {
'ldesc': 'multilineval',
'message': 'multilineval',
'category': 'val',
'external-source': 'val',
'sdesc': 'val',
'skip': 'noval',
+ 'requires': 'optval',
+ 'depends': 'optval',
+ 'build-depends': 'optval',
+ 'obsoletes': 'optval',
+ 'test': 'noval', # mark the package as a test version
+ 'version': 'val', # version override
+ 'disable-check': 'val',
+ 'provides': 'val',
+ 'conflicts': 'val',
}
-versionkeys = {
+hintkeys[override] = {
'curr': 'val',
'prev': 'val',
'test': 'val',
-}
-
-overridekeys = {
'keep': 'val',
'keep-count': 'val',
'keep-days': 'val',
@@ -71,26 +70,6 @@ overridekeys = {
'replace-versions': 'val',
}
-hintkeys = {}
-
-hintkeys[setup] = merge_dicts(commonkeys, versionkeys, {
- 'requires': 'optval',
-})
-
-hintkeys[pvr] = merge_dicts(commonkeys, {
- 'requires': 'optval',
- 'depends': 'optval',
- 'build-depends': 'optval',
- 'obsoletes': 'optval',
- 'test': 'noval', # mark the package as a test version
- 'version': 'val', # version override
- 'disable-check': 'val',
- 'provides': 'val',
- 'conflicts': 'val',
-})
-
-hintkeys[override] = merge_dicts(versionkeys, overridekeys)
-
# valid categories
categories = ['accessibility',
'admin',
@@ -291,10 +270,10 @@ def hint_file_parse(fn, kind):
else:
errors.append("unknown construct '%s' at line %d" % (item, i))
- # for setup and pvr kinds, if 'skip' isn't present, 'category' and
+ # for the pvr kind, if 'skip' isn't present, 'category' and
# 'sdesc' must be
# XXX: genini also requires 'requires' but that seems wrong
- if 'skip' not in hints and kind != override:
+ if 'skip' not in hints and kind == pvr:
mandatory = ['category', 'sdesc']
for k in mandatory:
if k not in hints: