mkspec-wrapper.sh: Fix append() for special characters

The append() shell function was unable to cope with special
characters, notably with () in RPM provides libnnz12.so()(64bit),
this commit fixes that. And introduces some (disabled) debug code
into projects.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-01-30 16:23:03 +00:00
commit d7da4f1cb8
2 changed files with 3 additions and 2 deletions

View file

@ -10,7 +10,7 @@ append()
{ {
local var=$1 local var=$1
shift shift
local tmp=`eval echo \\$$var $@ | sed 's/^[[:space:]]*//; s/[[:space:]]*$//'` local tmp=`eval echo \"\\$$var $@\" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//'`
eval $var=\"$tmp\" eval $var=\"$tmp\"
} }

View file

@ -374,6 +374,7 @@ def read_value(path, section, key):
r.append(line) r.append(line)
else: else:
r = re.findall('^ *' + key + ' *= *(.*)', line) r = re.findall('^ *' + key + ' *= *(.*)', line)
#debug("key " + key + ": parsed line >" + line + "<, result is " + ' '.join(r))
if (len(r) > 0): if (len(r) > 0):
break break
file.close() file.close()
@ -518,7 +519,7 @@ def pkg_relations(rel_type, args_):
for i, item in enumerate(dep): for i, item in enumerate(dep):
dep[i] = item.strip() dep[i] = item.strip()
if s == 'jw' and len(dep) == 3: if s == 'jw' and len(dep) == 3:
dep_project = re.sub(r'-devel$|-run$', '', dep[0]) dep_project = re.sub(r'-devel$|-dev$|-run$', '', dep[0])
if args.dont_expand_version_macros and dep_project in args.module: if args.dont_expand_version_macros and dep_project in args.module:
version = dep[2] version = dep[2]
else: else: