#!/usr/bin/python
#
-# This is a replacement for the formerly bash-written function pl_parsePkgs ()
-#
+# This is a replacement for the formerly bash-written function pl_parsePkgs ()
+#
# Usage: $0 [-a arch] default_arch keyword fcdistro pldistro pkgs-file[..s]
# default_arch is $pl_DISTRO_ARCH, but can be overridden
#
default_arch='x86_64'
known_arch = ['i386', 'i686', 'x86_64']
-default_fcdistro = 'f27'
+default_fcdistro = 'f29'
known_fcdistros = [
'centos5', 'centos6',
# oldies but we have references to that in the pkgs files
'f8', 'f10', 'f12', 'f16',
# these ones are still relevant
- 'f14', 'f18', 'f20', 'f21', 'f22', 'f23', 'f24', 'f25', 'f27',
- 'sl6',
+ 'f14', 'f18', 'f20', 'f21', 'f22', 'f23', 'f24', 'f25', 'f27', 'f29',
+ 'sl6',
# debians
'wheezy','jessie',
# ubuntus
default_pldistro='onelab'
known_keywords = [
- 'group', 'groupname', 'groupdesc',
- 'package', 'pip', 'gem',
+ 'group', 'groupname', 'groupdesc',
+ 'package', 'pip', 'gem',
'nodeyumexclude', 'plcyumexclude', 'yumexclude',
'precious', 'junk', 'mirror',
]
re_old = '[a-z]+[+-][a-z]+[0-9]+'
m_old = re.compile('\A{re_old}\Z'.format(**locals()))
-
+
# returns a tuple (included, excluded)
def parse(self, filename):
ok = True
# skip if another distro family
if distro != self.distro: continue
# skip if the qualifier does not fit
- if not self.match (qual, version):
+ if not self.match (qual, version):
if self.options.verbose:
print('{filename}:{lineno}:qualifer {left} does not apply'
.format(**locals()), file=stderr)
format(**locals()))
else:
raise Exception('error in left expression {left}'.format(**locals()))
-
+
except Exception as e:
ok = False
print("{filename}:{lineno}:syntax error: {e}".format(**locals()), file=stderr)
ok = ok and o
# avoid set operations that would not preserve order
results = [ x for x in included if x not in excluded ]
-
+
results = [ x.replace('@arch@', self.arch).\
replace('@fcdistro@', self.fcdistro).\
replace('@pldistro@', self.pldistro) for x in results]
parser.add_option ('-u', '--no-sort', dest='sort_results', default=True, action='store_false',
help='keep results in the same order as in the inputs')
(options, args) = parser.parse_args()
-
+
if len(args) <= 1 :
parser.print_help(file=stderr)
sys.exit(1)