diff --git a/tools/gitee_tag_manager.py b/tools/gitee_tag_manager.py index f5740a4c3d578d7ded5d724ee45e7ab914a8fcb9..f308e79f9e54b4f6e2b1ae3a1a99595928d0fd48 100644 --- a/tools/gitee_tag_manager.py +++ b/tools/gitee_tag_manager.py @@ -229,7 +229,11 @@ class GiteeTagManager: def tag_manage(self, pkg, temp_path): """add or delete tag for pkg""" - pkg_path = os.path.join(temp_path, pkg) + if self.source == 'commitid': + c_pkg = pkg[0] + else: + c_pkg = pkg + pkg_path = os.path.join(temp_path, c_pkg) tag_flag = True if self.tag_manage_type.lower() == "add": if not self.add_tag(pkg, pkg_path): @@ -249,7 +253,7 @@ class GiteeTagManager: pkg_commit = pkg.split(':') logging.info("current pkg name is: {}".format(pkg_commit[0])) logging.info("current pkg commitid is: {}".format(pkg_commit[1])) - pkg, commit = pkg_commit[0], pkg_commit[1] + pkg, commit = pkg_commit[0], pkg_commit[1] try: clone_flag, temp_path = self.clone_package(pkg) if not clone_flag: @@ -263,9 +267,14 @@ class GiteeTagManager: # 2. tag manage try: - if not self.tag_manage(pkg, temp_path): - logging.error("tag pkg: {} failed!".format(pkg)) - self.failed_list.append(pkg) + if self.source == 'commitid': + if not self.tag_manage(pkg_commit, temp_path): + logging.error("tag pkg: {} failed!".format(pkg)) + self.failed_list.append(pkg) + else: + if not self.tag_manage(pkg, temp_path): + logging.error("tag pkg: {} failed!".format(pkg)) + self.failed_list.append(pkg) except Exception as e: logging.error("tag pkg: {} Exception: {}!".format(pkg, e)) self.failed_list.append(pkg)