diff --git a/src/fosslight_util/oss_item.py b/src/fosslight_util/oss_item.py index ab2a34f..c26af2c 100644 --- a/src/fosslight_util/oss_item.py +++ b/src/fosslight_util/oss_item.py @@ -22,6 +22,8 @@ def __init__(self, value): self.relative_path = value self._source_name_or_path = [] self.download_location = "" + self._yocto_recipe = [] + self._yocto_package = [] def __del__(self): pass @@ -93,6 +95,30 @@ def source_name_or_path(self, value): self._source_name_or_path = [item.strip() for item in self._source_name_or_path] self._source_name_or_path = list(set(self._source_name_or_path)) + @property + def yocto_recipe(self): + return self._yocto_recipe + + @yocto_recipe.setter + def yocto_recipe(self, value): + if not isinstance(value, list): + value = value.split(",") + self._yocto_recipe.extend(value) + self._yocto_recipe = [item.strip() for item in self._yocto_recipe] + self._yocto_recipe = list(set(self._yocto_recipe)) + + @property + def yocto_package(self): + return self._yocto_package + + @yocto_package.setter + def yocto_package(self, value): + if not isinstance(value, list): + value = value.split(",") + self._yocto_package.extend(value) + self._yocto_package = [item.strip() for item in self._yocto_package] + self._yocto_package = list(set(self._yocto_package)) + def set_sheet_item(self, item): if len(item) < 9: _logger.warning(f"sheet list is too short ({len(item)}): {item}") diff --git a/src/fosslight_util/parsing_yaml.py b/src/fosslight_util/parsing_yaml.py index e46752c..0e91941 100644 --- a/src/fosslight_util/parsing_yaml.py +++ b/src/fosslight_util/parsing_yaml.py @@ -97,3 +97,7 @@ def set_value_switch(oss, key, value): oss.comment = value elif key == 'homepage': oss.homepage = value + elif key == 'yocto_package': + oss.yocto_package = value + elif key == 'yocto_recipe': + oss.yocto_recipe = value