Exemplo n.º 1
0
 def check(self, _file, stash):
     res = []
     _layer_root = get_layer_root(_file)
     _relpath = _file.replace(_layer_root, '').lstrip('/')
     if ' ' in _relpath:
         res += self.finding(_file, 1)
     return res
Exemplo n.º 2
0
 def check(self, _file, stash):
     res = []
     if "recipes-rubygems/" not in _file:
         return []
     _pn = expand_term(stash, _file, "${PN}")
     _layer_root = get_layer_root(_file)
     _path = os.path.join(_layer_root,
                          RubygemsPackageGroup.PACKAGEGROUP_PATH)
     if os.path.exists(_path):
         with open(_path) as i:
             if _pn not in i.read():
                 res += self.finding(_file, 1)
     return res
Exemplo n.º 3
0
 def __get_combined_licenses(self, _file):
     res = set(RubygemsLicense.POKY_KNOWN_VALID_EXPRESSIONS)
     # add different variations (+, -or-later, -only)
     res.update(["{}+".format(x) for x in RubygemsLicense.POKY_KNOWN_VALID_EXPRESSIONS])
     res.update(["{}-or-later".format(x) for x in RubygemsLicense.POKY_KNOWN_VALID_EXPRESSIONS])
     res.update(["{}-only".format(x) for x in RubygemsLicense.POKY_KNOWN_VALID_EXPRESSIONS])
     __layer_root = get_layer_root(_file)
     for _, _, files in os.walk(os.path.join(__layer_root, RubygemsLicense.LAYER_LICENSE_DIR)):
         for f in files:
             _name = os.path.basename(f)
             if not _name.startswith("."):
                 res.add(_name)
                 res.add("{}+".format(_name))
                 res.add("{}-or-later".format(_name))
                 res.add("{}-only".format(_name))
     return res
Exemplo n.º 4
0
 def check(self, _file, stash):
     res = []
     if "recipes-rubygems/" not in _file:
         return []
     found = False
     _pn = expand_term(stash, _file, "${PN}")
     _layer_root = get_layer_root(_file)
     _needle = self.__needle_to_search_for(_pn)
     for root, dirs, files in os.walk(
             os.path.join(_layer_root, RubygemsTestCase.TESTCASE_DIR)):
         for f in files:
             if not f.endswith(".py"):
                 continue
             with open(os.path.join(root, f)) as i:
                 if _needle in i.read():
                     found = True
                     break
     if not found:
         res += self.finding(_file, 1)
     return res