From 14cd3ee52f7c6eb2287db5ac4ccf56a24dfd6be1 Mon Sep 17 00:00:00 2001 From: myeuler Date: Tue, 2 Jun 2020 12:06:18 +0800 Subject: [PATCH 1/9] !5 Add a new command to create repo with srpm * add create_repo_with_srpm --- create_repo_with_srpm | 110 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100755 create_repo_with_srpm diff --git a/create_repo_with_srpm b/create_repo_with_srpm new file mode 100755 index 00000000..5e980d12 --- /dev/null +++ b/create_repo_with_srpm @@ -0,0 +1,110 @@ +#!/usr/bin/python3 +""" +This is a command line tool for adding new repo +""" + +import argparse +import yaml +import sys +from os import path +import subprocess + +nr = {} + +def get_info(pkg): + proc = subprocess.Popen(["rpm", "-qpi", pkg], stdout=subprocess.PIPE) + while (True): + line = proc.stdout.readline() + if not line: + break; + info = str(line.strip().decode()).split(':') + if (len(info) < 2): + continue + info[0] = info[0].strip() + info[1] = info[1].strip() + if (info[0] == "Name"): + nr["name"] = info[1] + elif (info[0] == "Summary"): + nr["description"] = info[1] + elif (info[0] == "URL"): + if (len(info) >= 3): + nr["upstream"] = info[1] + ":" + info[2] + else: + nr["upstream"] = info[1] + + + proc.stdout.close() + proc.wait() + + return len(nr) + +if __name__ == "__main__": + par = argparse.ArgumentParser() + par.add_argument("-r", "--repo", help="YAML file for repositories", type=str, required=True) + par.add_argument("-i", "--sigs", help="YAML file for sigs", type=str, required=True) + par.add_argument("-s", "--sig", help="The SIG which contains the package", type=str, required=True) + par.add_argument("-p", "--pkg", help="Package for upoad", type=str, required=True) + + args = par.parse_args() + + if (path.exists(args.pkg) and path.isfile(args.pkg)): + ret = get_info(args.pkg) + if (ret < 3): + print("Somthing is wrong\n") + sys.exit(1) + else: + print("%s does not exist\n" & args.pkg) + sys.exit(1) + + f = open(args.sigs) + sigs = yaml.load(f.read(), Loader=yaml.Loader) + if not sigs: + print("Failed to load {file}".format(file=args.sigs)) + sys.exit(1) + f.close() + + f = open(args.repo) + repo = yaml.load(f.read(), Loader=yaml.Loader) + if not repo: + print("Failed to load {file}".format(file=args.repo)) + sys.exit(1) + f.close() + + nr["protected_branches"] = ["master"] + nr["type"] = "public" + + exist = [x for x in repo["repositories"] if x["name"] == nr["name"]] + if exist != []: + print("Repo already exist") + sys.exit(1) + + if repo["community"] == "openeuler": + del nr["upstream"] + repo["repositories"].append(nr) + elif repo["community"] == "src-openeuler": + repo["repositories"].append(nr) + + repo["repositories"].sort(key=lambda r: r["name"]) + + valid_sig = False + for s in sigs["sigs"]: + if s["name"] == args.sig: + s["repositories"].append(repo["community"] + "/" + nr["name"]) + s["repositories"].sort() + valid_sig=True + continue + + if valid_sig: + f = open(args.repo, "w") + yaml.dump(repo, f) + f.close() + f = open(args.sigs, "w") + yaml.dump(sigs, f) + f.close() + else: + print("SIG name is not valid") + sys.exit(1) + + + print("create repo %s successfully\n" % nr["name"]) + sys.exit(0) -- Gitee From 90c44b37068817169393ba8f72c6899ec5243362 Mon Sep 17 00:00:00 2001 From: Shinwell Hu Date: Mon, 15 Jun 2020 02:26:27 +0000 Subject: [PATCH 2/9] reorgnization to prepare for new introduction --- advisors/check_inactive_repo.rb | 54 +++ advisors/check_missing_specs.rb | 48 +++ advisors/check_upgradable.rb | 178 +++++++++ advisors/check_upstream/common.rb | 121 +++++++ advisors/check_upstream/git.rb | 20 + advisors/check_upstream/github.rb | 100 +++++ advisors/check_upstream/gnome.rb | 21 ++ advisors/check_upstream/hg.rb | 39 ++ advisors/check_upstream/metacpan.rb | 43 +++ advisors/check_upstream/pypi.rb | 37 ++ advisors/check_upstream/svn.rb | 39 ++ advisors/create_repo.py | 73 ++++ advisors/create_repo_with_srpm | 110 ++++++ advisors/gitee.py | 146 ++++++++ advisors/gitee/advisor.rb | 26 ++ advisors/gitee/prepare_token.sh | 7 + advisors/helper/download_spec.rb | 25 ++ advisors/helper/rpmparser.rb | 175 +++++++++ advisors/helper/specfile_exceptions.yaml | 55 +++ advisors/packager/python-packager.py | 441 +++++++++++++++++++++++ advisors/simple-update-robot.py | 136 +++++++ advisors/tc_reminder.py | 130 +++++++ advisors/who_maintain.py | 103 ++++++ simple-update-robot.rb | 121 ------- upstream-info/librsvg2.yaml | 311 ++++++++++++++++ upstream-info/nftables.yaml | 8 + 26 files changed, 2446 insertions(+), 121 deletions(-) create mode 100755 advisors/check_inactive_repo.rb create mode 100755 advisors/check_missing_specs.rb create mode 100755 advisors/check_upgradable.rb create mode 100755 advisors/check_upstream/common.rb create mode 100755 advisors/check_upstream/git.rb create mode 100755 advisors/check_upstream/github.rb create mode 100755 advisors/check_upstream/gnome.rb create mode 100755 advisors/check_upstream/hg.rb create mode 100755 advisors/check_upstream/metacpan.rb create mode 100755 advisors/check_upstream/pypi.rb create mode 100755 advisors/check_upstream/svn.rb create mode 100755 advisors/create_repo.py create mode 100755 advisors/create_repo_with_srpm create mode 100755 advisors/gitee.py create mode 100755 advisors/gitee/advisor.rb create mode 100755 advisors/gitee/prepare_token.sh create mode 100755 advisors/helper/download_spec.rb create mode 100755 advisors/helper/rpmparser.rb create mode 100755 advisors/helper/specfile_exceptions.yaml create mode 100755 advisors/packager/python-packager.py create mode 100755 advisors/simple-update-robot.py create mode 100755 advisors/tc_reminder.py create mode 100755 advisors/who_maintain.py delete mode 100755 simple-update-robot.rb create mode 100644 upstream-info/librsvg2.yaml create mode 100644 upstream-info/nftables.yaml diff --git a/advisors/check_inactive_repo.rb b/advisors/check_inactive_repo.rb new file mode 100755 index 00000000..6a6792d5 --- /dev/null +++ b/advisors/check_inactive_repo.rb @@ -0,0 +1,54 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'set' +require 'optparse' + +require './helper/download_spec' +require './gitee/advisor' + +INACTIVE_THRESHOLD = 3 + +options = {} +OptionParser.new do |opts| + opts.banner = "Usage: check_inactive_repo.rb [options]" + opts.on("-p", "--push", "Push the advise to gitee.com/openeuler") do |v| + options[:push] = v + end + opts.on("-r", "--repo REPO_NAME", "Repo to check upstream info") do |n| + puts "Checking #{n}" + options[:repo] = n + end + opts.on("-h", "--help", "Prints this help") do + puts opts + exit + end +end.parse! + +if not options[:repo] then + puts "Missing repo name\n" + exit 1 +end + +cmd = "git ls-remote https://gitee.com/openeuler/#{options[:repo]}/" +refs = %x[#{cmd}] +merge_count = 0 +refs.each_line { |line| + if line.match(/\/pull\/(\d*)\/MERGE/) then + merge_count = merge_count + 1 + end + puts line +} +if merge_count < INACTIVE_THRESHOLD then + if options[:push] then + ad = Advisor.new + ad.new_issue("openeuler", options[:repo], + "Inactive repository", + "Dear #{options[:repo]} developer:\n亲爱的 #{options[:repo]} 开发者:\n\n We found this repository has not fulfill what it prupose to be.\n我们发现这个代码仓并没有承载它被期望的功能。\n\n Long time no progress will discourge other developers to follow and participant this initiative.\n长期没有代码会使得关注这个项目的开发者失望。\n\n Please start submit something as soon as possible.\n建议您尽快向代码仓提交进展。\n\n This is a automatic advise from openEuler-Advisor. If you think the advise is not correct, please fill an issue at https\:\/\/gitee.com\/openeuler\/openEuler-Advisor to help us improve.\n这是一条由 openEuler-Advisor 自动生成的建议。如果您认为这个建议不对,请访问 https\:\/\/gitee.com\/openeuler\/openEuler-Advisor 来帮助我们改进。\n\n Yours openEuler Advisor.") + else + puts "#{options[:repo]} is not active. But we keep it between us" + end +else + puts "#{options[:repo]} is active and good." +end + diff --git a/advisors/check_missing_specs.rb b/advisors/check_missing_specs.rb new file mode 100755 index 00000000..d8ca43d8 --- /dev/null +++ b/advisors/check_missing_specs.rb @@ -0,0 +1,48 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'set' +require 'optparse' + +require './helper/download_spec' +require './gitee/advisor' + +options = {} +OptionParser.new do |opts| + opts.banner = "Usage: check_missing_spec.rb [options]" + opts.on("-p", "--push", "Push the advise to gitee.com/src-openeuler") do |v| + options[:push] = v + end + opts.on("-r", "--repo REPO_NAME", "Repo to check upstream info") do |n| + puts "Checking #{n}" + options[:repo] = n + end + opts.on("-h", "--help", "Prints this help") do + puts opts + exit + end +end.parse! + +if not options[:repo] then + puts "Missing repo name\n" + exit 1 +end + +specfile = download_spec(options[:repo]) + +if specfile == "" then + puts "no spec file found for #{options[:repo]} project\n" + if options[:push] then + puts "Push this advise to gitee\n" + ad = Advisor.new + ad.new_issue("src-openeuler", options[:repo], + "Submit spec file into this repository", + "Dear #{options[:repo]} maintainer:\n亲爱的 #{options[:repo]} 维护者:\n\n We found there is no spec file in this repository yet.\n我们发现这个代码仓中没有 spec 文件。\n\n Missing spec file implies that this components will not be integtaed into openEuler release, and your hardworking cannot help others.\n缺少 spec 文件意味着这个项目还不能被集成到 openEuler 项目中,而您的贡献还不能帮助到社区中的其他人。\n\n We courage you submit your spec file into this repository as soon as possible.\n我们鼓励您尽快提交 spec 文件到这个代码仓中\n\n This is a automatic advise from openEuler-Advisor. If you think the advise is not correct, please fill an issue at https\:\/\/gitee.com\/openeuler\/openEuler-Advisor to help us improve.\n这是一条由 openEuler-Advisor 自动生成的建议。如果您认为这个建议不对,请访问 https\:\/\/gitee.com\/openeuler\/openEuler-Advisor 来帮助我们改进。\n\n Yours openEuler Advisor.") + else + puts "Keep it between us\n" + end +else + puts "Everything's fine\n" +end + +File.delete(specfile) if specfile != "" diff --git a/advisors/check_upgradable.rb b/advisors/check_upgradable.rb new file mode 100755 index 00000000..05392b24 --- /dev/null +++ b/advisors/check_upgradable.rb @@ -0,0 +1,178 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'json' +require 'date' +require 'optparse' + +require './check_upstream/github' +require './check_upstream/git' +require './check_upstream/hg' +require './check_upstream/svn' +require './check_upstream/metacpan' +require './check_upstream/gnome' +require './check_upstream/pypi' +require './helper/download_spec' +require './helper/rpmparser' +require './gitee/advisor' + +options = {} + +OptionParser.new do |opts| + opts.banner = "Usage: check_upgradable.rb [options]" + opts.on("-p", "--push", "Push the advise to gitee.com/src-openeuler") do |v| + options[:push] = v + end + opts.on("-r", "--repo REPO_NAME", "Repo to check upstream info") do |n| + puts "Checking #{n}" + options[:repo] = n + end + opts.on("-h", "--help", "Prints this help") do + puts opts + exit + end +end.parse! + +if not options[:repo] then + puts "Missing repo name\n" + exit 1 +end + +Prj_name = options[:repo] +specfile=download_spec(Prj_name) +if specfile == "" then + puts "no specfile found for project\n" + exit 1 +end +spec_struct = Specfile.new(specfile) +Cur_ver = spec_struct.get_version + +Prj_info = YAML.load(File.read "upstream-info/"+Prj_name+".yaml") + +def compare_tags (a, b) + arr_a = a.split(".") + arr_b = b.split(".") + len = [arr_a.length, arr_b.length].min + idx = 0 + while idx < len do + res1 = arr_a[idx].to_i <=> arr_b[idx].to_i + return res1 if res1 != 0 + res2 = arr_a[idx].length <=> arr_b[idx].length + return -res2 if res2 != 0 + res3 = arr_a[idx][-1].to_i <=> arr_b[idx][-1].to_i + return res3 if res3 != 0 + idx = idx + 1 + end + return arr_a.length <=> arr_b.length +end + +def sort_tags (tags) + tags.sort! { |a, b| + compare_tags(a,b) + } + return tags +end + +def clean_tags(tags) + new_tags = [] + tags.each{|line| + new_tags = new_tags.append clean_tag(line, Prj_info) + } + return new_tags +end + +def upgrade_recommend(tags_param, cur_tag, policy) + tags = tags_param.reverse + tag1 = cur_tag + tag2 = cur_tag + if policy == "latest" then + return tags[0] + elsif policy == "latest-stable" then + tags.each { |tag| + if tag.split(".").count {|f| f.to_i != 0 } >= 3 then + tag1 = tag + break + end + } + tags.each { |tag| + if tag.split(".").count {|f| f.to_i != 0} >= 2 then + tag2 = tag + break + end + } + if tag2[0].to_i > tag1[0].to_i then + return tag2 + else + return tag1 + end + elsif policy == "perfer-stable" then + tags.each { |tag| + if tag.start_with?(cur_tag) then + return tag + end + } + if cur_tag.split(".").length >= 3 then + search_tag = cur_tag.split(".")[0..1].join(".") + tags.each { |tag| + if tag.start_with?(search_tag) then + return tag + end + } + end + return cur_tag + else + return cur_tag + end + +end + +print Prj_name, ":\n" + +if Prj_info["version_control"] == "svn" then + tags = check_upstream_svn(Prj_info) +elsif Prj_info["version_control"] == "github" then + tags = check_upstream_github_by_api(Prj_info) + if tags == nil or tags == "" then + tags = check_upstream_github_by_git(Prj_info) + end + tags = clean_tags(tags.lines) +elsif Prj_info["version_control"] == "git" then + tags = check_upstream_git(Prj_info) + tags = clean_tags(tags.lines) +elsif Prj_info["version_control"] == "hg" then + tags = check_upstream_hg(Prj_info) + tags = clean_tags(tags.lines) +elsif Prj_info["version_control"] == "metacpan" then + tags = check_upstream_metacpan(Prj_info) + tags = clean_tags(tags.lines) +elsif Prj_info["version_control"] == "gitlab.gnome" then + tags = check_upstream_gnome(Prj_info) + tags = clean_tags(tags.lines) +elsif Prj_info["version_control"] == "pypi" then + tags = check_upstream_pypi(Prj_info) + tags = clean_tags(tags.lines) +end + +tags = sort_tags(tags) +print "Latest upstream is ", tags[-1], "\n" +#print "Recommended is ", upgrade_recommend(tags, Cur_ver, "latest-stable"), "\n" +print "Current version is ", Cur_ver, "\n" + +puts "This package has #{spec_struct.get_diverse} patches" + +if tags.length == 0 or compare_tags(tags[-1], Cur_ver) < 0 then + STDERR.puts "DEBUG #{Prj_name} > tags are #{tags}" + File.delete("upstream-info/"+Prj_name+".yaml") if File.exist?("upstream-info/"+Prj_name+".yaml") + File.open("known-issues/"+Prj_name+".yaml", "w") { |file| file.write(Prj_info.to_yaml) } +else + File.open("upstream-info/"+Prj_name+".yaml", "w") { |file| file.write(Prj_info.to_yaml) } +end +File.delete(specfile) if specfile != "" + +if options[:push] then + puts "Push to gitee\n" + ad = Advisor.new + ad.new_issue("src-openeuler", Prj_name, "Upgrade to Latest Release", "Dear #{Prj_name} maintainer:\n\n We found the latst version of #{Prj_name} is #{tags[-1]}, while the current version in openEuler is #{Cur_ver}.\n\n Please consider upgrading.\n\n\nYours openEuler Advisor.") +else + puts "keep it to us\n" +end diff --git a/advisors/check_upstream/common.rb b/advisors/check_upstream/common.rb new file mode 100755 index 00000000..4ff8752d --- /dev/null +++ b/advisors/check_upstream/common.rb @@ -0,0 +1,121 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'json' +require 'date' + +def compare_tags (a, b) + arr_a = a.split(".") + arr_b = b.split(".") + len = [arr_a.length, arr_b.length].min + idx = 0 + while idx < len do + res1 = arr_a[idx].to_i <=> arr_b[idx].to_i + return res1 if res1 != 0 + res2 = arr_a[idx].length <=> arr_b[idx].length + return -res2 if res2 != 0 + res3 = arr_a[idx][-1].to_i <=> arr_b[idx][-1].to_i + return res3 if res3 != 0 + idx = idx + 1 + end + return arr_a.length <=> arr_b.length +end + +def clean_tag(tag, prj_info) + if prj_info.has_key?("tag_pattern") then + tag = tag.gsub(Regexp.new(prj_info["tag_pattern"]), "\\1") + elsif prj_info.has_key?("tag_prefix") then + tag = tag.gsub(Regexp.new(prj_info["tag_prefix"]), "") + end + if prj_info.has_key?("seperator") and prj_info["seperator"] != "." then + tag = tag.gsub(Regexp.new(prj_info["seperator"]), ".") + end + return tag.gsub("\n", "") +end + +def sort_tags (tags) + tags.sort! { |a, b| + compare_tags(a,b) + } + return tags +end + +def upgrade_recommend(tags, cur_tag, policy) + tags.reverse! + tag1 = cur_tag + tag2 = cur_tag + if policy == "latest" then + return tags[0] + elsif policy == "latest-stable" then + tags.each { |tag| + if tag.split(".").count {|f| f.to_i != 0 } >= 3 then + tag1 = tag + break + end + } + tags.each { |tag| + if tag.split(".").count {|f| f.to_i != 0} >= 2 then + tag2 = tag + break + end + } + if tag2[0].to_i > tag1[0].to_i then + return tag2 + else + return tag1 + end + elsif policy == "perfer-stable" then + tags.each { |tag| + if tag.start_with?(cur_tag) then + return tag + end + } + if cur_tag.split(".").length >= 3 then + search_tag = cur_tag.split(".")[0..1].join(".") + tags.each { |tag| + if tag.start_with?(search_tag) then + return tag + end + } + end + return cur_tag + else + return cur_tag + end + +end + +def load_last_query_result(prj_info, force_reload=false) + if force_reload == true then + prj_info.delete("last_query") + STDERR.puts "DEBUG: #{prj_info["src_repo"].gsub("\n", "")} > Force Reload\n" + return "" + else + if prj_info.has_key?("last_query") then + last_query = prj_info["last_query"] + if Time.now - last_query["time_stamp"] < 60*60*24*3 then + STDERR.puts "DEBUG: #{prj_info["src_repo"].gsub("\n", "")} > Reuse Last Query\n" + return last_query["raw_data"].dup + else + prj_info.delete("last_query") + STDERR.puts "DEBUG: #{prj_info["src_repo"].gsub("\n", "")} > Last Query Too Old.\n" + return "" + end + else + return "" + end + end +end + +def resp_to_git_tags(resp) + tags = "" + resp.each_line { |line| + if line.match(/refs\/tags/) then + match = line.scan(/^([^ \t]*)[ \t]*refs\/tags\/([^ \t]*)\n/) + if match != nil then + tags = tags + match[0][1].to_s + "\n" + end + end + } + return tags +end diff --git a/advisors/check_upstream/git.rb b/advisors/check_upstream/git.rb new file mode 100755 index 00000000..0e663f20 --- /dev/null +++ b/advisors/check_upstream/git.rb @@ -0,0 +1,20 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'date' +require_relative 'common' + +def check_upstream_git (prj_info) + resp = load_last_query_result(prj_info) + cmd="git ls-remote --tags "+prj_info["src_repo"] + if resp == "" then + resp=%x[#{cmd}] + last_query={} + last_query["time_stamp"] = Time.now + last_query["raw_data"] = resp.dup + prj_info["last_query"] = last_query + end + tags = resp_to_git_tags(resp) + return tags +end + diff --git a/advisors/check_upstream/github.rb b/advisors/check_upstream/github.rb new file mode 100755 index 00000000..c05d40be --- /dev/null +++ b/advisors/check_upstream/github.rb @@ -0,0 +1,100 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'json' +require 'date' +require_relative 'common' + +def check_upstream_github_by_api (prj_info) + cmd="/usr/bin/curl -m 60 -s https://api.github.com/repos/"+prj_info["src_repo"]+"/releases" + resp = load_last_query_result(prj_info) + if resp == "" then + STDERR.puts "DEBUG #{prj_info["src_repo"]} > Using api.github to get releases" + begin + retries ||= 0 + resp=%x[#{cmd}] + release = JSON.parse(resp) + rescue + STDERR.puts "DEBUG #{prj_info["src_repo"]} > No Response or JSON Parse failed. Retry in 3 seconds.\n" + sleep 3 + retry if (retries+=1) < 10 + end + if release != [] and release != nil then + last_query = {} + last_query["time_stamp"] = Time.now + last_query["raw_data"] = resp.dup + prj_info["last_query"] = last_query + prj_info["query_type"] = "api.github.releases" + else + # fall back to tags + STDERR.puts "DEBUG #{prj_info["src_repo"]} > Using api.github to get tags" + resp="" + cmd="/usr/bin/curl -m 60 -s https://api.github.com/repos/"+prj_info["src_repo"]+"/tags" + tags=[] + begin + retries ||= 0 + resp=%x[#{cmd}] + tags=JSON.parse(resp) + rescue + STDERR.puts "DEBUG #{prj_info["src_repo"]} > No Response or JSON Parse failed. Retry in 3 seconds.\n" + sleep 3 + retry if (retries += 1) < 10 + end + if tags == [] or tags == nil then + print "WARNING: #{prj_info["src_repo"]}'s upstream version not available~" + return "" + else + last_query = {} + last_query["time_stamp"] = Time.now + last_query["raw_data"] = resp.dup + prj_info["last_query"] = last_query + prj_info["query_type"] = "api.github.tags" + end + end + end + + if prj_info["query_type"] == "api.github.releases" then + result = "" + begin + release = JSON.parse(resp) + release.sort_by! { |e| e["created_at"]} + release.each { |r| + result = result + clean_tag(r["tag_name"], prj_info) + "\n" + } + rescue + end + return result + elsif prj_info["query_type"] == "api.github.tags" then + result = "" + begin + tags = JSON.parse(resp) + tags.each { |r| + result = result + clean_tag(r["name"], prj_info) + "\n" + } + rescue + end + return result + else + return "" + end +end + +def check_upstream_github_by_git(prj_info) + resp = load_last_query_result(prj_info) + if prj_info.has_key?("query_type") and prj_info["query_type"] != "git-ls" then + resp = "" + end + cmd="git ls-remote --tags https://github.com/"+prj_info["src_repo"]+".git" + if resp == "" then + STDERR.puts "DEBUG #{prj_info["src_repo"]} > Using git ls-remote" + resp=%x[#{cmd}] + last_query = {} + last_query["time_stamp"] = Time.now + last_query["raw_data"] = resp.dup + prj_info["last_query"] = last_query + prj_info["query_type"] = "git-ls" + end + tags = resp_to_git_tags(resp) + return tags +end + diff --git a/advisors/check_upstream/gnome.rb b/advisors/check_upstream/gnome.rb new file mode 100755 index 00000000..0a0fd112 --- /dev/null +++ b/advisors/check_upstream/gnome.rb @@ -0,0 +1,21 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'date' +require_relative 'common' + +def check_upstream_gnome (prj_info) + resp = "" + resp = load_last_query_result(prj_info) + if resp == "" then + cmd="git ls-remote --tags https://gitlab.gnome.org/GNOME/"+prj_info["src_repo"]+".git" + resp = %x[#{cmd}] + last_query={} + last_query["time_stamp"] = Time.now + last_query["raw_data"] = resp.dup + prj_info["last_query"] = last_query + end + tags = resp_to_git_tags(resp) + return tags +end + diff --git a/advisors/check_upstream/hg.rb b/advisors/check_upstream/hg.rb new file mode 100755 index 00000000..23413853 --- /dev/null +++ b/advisors/check_upstream/hg.rb @@ -0,0 +1,39 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'date' +require_relative 'common' + +def check_upstream_hg (prj_info) + cookie = "" + cmd="curl -s "+prj_info["src_repo"]+"/raw-tags" + resp = load_last_query_result(prj_info) + if resp == "" then + resp = %x[#{cmd}] + if resp.lines[0].match(/html/) then # we got html response, resend with cookie + resp.each_line { |line| + match = line.scan(/document\.cookie=\"(.*)\";/) + if match != [] then + cookie = cookie + match[0][0] + end + } + cmd="curl -s --cookie \""+cookie+"\" "+prj_info["src_repo"]+"/raw-tags" + resp = %x[#{cmd}] + end + last_query={} + last_query["time_stamp"] = Time.now + last_query["raw_data"] = resp.dup + prj_info["last_query"] = last_query + end + tags = "" + resp.each_line { |line| + if line.match(/^tip/) then + next + end + match = line.scan(/^([\w\d\-\.]*)[ \t]*([\w\d\-\.]*)/) + if match != [] then + tags = tags + match[0][0].to_s + "\n" + end + } + return tags +end diff --git a/advisors/check_upstream/metacpan.rb b/advisors/check_upstream/metacpan.rb new file mode 100755 index 00000000..937ee618 --- /dev/null +++ b/advisors/check_upstream/metacpan.rb @@ -0,0 +1,43 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'json' +require 'date' +require './check_upstream/common' + +def check_upstream_metacpan (prj_info) + resp = "" + info={} + tags = "" + cmd="curl -m 60 -s https://fastapi.metacpan.org/release/"+prj_info["src_repo"] + resp = load_last_query_result(prj_info) + if resp == "" + begin + retries ||= 0 + resp=%x[#{cmd}] + info=JSON.parse(resp) + rescue + STDERR.puts "DEBUG #{prj_info["src_repo"]} > No Respose or JSON parse failed\n" + sleep 3 + retry if (retries += 1) < 10 + end + else + info = JSON.parse(resp) + end + if info != {} then + if ! info.key?("version") then + STDERR.puts "DEBUG #{prj_info["src_repo"]} > ERROR FOUND" + return tags + else + tags = tags +info["version"].to_s+"\n" + end + else + STDERR.puts "DEBUG #{prj_info["src_repo"]} > found unsorted on cpan.metacpan.org\n" + return tags + end + last_query = {} + last_query["time_stamp"] = Time.now + last_query["raw_data"] = resp.dup + prj_info["last_query"] = last_query + return tags +end diff --git a/advisors/check_upstream/pypi.rb b/advisors/check_upstream/pypi.rb new file mode 100755 index 00000000..34902a40 --- /dev/null +++ b/advisors/check_upstream/pypi.rb @@ -0,0 +1,37 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'json' +require 'date' +require './check_upstream/common.rb' + +def check_upstream_pypi (prj_info) + resp = "" + info={} + tags = "" + resp = load_last_query_result(prj_info) + if resp == "" then + last_query={} + last_query["time_stamp"] = Time.now + cmd="curl -m 60 -s -L https://pypi.org/pypi/"+prj_info["src_repo"]+"/json" + begin + retries ||= 0 + resp=%x[#{cmd}] + info=JSON.parse(resp) + rescue + STDERR.puts "DEBUG: #{prj_info["src_repo"].gsub("\n", "")} > No Respose or JSON parse failed\n" + sleep 3 + retry if (retries+=1)<10 + end + if info != {} then + last_query["raw_data"] = resp + prj_info["last_query"] = last_query + end + else + info=JSON.parse(resp) + end + if info != {} then + tags = tags + info["info"]["version"].to_s+"\n" + end + return tags +end diff --git a/advisors/check_upstream/svn.rb b/advisors/check_upstream/svn.rb new file mode 100755 index 00000000..cac2e034 --- /dev/null +++ b/advisors/check_upstream/svn.rb @@ -0,0 +1,39 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'json' +require 'date' +require_relative 'common' + +def check_upstream_svn (prj_info) + cmd="/usr/bin/svn ls -v "+prj_info["src_repo"]+"/tags" + resp = load_last_query_result(prj_info) + if resp == "" then + resp = %x[#{cmd}] + last_query = {} + last_query["time_stamp"] = Time.now + last_query["raw_data"] = resp.dup + prj_info["last_query"] = last_query + else + end + sorted_tags = [] + resp.each_line { |tag_line| + match = tag_line.scan(/([.\w]+)/) + if match != nil then + if match[5][0].include?(prj_info["tag_prefix"]) then + new_tag = Hash.new + new_tag["Date"] = Date.parse(match[2][0]+" "+match[3][0]+" "+match[4][0]) + tag = match[5][0] + new_tag["Tag"] = tag.gsub(prj_info["tag_prefix"], "").gsub(prj_info["seperator"], ".") + sorted_tags.append(new_tag) + end + end + } + sorted_tags.sort_by! {|t| t["Date"] } + result = [] + sorted_tags.each { |t| + result.append(t["Tag"]) + } + return result +end + diff --git a/advisors/create_repo.py b/advisors/create_repo.py new file mode 100755 index 00000000..01030a22 --- /dev/null +++ b/advisors/create_repo.py @@ -0,0 +1,73 @@ +#!/usr/bin/python3 +""" +This is a command line tool for adding new repo +""" + +import argparse +import yaml +import sys + + +if __name__ == "__main__": + par = argparse.ArgumentParser() + par.add_argument("-r", "--repo", help="YAML file for repositories", type=str, required=True) + par.add_argument("-i", "--sigs", help="YAML file for sigs", type=str, required=True) + par.add_argument("-s", "--sig", help="Sig manage this repo", type=str, required=True) + par.add_argument("-n", "--name", help="Name for new repo", type=str, required=True) + par.add_argument("-d", "--desc", help="Description for new repo", type=str, required=True) + par.add_argument("-u", "--upstream", help="Upstream for new repo", type=str, required=True) + + args = par.parse_args() + + f = open(args.sigs) + sigs = yaml.load(f.read(), Loader=yaml.Loader) + if not sigs: + print("Failed to load {file}".format(file=args.sigs)) + sys.exit(1) + f.close() + + f = open(args.repo) + repo = yaml.load(f.read(), Loader=yaml.Loader) + if not repo: + print("Failed to load {file}".format(file=args.repo)) + sys.exit(1) + f.close() + + nr = {} + nr["name"] = args.name + nr["description"] = args.desc + nr["upstream"] = args.upstream + nr["protected_branches"] = ["master"] + nr["type"] = "public" + + exist = [x for x in repo["repositories"] if x["name"] == args.name] + if exist != []: + print("Repo already exist") + sys.exit(1) + + if repo["community"] == "openeuler": + repo["repositories"].append(nr) + elif repo["community"] == "src-openeuler": + nr["upstream"] = args.upstream + repo["repositories"].append(nr) + + repo["repositories"].sort(key=lambda r: r["name"]) + + valid_sig = False + for s in sigs["sigs"]: + if s["name"] == args.sig: + s["repositories"].append(repo["community"] + "/" + args.name) + s["repositories"].sort() + valid_sig=True + continue + + if valid_sig: + f = open(args.repo, "w") + yaml.dump(repo, f) + f.close() + f = open(args.sigs, "w") + yaml.dump(sigs, f) + f.close() + else: + print("SIG name is not valid") + sys.exit(1) diff --git a/advisors/create_repo_with_srpm b/advisors/create_repo_with_srpm new file mode 100755 index 00000000..5e980d12 --- /dev/null +++ b/advisors/create_repo_with_srpm @@ -0,0 +1,110 @@ +#!/usr/bin/python3 +""" +This is a command line tool for adding new repo +""" + +import argparse +import yaml +import sys +from os import path +import subprocess + +nr = {} + +def get_info(pkg): + proc = subprocess.Popen(["rpm", "-qpi", pkg], stdout=subprocess.PIPE) + while (True): + line = proc.stdout.readline() + if not line: + break; + info = str(line.strip().decode()).split(':') + if (len(info) < 2): + continue + info[0] = info[0].strip() + info[1] = info[1].strip() + if (info[0] == "Name"): + nr["name"] = info[1] + elif (info[0] == "Summary"): + nr["description"] = info[1] + elif (info[0] == "URL"): + if (len(info) >= 3): + nr["upstream"] = info[1] + ":" + info[2] + else: + nr["upstream"] = info[1] + + + proc.stdout.close() + proc.wait() + + return len(nr) + +if __name__ == "__main__": + par = argparse.ArgumentParser() + par.add_argument("-r", "--repo", help="YAML file for repositories", type=str, required=True) + par.add_argument("-i", "--sigs", help="YAML file for sigs", type=str, required=True) + par.add_argument("-s", "--sig", help="The SIG which contains the package", type=str, required=True) + par.add_argument("-p", "--pkg", help="Package for upoad", type=str, required=True) + + args = par.parse_args() + + if (path.exists(args.pkg) and path.isfile(args.pkg)): + ret = get_info(args.pkg) + if (ret < 3): + print("Somthing is wrong\n") + sys.exit(1) + else: + print("%s does not exist\n" & args.pkg) + sys.exit(1) + + f = open(args.sigs) + sigs = yaml.load(f.read(), Loader=yaml.Loader) + if not sigs: + print("Failed to load {file}".format(file=args.sigs)) + sys.exit(1) + f.close() + + f = open(args.repo) + repo = yaml.load(f.read(), Loader=yaml.Loader) + if not repo: + print("Failed to load {file}".format(file=args.repo)) + sys.exit(1) + f.close() + + nr["protected_branches"] = ["master"] + nr["type"] = "public" + + exist = [x for x in repo["repositories"] if x["name"] == nr["name"]] + if exist != []: + print("Repo already exist") + sys.exit(1) + + if repo["community"] == "openeuler": + del nr["upstream"] + repo["repositories"].append(nr) + elif repo["community"] == "src-openeuler": + repo["repositories"].append(nr) + + repo["repositories"].sort(key=lambda r: r["name"]) + + valid_sig = False + for s in sigs["sigs"]: + if s["name"] == args.sig: + s["repositories"].append(repo["community"] + "/" + nr["name"]) + s["repositories"].sort() + valid_sig=True + continue + + if valid_sig: + f = open(args.repo, "w") + yaml.dump(repo, f) + f.close() + f = open(args.sigs, "w") + yaml.dump(sigs, f) + f.close() + else: + print("SIG name is not valid") + sys.exit(1) + + + print("create repo %s successfully\n" % nr["name"]) + sys.exit(0) diff --git a/advisors/gitee.py b/advisors/gitee.py new file mode 100755 index 00000000..455fb052 --- /dev/null +++ b/advisors/gitee.py @@ -0,0 +1,146 @@ +#!/usr/bin/python3 +""" +This is a helper script for working with gitee.com +""" + +import urllib +import urllib.request +import urllib.parse +import urllib.error +import argparse +import yaml +import re +import os.path +import json +import pprint + + +class Gitee(object): + """ + Gitee is a helper class to abstract gitee.com api + """ + def __init__(self): + self.secret = open(os.path.expanduser("~/.gitee_personal_token.json"), "r") + self.token = json.load(self.secret) + + self.headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW 64; rv:50.0) Gecko/20100101 Firefox/50.0'} + self.gitee_url = "https://gitee.com/" + self.src_openeuler_url = self.gitee_url + "src-openeuler/{package}/raw/master/" + self.advisor_url = self.gitee_url + "openeuler/openEuler-Advisor/raw/master/" + self.specfile_url_template = self.src_openeuler_url + "{specfile}" + self.yamlfile_url_template = self.src_openeuler_url + "{package}.yaml" + #self.advisor_url_template = "https://gitee.com/openeuler/openEuler-Advisor/raw/master/upstream-info/{package}.yaml" + self.advisor_url_template = self.advisor_url + "upstream-info/{package}.yaml" + #self.specfile_exception_url = "https://gitee.com/openeuler/openEuler-Advisor/raw/master/helper/specfile_exceptions.yaml" + self.specfile_exception_url = self.advisor_url + "helper/specfile_exceptions.yaml" + + def post_gitee(self, url, values, headers=None): + """ + POST into gitee API + """ + if headers is None: + headers = self.headers.copy() + data = urllib.parse.urlencode(values).encode('utf-8') + req = urllib.request.Request(url=url, data=data, headers=headers, method="POST") + try: + u = urllib.request.urlopen(req) + return u.read().decode("utf-8") + except urllib.error.HTTPError as err: + print("WARNING:" + str(err.code)) + print("WARNING:" + str(err.headers)) + return False + + def fork_repo(self, repo): + """ + Fork repository in gitee + """ + url = "https://gitee.com/api/v5/repos/src-openeuler/{repo}/forks".format(repo=repo) + values = {} + values["access_token"] = self.token["access_token"] + # headers["User-Agent"] = "curl/7.66.0" + #headers["Content-Type"] = "application/json;charset=UTF-8" + #headers["HOST"] = "gitee.com" + #headers["Accept"] = "*/*" + return self.post_gitee(url, values) + + def create_pr(self, head, repo): + """ + Create PR in gitee + """ + url = "https://gitee.com/api/v5/repos/src-openeuler/{repo}/pulls".format(repo=repo) + values = {} + values["access_token"] = self.token["access_token"] + values["title"] = "Upgrade to latest version of {repo}".format(repo=repo) + values["head"] = "{head}:master".format(head=head) + values["base"] = "master" + values["body"] = """This is a (mostly) automatically created PR by openEuler-Advisor. +Please be noted that it's not throughly tested. +Review carefully before accept this PR. +Thanks. +Yours openEuler-Advisor. +""" + return self.post_gitee(url, values) + + def get_gitee(self, url, headers=None): + """ + GET from gitee api + """ + if headers is None: + req = urllib.request.Request(url=url, headers=self.headers) + else: + req = urllib.request.Request(url=url, headers=headers) + u = urllib.request.urlopen(req) + return u.read().decode("utf-8") + + def get_gitee_json(self, url): + """ + get and load gitee json response + """ + #headers = self.headers.copy() + headers = {} + headers["Content-Type"] = "application/json;charset=UTF-8" + resp = self.get_gitee(url, headers) + return json.loads(resp) + + def get_spec_exception(self): + """ + get well known spec file exceptions + """ + resp = self.get_gitee(self.specfile_exception_url) + exps = yaml.load(resp, Loader=yaml.Loader) + return exps + + def get_spec(self, pkg): + """ + get openeuler spec file for specific package + """ + exp = self.get_spec_exception() + if pkg in exp: + dir_name = exp[pkg]["dir"] + file_name = exp[pkg]["file"] + specurl = self.specfile_url_template.format(package=pkg, specfile=dir_name + "/" + file_name) + else: + specurl = self.specfile_url_template.format(package=pkg, specfile=pkg + ".spec") + + return self.get_gitee(specurl) + + def get_yaml(self, pkg): + """ + get upstream yaml metadata for specific package + """ + yamlurl = self.advisor_url_template.format(package=pkg) + resp = self.get_gitee(yamlurl) + if re.match("Not found", resp): + yamlurl = self.yamlfile_url_template.format(package=pkg) + resp = self.get_gitee(yamlurl) + if re.match("Not found", resp): + print("Cannot find upstream metadata") + return False + else: + return resp + else: + return False + +if __name__ == "__main__": + pass + diff --git a/advisors/gitee/advisor.rb b/advisors/gitee/advisor.rb new file mode 100755 index 00000000..a4a71f03 --- /dev/null +++ b/advisors/gitee/advisor.rb @@ -0,0 +1,26 @@ +#!/usr/bin/ruby + +require 'json' + +class Advisor + def initialize + @token = JSON.parse(File.read (File.expand_path "~/.gitee_token.json")) + @cmd = "curl -s -X POST --header 'Content-Type: application/json;charset=UTF-8'" + @param = {} + end + + def new_issue(owner, repo, title, body) + @param["access_token"] = @token["access_token"] + @param["repo"] = repo + @param["title"] = title + @param["body"] = body + @cmd += " 'https://gitee.com/api/v5/repos/#{owner}/issues'" + @cmd += " -d '" + @param.to_json + "'" + #puts @cmd + resp = %x[#{@cmd}] + #puts resp + end +end + +#ad = Advisor.new +#ad.new_issue("Shinwell_Hu", "openEuler-Toolbox") diff --git a/advisors/gitee/prepare_token.sh b/advisors/gitee/prepare_token.sh new file mode 100755 index 00000000..39c5bc33 --- /dev/null +++ b/advisors/gitee/prepare_token.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# refer to gitee.com/api/v5/oauth_doc#/list-item-2 +source ~/.gitee_secret +echo "Refreshing ~/.gitee_token.json" +curl -s -X POST --data-urlencode "grant_type=password" --data-urlencode "username=$username" --data-urlencode "password=$password" --data-urlencode "client_id=$client_id" --data-urlencode "client_secret=$client_secret" --data-urlencode "scope=projects issues" https://gitee.com/oauth/token > ~/.gitee_token.json +chmod 400 ~/.gitee_token.json diff --git a/advisors/helper/download_spec.rb b/advisors/helper/download_spec.rb new file mode 100755 index 00000000..0c3403d9 --- /dev/null +++ b/advisors/helper/download_spec.rb @@ -0,0 +1,25 @@ +#!/usr/bin/ruby + +require 'yaml' + +def download_spec(name) + output_dir = "." + exception_load = YAML.load(File.read(File.dirname(__FILE__)+"/specfile_exceptions.yaml")) + if exception_load.has_key?(name) then + output_file = "#{output_dir}/#{exception_load[name]["file"]}" + cmd = "curl -s https://gitee.com/src-openeuler/#{name}/raw/master/#{exception_load[name]["dir"]}/#{exception_load[name]["file"]} -o #{output_file}" + else + output_file = "#{output_dir}/#{name}.spec" + cmd = "curl -s https://gitee.com/src-openeuler/#{name}/raw/master/#{name}.spec -o #{output_file}" + + end + %x[#{cmd}] if ! File.exists?(output_file) + s = File.size(output_file) + if s == 52 then + STDERR.puts "> No SPEC file found for #{name}" + File.delete output_file + return "" + end + return output_file +end + diff --git a/advisors/helper/rpmparser.rb b/advisors/helper/rpmparser.rb new file mode 100755 index 00000000..8e2908cc --- /dev/null +++ b/advisors/helper/rpmparser.rb @@ -0,0 +1,175 @@ +#!/usr/bin/ruby + +require 'yaml' +require 'set' + +def rpmspec_split_file (line, prefix) + m = line.scan (/#{prefix}\s*(.*)/) + if m != [] then + return m[0][0] + else + return nil + end +end + +def rpmspec_split_tags (line, prefix) + m = line.scan (/#{prefix}\s*(.*)/) + if m != [] then + br = m[0][0] + if br.index(',') then + bra = br.split(',').map(&:strip) + return bra + elsif br =~ /\w\s+\w/ then + bra = br.split(/\s+/) + return bra + end + end + return nil +end + +def rpmspec_clean_tag (oset, mac) + + new_set = Set.new + + oset.each { |br| + if br[0] =~ /[\d<=>!]/ then + oset.delete(br) + elsif br =~ /[<=>!]/ then + bra = br.split("\s").map(&:strip) + oset.delete(br) + new_set << bra[0] + elsif br.match(/%{/) then + m = br.scan(/%{(.*?)}/) + i = 0 + nbr = br + while i < m.length do + if mac[m[i][0]] then + nbr = nbr.gsub(/%{#{m[i][0]}}/, mac[m[i][0]]) + else + # some strange RPM macro needs shell expand, I dont know ohw to handle this + end + i = i + 1 + end + oset.delete(br) + new_set << nbr + end + } + oset += new_set + return oset +end + +def rpmspec_macro_expand(tag, macro) + ##This needs a fix + if tag.match(/%{/) then + m = tag.scan(/%{(.*)}/) + if m != [] then + if macro[m[0][0]] then + tag = tag.gsub(/%{#{m[0][0]}}/, macro[m[0][0]]) + end + end + end + return tag +end + +class Specfile + def initialize(filepath) + spec = File.open("#{filepath}") + @macros = {} + @macros["epoch"] = "1" + @macros["?_isa"] = "aarch64" + @name = "" + @version = "" + @release = "" + + @build_requires = Set.new + @requires = Set.new + @provides = Set.new + + @sources = Set.new + @patches = Set.new + + spec.each_line { |line| + m = line.scan (/^[Nn]ame\s*:\s*([^\s]*)\s*/) + if m != [] then + @name = m[0][0] + end + m = line.scan (/^[Vv]ersion\s*:\s*([^\s]*)\s*/) + if m != [] then + @version = m[0][0] + end + m = line.scan (/^[Rr]elease\s*:\s*([^\s]*)\s*/) + if m != [] then + @release = m[0][0] + end + m = line.scan (/%global\s*([^\s]*)\s*(.*)/) + if m != [] then + @macros[m[0][0]] = m[0][1] + end + m = line.scan (/%define\s*([^\s]*)\s*(.*)/) + if m != [] then + @macros[m[0][0]] = m[0][1] + end + bra = rpmspec_split_tags(line, "BuildRequires:") + if bra != nil then + @build_requires += bra + end + ra = rpmspec_split_tags(line, "Requires:") + if ra != nil then + @requires += ra + end + po = rpmspec_split_tags(line, "Provides:") + if po != nil then + @provides += po + end + src = rpmspec_split_file(line, "Source\\d*:") + if src != nil then + @sources << src + end + pa = rpmspec_split_file(line, "Patch\\d*:") + if pa != nil then + @patches << pa + end + } + @name = rpmspec_macro_expand(@name, @macros) + @macros["name"] = @name + + @version = rpmspec_macro_expand(@version, @macros) + @macros["version"] = @version + + @release = rpmspec_macro_expand(@release, @macros) + @macros["release"] = @release + + @build_requires = rpmspec_clean_tag(@build_requires, @macros) + @requires = rpmspec_clean_tag(@requires, @macros) + @provides = rpmspec_clean_tag(@provides, @macros) + end + + def get_name + return @name + end + + def get_version + return @version + end + + def get_diverse + return @patches.length + end + + def get_sources + return @sources + end + + def expand_macros(s) + return rpmspec_clean_tag(s, @macros) + end +#newspec = {} +#newspec["name"] = name +#newspec["release"] = release +#newspec["version"] = version +#newspec["build_requires"] = build_requires +#newspec["provides"] = provides +#newspec["requires"] = requires + +end + diff --git a/advisors/helper/specfile_exceptions.yaml b/advisors/helper/specfile_exceptions.yaml new file mode 100755 index 00000000..0e51e521 --- /dev/null +++ b/advisors/helper/specfile_exceptions.yaml @@ -0,0 +1,55 @@ +--- +libnetwork: + dir: script + file: docker-proxy.spec +authz: + dir: hack + file: authz.spec +lxcfs-tools: + dir: hack + file: lxcfs-tools.spec +libkae: + dir: . + file: kae.spec +autotune: + dir: . + file: atune.spec +dvdplusrw-tools: + dir: . + file: dvd+rw-tools.spec +gtk: + dir: . + file: gtk+.spec +docker: + dir: . + file: docker-engine-openeuler.spec +libsigcpp20: + dir: . + file: libsigc++20.spec +libwd: + dir: . + file: warpdrive.spec +kmod-kvdo: + dir: . + file: kvdo.spec +jboss-el: + dir: . + file: jboss-el-2.2-api.spec +openEuler-rpm-config: + dir: . + file: generic-rpm-config.spec +openEuler-release: + dir: . + file: generic-release.spec +openjdk-1.8.0: + dir: . + file: java-1.8.0-openjdk.spec +openjdk-11: + dir: . + file: java-11-openjdk.spec +A-Tune: + dir: . + file: atune.spec +runc: + dir: . + file: runc-openeuler.spec \ No newline at end of file diff --git a/advisors/packager/python-packager.py b/advisors/packager/python-packager.py new file mode 100755 index 00000000..ce131ebf --- /dev/null +++ b/advisors/packager/python-packager.py @@ -0,0 +1,441 @@ +#!/usr/bin/python3 +""" +This is a packager bot for python modules from pypi.org +""" +#****************************************************************************** +# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. +# licensed under the Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +# PURPOSE. +# See the Mulan PSL v2 for more details. +# Author: Shinwell_Hu Myeuler +# Create: 2020-05-07 +# Description: provide a tool to package python module automatically +# ******************************************************************************/ + +import urllib +import urllib.request +from pprint import pprint +from os import path +import json +import sys +import re +import datetime +import argparse +import subprocess +import os +from pathlib import Path +# python3-wget is not default available on openEuler yet. +# import wget + +url_template = 'https://pypi.org/pypi/{pkg_name}/json' +json_file_template = '{pkg_name}.json' +name_tag_template = 'Name:\t\tpython-{pkg_name}' +summary_tag_template = 'Summary:\t{pkg_sum}' +version_tag_template = 'Version:\t{pkg_ver}' +release_tag_template = 'Release:\t1' +license_tag_template = 'License:\t{pkg_lic}' +home_tag_template = 'URL:\t\t{pkg_home}' +source_tag_template = 'Source0:\t{pkg_source}' + +buildreq_tag_template = 'BuildRequires:\t{req}' + +build_noarch = True # Usually python modules are arch independent + +def get_license(j): + """ + By default, the license info can be achieved from json["info"]["license"] + In rare cases it doesn't work. + We fall back to json["info"]["classifiers"], it looks like License :: OSI Approved :: BSD Clause + """ + if j["info"]["license"] != "": + return j["info"]["license"] + for k in j["info"]["classifiers"]: + if k.startswith("License"): + ks = k.split("::") + return ks[2].strip() + return "" + + +def get_source_url(j): + """ + return URL for source file for the latest version + return "" in errors + """ + v = j["info"]["version"] + rs = j["releases"][v] + for r in rs: + if r["packagetype"] == "sdist": + return r["url"] + return "" + + +def transform_module_name(n): + """ + return module name with version restriction. + Any string with '.' or '/' is considered file, and will be ignored + Modules start with python- will be changed to python3- for consistency. + """ + # remove () + ns = re.split("[()]", n) + ver_constrain = [] + ns[0] = ns[0].strip() + if ns[0].startswith("python-"): + ns[0] = ns[0].replace("python-", "python3-") + else: + ns[0] = "python3-" + ns[0] + if ns[0].find("/") != -1 or ns[0].find(".") != -1: + return "" + if len(ns) > 1: + vers = ns[1].split(",") + for ver in vers: + m = re.match(r"([!<>=]+)( *)(\d.*)", ver.strip()) + ver_constrain.append(ns[0] + " " + m[1] + " " + m[3]) + return ", ".join(ver_constrain) + else: + return ns[0] + + +def get_requires(j): + """ + return all requires no matter if extra is required. + """ + rs = j["info"]["requires_dist"] + if rs is None: + return + for r in rs: + idx = r.find(";") + mod = transform_module_name(r[:idx]) + print("Requires:\t" + mod) + + +def refine_requires(req): + """ + return only requires without ';' (thus no extra) + """ + ra = req.split(";", 1) + # + # Do not add requires which has ;, which is often has very complicated precondition + # Will need more parsing of the denpency after ; + return transform_module_name(ra[0]) + +def get_build_requires(resp): + req_list=[] + rds = resp["info"]["requires_dist"] + if rds is not None: + for rp in rds: + br = refine_requires(rp) + if (br == ""): + continue + # + # Do not output BuildRequires: + # just collect all build requires and using pip to install + # than can help to build all rpm withoud trap into + # build dependency nightmare + # + #print(buildreq_tag_template.format(req=br)) + name=str.lstrip(br).split(" ") + req_list.append(name[0]) + return req_list + +def get_buildarch(j): + """ + If this module has a prebuild package for amd64, then it is arch dependent. + print BuildArch tag if needed. + """ + v = j["info"]["version"] + rs = j["releases"][v] + for r in rs: + if r["packagetype"] == "bdist_wheel": + if r["url"].find("amd64") != -1: + global build_noarch + build_noarch = False + return + print("BuildArch:\tnoarch") + + +def get_description(j): + """ + return description. + Usually it's json["info"]["description"] + If it's rst style, then only use the content for the first paragraph, and remove all tag line. + For empty description, use summary instead. + """ + desc = j["info"]["description"].splitlines() + res = [] + paragraph = 0 + for d in desc: + if len(d.strip()) == 0: + continue + first_char = d.strip()[0] + ignore_line = False + if d.strip().startswith("===") or d.strip().startswith("---"): + paragraph = paragraph + 1 + ignore_line = True + elif d.strip().startswith(":") or d.strip().startswith(".."): + ignore_line = True + if ignore_line != True and paragraph == 1: + res.append(d) + if paragraph >= 2: + del res[-1] + return "\n".join(res) + if res != []: + return "\n".join(res) + elif paragraph == 0: + return j["info"]["description"] + else: + return j["info"]["summary"] + + +def store_json(j, pkg, spath): + """ + save json file + """ + fname = json_file_template.format(pkg_name=pkg) + json_file = os.path.join(spath, fname) + + # if file exist, do nothing + if path.exists(json_file) and path.isfile(json_file): + with open(json_file, 'r') as f: + resp = json.load(f) + else: + with open(json_file, 'w') as f: + json.dump(j, f) + + +def get_pkg_json(pkg): + """ + recieve json from pypi.org + """ + url = url_template.format(pkg_name=pkg) + + u = urllib.request.urlopen(url) + resp = json.loads(u.read().decode('utf-8')) + + return resp + + +def download_source(j, tgtpath): + """ + download source file from url, and save it to target path + """ + if (os.path.exists(tgtpath) == False): + print("download path %s does not exist\n", tgtpath) + return False + s_url = get_source_url(j) + return subprocess.call(["wget", s_url, "-P", tgtpath]) + + +def prepare_rpm_build_env(buildroot): + """ + prepare environment for rpmbuild + """ + if (os.path.exists(buildroot) == False): + print("Build Root path %s does not exist\n", buildroot) + return False + + for sdir in ['SPECS', 'BUILD', 'SOURCES', 'SRPMS', 'RPMS', 'BUILDROOT']: + bpath = os.path.join(buildroot, sdir) + if (os.path.exists(bpath) == False): + os.mkdir(bpath) + + return True + + +def try_install_package(pkg): + """ + install packages listed in build requires + """ + print(pkg) + ret = subprocess.call(["rpm", "-qi", pkg]) + if ret == 0: + return True + + # try pip installation + pip_name = pkg.split("-") + if len(pip_name) == 2: + ret = subprocess.call(["pip3", "install", "--user", pip_name[1]]) + else: + ret = subprocess.call(["pip3", "install", "--user", pip_name[0]]) + + if ret != 0: + print("%s can not be installed correctly, Fix it later, go ahead to do building..." % pip_name) + + # + # Try to build anyway, fix it later + # + return True + +def prepare_dependencies(req_list): + for req in req_list: + if (try_install_package(req) == False): + return req + return "" + +def build_package(specfile): + """ + build rpm package with rpmbuild + """ + ret = subprocess.call(["rpmbuild", "-ba", specfile]) + return ret + + +def build_rpm(j, buildroot): + """ + full process to build rpm + """ + if(prepare_rpm_build_env(buildroot) == False): + return False + + specfile = os.path.join(buildroot, "SPECS", "python-" + j["info"]["name"] + ".spec") + + req_list = build_spec(j, specfile) + ret = prepare_dependencies(req_list) + if ret != "": + print("%s can not be installed automatically, Please handle it" % ret) + return ret + + download_source(j, os.path.join(buildroot, "SOURCES")) + + build_package(specfile) + + return "" + + +def build_spec(resp, output): + """ + print out the spec file + """ + if os.path.isdir(output): + output = os.path.join(output, "python3-" + resp["info"]["name"]) + tmp = sys.stdout + if (output == ""): + print() + else: + sys.stdout = open(output, 'w+') + + print(name_tag_template.format(pkg_name=resp["info"]["name"])) + print(version_tag_template.format(pkg_ver=resp["info"]["version"])) + print(release_tag_template) + print(summary_tag_template.format(pkg_sum=resp["info"]["summary"])) + print(license_tag_template.format(pkg_lic=get_license(resp))) + print(home_tag_template.format(pkg_home=resp["info"]["project_urls"]["Homepage"])) + print(source_tag_template.format(pkg_source=get_source_url(resp))) + get_buildarch(resp) + print("") + get_requires(resp) + print("") + print("%description") + print(get_description(resp)) + print("") + print("%package -n python3-{name}".format(name=resp["info"]["name"])) + print(summary_tag_template.format(pkg_sum=resp["info"]["summary"])) + print("Provides:\tpython-" + resp["info"]["name"]) + print(buildreq_tag_template.format(req='python3-devel')) + print(buildreq_tag_template.format(req='python3-setuptools')) + + if build_noarch == False: + print(buildreq_tag_template.format(req='python3-cffi')) + print(buildreq_tag_template.format(req='gcc')) + print(buildreq_tag_template.format(req='gdb')) + + + build_req_list=get_build_requires(resp) + + print("%description -n python3-" + resp["info"]["name"]) + print(get_description(resp)) + print("") + print("%package help") + print("Summary:\tDevelopment documents and examples for {name}".format(name=resp["info"]["name"])) + print("Provides:\tpython3-{name}-doc".format(name=resp["info"]["name"])) + print("%description help") + print(get_description(resp)) + print("") + print("%prep") + print("%autosetup -n {name}-{ver}".format(name=resp["info"]["name"], ver=resp["info"]["version"])) + print("") + print("%build") + print("%py3_build") + print("") + print("%install") + print("%py3_install") + print("install -d -m755 %{buildroot}/%{_pkgdocdir}") + print("if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi") + print("if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi") + print("if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi") + print("if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi") + print("pushd %{buildroot}") + print("if [ -d usr/lib ]; then") + print("\tfind usr/lib -type f -printf \"/%h/%f\\n\" >> filelist.lst") + print("fi") + print("if [ -d usr/lib64 ]; then") + print("\tfind usr/lib64 -type f -printf \"/%h/%f\\n\" >> filelist.lst") + print("fi") + print("if [ -d usr/bin ]; then") + print("\tfind usr/bin -type f -printf \"/%h/%f\\n\" >> filelist.lst") + print("fi") + print("if [ -d usr/sbin ]; then") + print("\tfind usr/sbin -type f -printf \"/%h/%f\\n\" >> filelist.lst") + print("fi") + print("popd") + print("mv %{buildroot}/filelist.lst .") + print("") + print("%files -n python3-{name} -f filelist.lst".format(name=resp["info"]["name"])) +# print("%{python3_sitelib}/*.egg-info/") +# print("%{python3_sitelib}/" + resp["info"]["name"]) + + if build_noarch: + print("%dir %{python3_sitelib}/*") + else: + print("%dir %{python3_sitearch}/*") + + print("") + print("%files help") + print("%{_pkgdocdir}") + print("") + print("%changelog") + date_str = datetime.date.today().strftime("%a %b %d %Y") + print("* {today} Python_Bot ".format(today=date_str)) + print("- Package Spec generated") + + sys.stdout = tmp + + return build_req_list + + +if __name__ == "__main__": + + dft_root_path=os.path.join(str(Path.home()), "rpmbuild") + + parser = argparse.ArgumentParser() + + parser.add_argument("-s", "--spec", help="Create spec file", action="store_true") + parser.add_argument("-b", "--build", help="Build rpm package", action="store_true") + parser.add_argument("-r", "--rootpath", help="Build rpm package in root path", type=str, default=dft_root_path) + parser.add_argument("-d", "--download", help="Download source file indicated path", action="store_true") + parser.add_argument("-p", "--path", help="indicated path to store files", type=str, default=os.getcwd()) + parser.add_argument("-j", "--json", help="Get Package JSON info", action="store_true") + parser.add_argument("-o", "--output", help="Output to file", type=str, default="") + parser.add_argument("pkg", type=str, help="The Python Module Name") + args = parser.parse_args() + + response = get_pkg_json(args.pkg) + + if (args.spec): + build_spec(response, args.output) + + if (args.build): + ret = build_rpm(response, args.rootpath) + if ret != "": + print("BuildRequire : %s" % ret) + + if (args.download): + download_source(response, args.path) + + if (args.json): + store_json(response, args.pkg, args.path) + diff --git a/advisors/simple-update-robot.py b/advisors/simple-update-robot.py new file mode 100755 index 00000000..fff62082 --- /dev/null +++ b/advisors/simple-update-robot.py @@ -0,0 +1,136 @@ +#!/usr/bin/python3 +""" +This is a robot to do package upgrade automation +Expected process: + 1. get URL to download updated version + 2. Change Version to new one + 3. Change Source or Source0 if needed + 4. Update %changelog + 5. try rpmbuild -bb (not yet) + 6. fork on gitee + 7. git clone, git add, git commit, git push (manually now) + 8. PR on gitee +""" + +from pyrpm.spec import Spec, replace_macros +import yaml +import argparse +import gitee +import sys +import subprocess +import os.path +import re +import datetime + +def download_source_url(spec, o_ver, n_ver): + """ + Download source file from Source or Source0 URL + """ + source = replace_macros(spec.sources[0], spec).replace(o_ver, n_ver) + if re.match(r"%{.*?}", source): + print("Extra macros in URL which failed to be expanded") + return False + elif source.startswith("http") or source.startswith("ftp"): + fn = os.path.basename(source) + subprocess.call(["curl", "-L", source, "-o", fn]) + return fn + else: + print("Not valid URL for Source code") + return False + + +def download_upstream_url(gt, repo, n_ver): + """ + Download source from upstream metadata URL + """ + upstream_yaml = gt.get_yaml(repo) + if not upstream_yaml: + return False + + rp_yaml = yaml.loads(upstream_yaml, Loader=yaml.Loader) + if rp_yaml["version_control"] == "github": + url = "https://github.com/{rp}/archive/{nv}.tar.gz".format(rp=rp_yaml["src_repo"], nv=n_ver) + fn = "{rp}.{nv}.tar.gz".format(rp=repo, nv=n_ver) + subprocess.call(["curl", "-L", url, "-o", fn]) + return fn + else: + print("Handling {vc} is still under developing".format(vc=rp_yaml["version_control"])) + return False + + +def create_spec(repo, spec_str, o_ver, n_ver, src_fn=None): + """ + Create new spec file for upgraded package + """ + fn = open(repo + ".spec", "w") + in_changelog = False + for l in spec_str.splitlines(): + if l.startswith("Release:"): + fn.write("Release:\t0\n") + continue + if l.startswith("Source:") or l.startswith("Source0:"): + if src_fn: + fn.write("Source: {src_fn}\n".format(src_fn=src_fn).replace(o_ver, n_ver)) + else: + fn.write(l.replace(o_ver, n_ver)+"\n") + continue + if not in_changelog: + nl = l.replace(o_ver, n_ver) + else: + nl = l + fn.write(nl + "\n") + + if nl.startswith("%changelog"): + in_changelog = True + d = datetime.date.today() + fn.write(d.strftime("* %a %b %d %Y SimpleUpdate Robot - {ver}-0\n").format(ver=n_ver)) + fn.write("- Update to version {ver}\n".format(ver=n_ver)) + fn.write("\n") + fn.close() + +if __name__ == "__main__": + pars = argparse.ArgumentParser() + pars.add_argument("pkg", type=str, help="The package to be upgraded") + pars.add_argument("-o", "--old_version", type=str, help="Current upstream version of package") + pars.add_argument("-n", "--new_version", type=str, help="New upstream version of package will be upgrade to") + pars.add_argument("-s", "--create_spec", help="Create spec file", action="store_true") + pars.add_argument("-d", "--download", help="Download upstream source code", action="store_true") + pars.add_argument("-f", "--fork", help="fork src-openeuler repo into users", action="store_true") + pars.add_argument("-c", "--clone", help="clone privatge repo to local", action="store_true") + pars.add_argument("-p", "--PR", help="Create upgrade PR", action="store_true") + args = pars.parse_args() + + my_gitee = gitee.Gitee() + spec_string= my_gitee.get_spec(args.pkg) + + s_spec = Spec.from_string(spec_string) + + if args.fork: + my_gitee.fork_repo(args.pkg) + + if args.clone: + user=my_gitee.token["user"] + subprocess.call(["git", "clone", "git@gitee.com:{user}/{pkg}".format(user=user, pkg=args.pkg)]) + os.chdir(args.pkg) + + if args.download: + source_file = download_source_url(s_spec, args.old_version, args.new_version) + if source_file: + print(source_file) + else: + source_file = download_upstream_url(my_gitee, args.pkg, args.new_version) + if source_file: + print(source_file) + else: + print("Failed to download the latest source code.") + sys.exit(1) + + if args.create_spec: + if len(s_spec.patches) >= 1: + print("I'm too naive to handle complicated package.") + print("This package has multiple in-house patches.") + sys.exit(1) + create_spec(args.pkg, spec_string, args.old_version, args.new_version) + + if args.PR: + my_gitee.create_pr(my_gitee.token["user"], args.pkg) diff --git a/advisors/tc_reminder.py b/advisors/tc_reminder.py new file mode 100755 index 00000000..1c76f68a --- /dev/null +++ b/advisors/tc_reminder.py @@ -0,0 +1,130 @@ +#!/usr/bin/python3 +""" +This is a command line tool to create reminder list for TC member +""" + +import urllib +import urllib.request +import urllib.parse +import argparse +import json +import sys +import os +import yaml +from pprint import pprint +from datetime import datetime + +class Advisor(object): + """ + This is a object abstract TC robot + """ + def __init__(self): + self.secret = open(os.path.expanduser("~/.gitee_personal_token.json"), "r") + self.token = json.load(self.secret) + self.header = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0"} + self.tc_members = None + self.time_format = "%Y-%m-%dT%H:%M:%S%z" + + def get_json(self, url): + """ + Return object parsed from remote json + """ + headers = self.header.copy() + headers["Content-Type"] = "application/json;charset=UTF-8" + req = urllib.request.Request(url = url, + headers = headers, + method = "GET") + + with urllib.request.urlopen(req) as u: + resp = json.loads(u.read().decode("utf-8")) + return resp + + def get_file(self, repo, path): + """ + Get remote raw file + """ + url = "https://gitee.com/{repo}/raw/master/{path}".format(repo=repo, path=path) + req = urllib.request.Request(url = url, + headers = self.header, + method = "GET") + + with urllib.request.urlopen(req) as u: + resp = u.read() + + return resp + + def get_prs(self): + """ + Get list of PRs + """ + pulls_url = "https://gitee.com/api/v5/repos/openeuler/community/pulls" + list_url = pulls_url + "?access_token={token}&state=open&sort=created&direction=desc&page=1&per_page=100" + url = list_url.format(token=self.token["access_token"]) + return self.get_json(url) + + def get_pr_comments(self, number): + """ + Get Comments for a specific PR + """ + pulls_url = "https://gitee.com/api/v5/repos/openeuler/community/pulls" + desc_url = pulls_url + "/{number}/comments?access_token={token}&page=1&per_page=100" + url = desc_url.format(number=number, token=self.token["access_token"]) + return self.get_json(url) + + def get_tc_members(self): + """ + Get list of current TC members + """ + m = yaml.load(adv.get_file("openeuler/community", "sig/TC/OWNERS"), Loader=yaml.Loader) + self.tc_members = m["maintainers"] + return m["maintainers"] + + def filter_out_tc(self, users): + """ + Pick TC members from users + """ + if not self.tc_members: + self.get_tc_members() + return [x for x in self.tc_members if x in users] + + +if __name__ == "__main__": + par = argparse.ArgumentParser() + + args = par.parse_args() + + adv = Advisor() + PRs = adv.get_prs() + PRs.reverse() + for pr in PRs: + commenters = [] + commenters.append(pr["user"]["login"]) + last_update = pr["updated_at"] + print("URL: https://gitee.com/openeuler/community/pulls/{number}".format(number=pr["number"])) + print("Title: " + pr["title"]) + comments = adv.get_pr_comments(pr["number"]) + last_update = datetime.strptime(comments[0]["updated_at"], adv.time_format) + comments.reverse() + current_lgtm = 0 + current_approve = False + for comment in comments: + commenters.append(comment["user"]["login"]) + if comment["body"].startswith("new changes are detected"): + last_update = datetime.strptime(comment["updated_at"], adv.time_format) + break # older comments are ignored + elif comment["body"].startswith("***lgtm*** is added in this pull request"): + current_lgtm = current_lgtm + 1 + elif comment["body"].startswith("***approved*** is added in this pull request"): + current_approve = True + + tc = adv.filter_out_tc(commenters) + age = datetime.now() - last_update.replace(tzinfo=None) + age_days = max(age.days, 0) + print("Currently {num} days old".format(num=age_days)) + print("Currently involved TC members: " + ", ".join(tc)) + print("Currently has {num} /lgtm".format(num=current_lgtm)) + if current_approve: + print("Currently /approve") + print("") + + diff --git a/advisors/who_maintain.py b/advisors/who_maintain.py new file mode 100755 index 00000000..21ddd5e8 --- /dev/null +++ b/advisors/who_maintain.py @@ -0,0 +1,103 @@ +#!/usr/bin/python3 +""" +This is a simple script to query that contact person for specific package +""" + +import urllib +import urllib.request +import argparse +import yaml +import re + +# Useful default setting +headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW 64; rv:23.0) Gecko/20100101 Firefox/23.0'} +# known important information +sigs_url = "https://gitee.com/openeuler/community/raw/master/sig/sigs.yaml" +sigs_owner_url_template = "https://gitee.com/openeuler/community/raw/master/sig/{signame}/OWNERS" +specfile_url_template = "https://gitee.com/src-openeuler/{package}/raw/master/{specfile}" +specfile_exception_url = "https://gitee.com/shinwell_hu/openEuler-Advisor/raw/master/helper/specfile_exceptions.yaml" + + +def get_gitee(url): + req = urllib.request.Request(url=url, headers=headers) + u = urllib.request.urlopen(req) + return u.read().decode("utf-8") + + +def get_sigs(): + req = urllib.request.Request(url=sigs_url, headers=headers) + u = urllib.request.urlopen(req) + sigs = yaml.load(u.read().decode("utf-8"), Loader=yaml.Loader) + return sigs + + +def get_spec(pkg, specfile): + url = specfile_url_template.format(package=pkg, specfile=specfile) + req = urllib.request.Request(url=url, headers=headers) + u = urllib.request.urlopen(req) + return u.read().decode("utf-8") + + +def get_spec_exception(): + req = urllib.request.Request(url=specfile_exception_url, headers=headers) + u = urllib.request.urlopen(req) + exps = yaml.load(u.read().decode("utf-8"), Loader=yaml.Loader) + return exps + + +def get_manager_sig(pkg): + sis_load = get_sigs() + for sig in sis_load["sigs"]: + for repo in sig["repositories"]: + if repo == "src-openeuler/"+pkg: + return sig["name"] + + +def get_sig_owners(sig_name): + url = sigs_owner_url_template.format(signame=sig_name) + r = get_gitee(url) + owners = yaml.load(r, Loader=yaml.Loader) + return owners["maintainers"] + + +if __name__ == "__main__": + + parser = argparse.ArgumentParser() + parser.add_argument("pkg", type=str, help="The Package to be Queried") + args = parser.parse_args() + + s = get_manager_sig(args.pkg) + o = get_sig_owners(s) + print("SIG Owner:") + for owner in o: + print("\t"+owner) + + exp = get_spec_exception() + if args.pkg in exp: + dir_name = exp[args.pkg]["dir"] + file_name = exp[args.pkg]["file"] + specurl = specfile_url_template.format(package=args.pkg, specfile=dir_name + "/" + file_name) + else: + specurl = specfile_url_template.format(package=args.pkg, specfile=args.pkg+".spec") + + spec = get_gitee(specurl) + + in_changelog = False + emails = set() + for line in spec.splitlines(): + if line.startswith("%changelog"): + in_changelog = True + if line.startswith("*") and in_changelog: + m = re.match(r".*\d\d\d\d (.*) .*", line) + if m is None: + emails.add(line) + else: + n = m[1].split("<") + if len(n) == 1: + emails.add(n[0]) + else: + emails.add(n[0].strip() + " <" + n[1].strip()) + + print("Package Contributor:") + for email in emails: + print("\t"+email) diff --git a/simple-update-robot.rb b/simple-update-robot.rb deleted file mode 100755 index 7a5fde1a..00000000 --- a/simple-update-robot.rb +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/ruby -# process -# 1. get URL to download updated version -# so far we know the URL in spec is not reliable -# 2. Change Version to new one -# 3. Change Source or Source0 if needed -# 4. Update %changelog -# 5. try rpmbuild -bb -# 6. fork on gitee -# 7. git clone, git add, git commit, git push -# 8. PR on gitee - -require 'date' -require "./helper/download_spec.rb" -require "./helper/rpmparser.rb" -require 'yaml' - -if not ARGV[0] then - puts "Missing repo name" - exit 1 -end - -Old_ver = ARGV[1] -New_ver = ARGV[2] -specfile = download_spec(ARGV[0]) - -spec = Specfile.new (specfile) - -source = spec.get_sources -if source.length > 1 then - puts "I'm too Naive to handle complicated package" - exit 1 -end - -source = spec.expand_macros(source) - -def update_spec(file, over, nver, src_fn=false) - f = File.read(file) - fn = File.open(file+".new", "w") - in_changelog = false - f.each_line { |l| - if l.match(/^Release/) then - fn.puts "Release: 0" - next - end - if l.match(/^Source/) then - if src_fn then - fn.puts "Source: #{src_fn}" - else - fn.puts l - end - next - end - if not in_changelog then - nl = l.gsub(over, nver) - else - nl = l - end - fn.puts nl - if nl.match(/%changelog/) then - in_changelog = true - d = DateTime.now - fn.puts d.strftime("* %a %b %d %Y SimpleUpdate Robot ") - fn.puts "- Update to version #{ARGV[2]}" - fn.puts "" - end - } - fn.close - File.rename(file,file+".old") - File.rename(file+".new", file) -end - -def try_spec_url(src, over, nver) - src.each { |s| - ns = s.gsub(over, nver) - if ns.match(/%{.*?}/) then - STDERR.puts "Extra macros in URL which I cannot expand" - return false - elsif ns.match(/^http/) or ns.match(/^ftp/) then - fn = File.basename(ns) - cmd = "curl -L " + ns + " -o " + fn - puts cmd - %x[#{cmd}] - return fn - else - return false - end - } -end - -def try_upstream_url(repo, over, nver) - upstream_yaml = "upstream-info/"+repo+".yaml" - if not File.exist?(upstream_yaml) then - STDERR.puts "No upstream info found for this package" - return false - end - rp_yaml = YAML.load(File.read(upstream_yaml)) - if rp_yaml["version_control"] == "github" then - cmd = "curl -L https://github.com/#{rp_yaml["src_repo"]}/archive/#{nver}.tar.gz -o #{repo}.#{nver}.tar.gz" - %x[#{cmd}] - return "#{repo}.#{nver}.tar.gz" - else - STDERR.puts "Handling #{version_control} is still under developing" - return false - end - -end - -src_fn = try_spec_url(source, Old_ver, New_ver) -if src_fn then - update_spec(specfile, Old_ver, New_ver) -else - src_fn = try_upstream_url(ARGV[0], Old_ver, New_ver) - if src_fn then - update_spec(specfile, Old_ver, New_ver, src_fn) - else - STDERR.puts "Cannot find the source code for upgrading" - exit 1 - end -end - diff --git a/upstream-info/librsvg2.yaml b/upstream-info/librsvg2.yaml new file mode 100644 index 00000000..fde8df01 --- /dev/null +++ b/upstream-info/librsvg2.yaml @@ -0,0 +1,311 @@ +--- +version_control: github +src_repo: GNOME/librsvg +tag_prefix: '' +seperator: "." +last_query: + time_stamp: 2020-06-02 13:58:29.948841320 +00:00 + raw_data: | + [ + { + "name": "release-2-11-1", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/release-2-11-1", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/release-2-11-1", + "commit": { + "sha": "0a236be53fd71d380adfb88c8fd9181020098239", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/0a236be53fd71d380adfb88c8fd9181020098239" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvcmVsZWFzZS0yLTExLTE=" + }, + { + "name": "release-2-4-0", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/release-2-4-0", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/release-2-4-0", + "commit": { + "sha": "429a28d97b2023fd847c8486d32236d6f52155fc", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/429a28d97b2023fd847c8486d32236d6f52155fc" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvcmVsZWFzZS0yLTQtMA==" + }, + { + "name": "release-2-3-0", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/release-2-3-0", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/release-2-3-0", + "commit": { + "sha": "1614297ddebc5e6dfd15ee88a1eea2a3746b43a1", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/1614297ddebc5e6dfd15ee88a1eea2a3746b43a1" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvcmVsZWFzZS0yLTMtMA==" + }, + { + "name": "release-2-2-5", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/release-2-2-5", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/release-2-2-5", + "commit": { + "sha": "87605ee9f7dc1f2b235d39d4f8b448f22dc19952", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/87605ee9f7dc1f2b235d39d4f8b448f22dc19952" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvcmVsZWFzZS0yLTItNQ==" + }, + { + "name": "release-2-2-4", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/release-2-2-4", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/release-2-2-4", + "commit": { + "sha": "0f5337a7df15b31995faa7330c8dc7cc83d2a52c", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/0f5337a7df15b31995faa7330c8dc7cc83d2a52c" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvcmVsZWFzZS0yLTItNA==" + }, + { + "name": "librsvg-2-13-93", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/librsvg-2-13-93", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/librsvg-2-13-93", + "commit": { + "sha": "bb1050ccd9babe15523f170f50728ee6e6f2485f", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/bb1050ccd9babe15523f170f50728ee6e6f2485f" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvbGlicnN2Zy0yLTEzLTkz" + }, + { + "name": "librsvg-2-13-90", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/librsvg-2-13-90", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/librsvg-2-13-90", + "commit": { + "sha": "dc988d3bd6300a3451b1fbda990dec658eef4a6a", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/dc988d3bd6300a3451b1fbda990dec658eef4a6a" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvbGlicnN2Zy0yLTEzLTkw" + }, + { + "name": "librsvg-2-13-3", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/librsvg-2-13-3", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/librsvg-2-13-3", + "commit": { + "sha": "85b7070c87780b8a6bff07f6010cbb8c25ff1136", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/85b7070c87780b8a6bff07f6010cbb8c25ff1136" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvbGlicnN2Zy0yLTEzLTM=" + }, + { + "name": "help", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/help", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/help", + "commit": { + "sha": "0a48a8b673b84cf24c03aa29e93bee3d4b91dadb", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/0a48a8b673b84cf24c03aa29e93bee3d4b91dadb" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvaGVscA==" + }, + { + "name": "LIBRSVG_2_31_0", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_31_0", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_31_0", + "commit": { + "sha": "823a32d0e41b3e4c5b539bad88d461da04379338", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/823a32d0e41b3e4c5b539bad88d461da04379338" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzMxXzA=" + }, + { + "name": "LIBRSVG_2_26_3", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_26_3", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_26_3", + "commit": { + "sha": "364a9334e0f7dd0e36d013e6097cebce7615177d", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/364a9334e0f7dd0e36d013e6097cebce7615177d" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzI2XzM=" + }, + { + "name": "LIBRSVG_2_26_2", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_26_2", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_26_2", + "commit": { + "sha": "288f4d82d61b2d6a852bc791b0a7fbe64c6af45d", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/288f4d82d61b2d6a852bc791b0a7fbe64c6af45d" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzI2XzI=" + }, + { + "name": "LIBRSVG_2_26_1", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_26_1", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_26_1", + "commit": { + "sha": "08ffdfbddaac47f4987780a56e16ef3536fe68ce", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/08ffdfbddaac47f4987780a56e16ef3536fe68ce" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzI2XzE=" + }, + { + "name": "LIBRSVG_2_22_3", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_22_3", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_22_3", + "commit": { + "sha": "4df8e26cd3d10e04a4eba87162d2ca2765ccb23a", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/4df8e26cd3d10e04a4eba87162d2ca2765ccb23a" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzIyXzM=" + }, + { + "name": "LIBRSVG_2_2_0", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_2_0", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_2_0", + "commit": { + "sha": "de0244b9a772ab0457fd91cbaec37674d84bf1ba", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/de0244b9a772ab0457fd91cbaec37674d84bf1ba" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzJfMA==" + }, + { + "name": "LIBRSVG_2_1_5", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_1_5", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_1_5", + "commit": { + "sha": "0504ed7d1b803190f53e8a11e735a002a22d50a5", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/0504ed7d1b803190f53e8a11e735a002a22d50a5" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzFfNQ==" + }, + { + "name": "LIBRSVG_2_1_4", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_1_4", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_1_4", + "commit": { + "sha": "f6a50e0ebda357ee13bab80e489c79bc8374e701", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/f6a50e0ebda357ee13bab80e489c79bc8374e701" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzFfNA==" + }, + { + "name": "LIBRSVG_2_1_3", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_1_3", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_1_3", + "commit": { + "sha": "870c70748d09615b5b0797aac8fa5315288d2589", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/870c70748d09615b5b0797aac8fa5315288d2589" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzFfMw==" + }, + { + "name": "LIBRSVG_2_1_2", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_1_2", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_1_2", + "commit": { + "sha": "fa58e7e3ba9eab0e62b88d8b93eb395561024cdd", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/fa58e7e3ba9eab0e62b88d8b93eb395561024cdd" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzFfMg==" + }, + { + "name": "LIBRSVG_2_1_1", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_1_1", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_1_1", + "commit": { + "sha": "26bb1c031db67a6e8693a196e548b99c2903a8f4", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/26bb1c031db67a6e8693a196e548b99c2903a8f4" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzFfMQ==" + }, + { + "name": "LIBRSVG_2_1_0", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_1_0", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_1_0", + "commit": { + "sha": "44c68780f31e16e0a0ca56be7e51d540c6ae05d1", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/44c68780f31e16e0a0ca56be7e51d540c6ae05d1" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzFfMA==" + }, + { + "name": "LIBRSVG_2_0_1", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_0_1", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_0_1", + "commit": { + "sha": "a2603719613ed2b5610dce0b42b1acd8b72b239d", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/a2603719613ed2b5610dce0b42b1acd8b72b239d" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzBfMQ==" + }, + { + "name": "LIBRSVG_2_0_0", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_2_0_0", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_2_0_0", + "commit": { + "sha": "ae8e171e68aad016607da1daa29c60755a1ba3f1", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/ae8e171e68aad016607da1daa29c60755a1ba3f1" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18yXzBfMA==" + }, + { + "name": "LIBRSVG_1_1_6", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_1_1_6", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_1_1_6", + "commit": { + "sha": "e0fe99ffe3250816f787910487a317396f1789f7", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/e0fe99ffe3250816f787910487a317396f1789f7" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18xXzFfNg==" + }, + { + "name": "LIBRSVG_1_1_5", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_1_1_5", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_1_1_5", + "commit": { + "sha": "bb9904ee4eccd7f4f63ea64dca78cddc2409d03d", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/bb9904ee4eccd7f4f63ea64dca78cddc2409d03d" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18xXzFfNQ==" + }, + { + "name": "LIBRSVG_1_1_4", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_1_1_4", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_1_1_4", + "commit": { + "sha": "ec3f21d69b82666393daeb53c0abed8dbfc8e2e1", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/ec3f21d69b82666393daeb53c0abed8dbfc8e2e1" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18xXzFfNA==" + }, + { + "name": "LIBRSVG_1_1_3", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_1_1_3", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_1_1_3", + "commit": { + "sha": "48015cc5fee79753003e8aba75ce1176a0238353", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/48015cc5fee79753003e8aba75ce1176a0238353" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18xXzFfMw==" + }, + { + "name": "LIBRSVG_1_1_2", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_1_1_2", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_1_1_2", + "commit": { + "sha": "e8733090897dc8d6adf7908edfa9f20b092cf281", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/e8733090897dc8d6adf7908edfa9f20b092cf281" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18xXzFfMg==" + }, + { + "name": "LIBRSVG_1_1_1", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_1_1_1", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_1_1_1", + "commit": { + "sha": "0853a7373839a2cc5bcc2fa562f080195543fa5e", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/0853a7373839a2cc5bcc2fa562f080195543fa5e" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18xXzFfMQ==" + }, + { + "name": "LIBRSVG_1_0_3", + "zipball_url": "https://api.github.com/repos/GNOME/librsvg/zipball/LIBRSVG_1_0_3", + "tarball_url": "https://api.github.com/repos/GNOME/librsvg/tarball/LIBRSVG_1_0_3", + "commit": { + "sha": "e1f30e54c8dec142aea8bdad8fdc9e09d9e81351", + "url": "https://api.github.com/repos/GNOME/librsvg/commits/e1f30e54c8dec142aea8bdad8fdc9e09d9e81351" + }, + "node_id": "MDM6UmVmNDUzNDg0MzpyZWZzL3RhZ3MvTElCUlNWR18xXzBfMw==" + } + ] +query_type: api.github.tags diff --git a/upstream-info/nftables.yaml b/upstream-info/nftables.yaml new file mode 100644 index 00000000..d66fed8b --- /dev/null +++ b/upstream-info/nftables.yaml @@ -0,0 +1,8 @@ +--- +version_control: git +src_repo: git://git.netfilter.org/nftables +tag_prefix: "^v" +seperator: "." +last_query: + time_stamp: 2020-06-03 01:43:09.627625360 +00:00 + raw_data: "bfc70e6671155a9e2ffbac319716a5b1b5bb4861\trefs/tags/v0.01-alpha1\nfac10ea799fe9b6158d74f66d6ad46536d38a545\trefs/tags/v0.01-alpha1^{}\n6de1b49392702b8106446c35194136a1519e8062\trefs/tags/v0.099\n6d0a165e402e6477203111ca9c7ce49f0a3fd758\trefs/tags/v0.099^{}\n8bda517509687adce208e876bf68d35dd66d158f\trefs/tags/v0.2\ndaf4958b54bd1a20ab022cced4d5b0566119676d\trefs/tags/v0.2^{}\nb0441c6b2818b35c54179ace20eec198421694a7\trefs/tags/v0.3\nae73759150652213029718ecfa3017fa28e879c1\trefs/tags/v0.3^{}\n372faf5c5581b39587845657c893686db723c4a3\trefs/tags/v0.4\nf8aa0c23dc864760bf4ab6420477546ba2ba683a\trefs/tags/v0.4^{}\nb68cda72dfc1123de70b6b0df834046f191b52b4\trefs/tags/v0.5\n7658a537449bdad1e9c101abfb70556511ee204d\trefs/tags/v0.5^{}\n487fb2c1c42c958220f5ec011c4fb83d3d4cac2f\trefs/tags/v0.6\n9ca03cf40fe5eb50d61258c49153d3705ce669a9\trefs/tags/v0.6^{}\n79cbd19e7437680561b26109bbf4f48cb2e8e0a7\trefs/tags/v0.7\nf2fb89ebb622b49186dc9c76f9fcb76f57c35624\trefs/tags/v0.7^{}\nddfda547db0da2f98d56c7a72517486d7df4986b\trefs/tags/v0.8\nd58807906ff3293f7ec912ee69ca47af2c635f94\trefs/tags/v0.8^{}\n20445bdefdb5bad41bb75e60e3dcd680cf73f99a\trefs/tags/v0.8.1\n1dbd13c97e300dcaf6581bc7b0b0f23cc74c6645\trefs/tags/v0.8.1^{}\n6210cc7ae6e7c7b08bc3c1d23f29a57dbea8596e\trefs/tags/v0.8.2\n702cf0a7958d6456089b39bffef279d390db2e7a\trefs/tags/v0.8.2^{}\n4f7d79f128bac8795f7d686d7b9ad6328d024df6\trefs/tags/v0.8.3\n8162d2b96718041dadc52ab127db9d91a2c223cc\trefs/tags/v0.8.3^{}\n622c36a40e7049bf82e6575a440b7f3ffc62b623\trefs/tags/v0.8.4\n64983d7cb595e773b13d8f3b656b30623d9fe430\trefs/tags/v0.8.4^{}\nf84c87dfea7a30ff43384cba7131da7cb139b050\trefs/tags/v0.8.5\n72df4a09f77bfdbd346ce79ea520149177d1267f\trefs/tags/v0.8.5^{}\n575c7abc63d1483d526af15781dec9b0789bb992\trefs/tags/v0.9.0\ncd21a243162a2c4b35e4e91b3c4e925ac34ae82c\trefs/tags/v0.9.0^{}\n80515bc802d8d146415b6ee0e5f3892dc121a41c\trefs/tags/v0.9.1\ne614cd48a2648779c1bac5110b96648ad961547f\trefs/tags/v0.9.1^{}\n7554205ea6241f06ceeee23dceee8d1ba37de7c9\trefs/tags/v0.9.2\nd42e9a1b9abc3b8a3cefce03baa0b12be1ba8b6e\trefs/tags/v0.9.2^{}\n2b77e15ab66fb978a6d8925361cf98ec238441f0\trefs/tags/v0.9.3\nf8ab7f03c1bbb3652ad055b9a77a3f2b5d8a5417\trefs/tags/v0.9.3^{}\ne92f0ef3e0bc930c67d4b5c4996a951d3961cb25\trefs/tags/v0.9.4\naa2ddbfbee904445b3593082455056ba3fed321c\trefs/tags/v0.9.4^{}\n" -- Gitee From 045a910e3612704808708e6cc2f5cf16eee12c01 Mon Sep 17 00:00:00 2001 From: Shinwell Hu Date: Mon, 15 Jun 2020 02:57:06 +0000 Subject: [PATCH 3/9] remove unused directory --- results/gnome.result | 372 -------------------- results/metacpan.result | 749 ---------------------------------------- results/python.result | 608 -------------------------------- temp/check | 15 - temp/checkout-git.sh | 8 - temp/cleanup-git.sh | 6 - temp/ls-tag-git.sh | 9 - temp/test_run.sh | 8 - 8 files changed, 1775 deletions(-) delete mode 100644 results/gnome.result delete mode 100644 results/metacpan.result delete mode 100644 results/python.result delete mode 100755 temp/check delete mode 100755 temp/checkout-git.sh delete mode 100755 temp/cleanup-git.sh delete mode 100755 temp/ls-tag-git.sh delete mode 100755 temp/test_run.sh diff --git a/results/gnome.result b/results/gnome.result deleted file mode 100644 index 8fbd7439..00000000 --- a/results/gnome.result +++ /dev/null @@ -1,372 +0,0 @@ -libgee: -Latest upstream is 0.20.3 -Recommended is 0.13.5.1 -Current version is 0.20.1 -libgudev: -Latest upstream is 233 -Recommended is 233 -Current version is 233 -gnome-user-docs: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.1 -tracker-miners: -Latest upstream is 2.3.3 -Recommended is 2.3.3 -Current version is 2.1.5 -gnome-shell: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.1 -vinagre: -Latest upstream is 3.22.0 -Recommended is 3.15.92 -Current version is 3.22.0 -gdm: -Latest upstream is 3.34.1 -Recommended is 3.34.1 -Current version is 3.30.1 -libgnome-keyring: -Latest upstream is 3.12.0 -Recommended is 3.11.92 -Current version is 3.12.0 -xdg-user-dirs-gtk: -Latest upstream is 0.10 -Recommended is 0.10 -Current version is 0.10 -libsecret: -Latest upstream is 0.20.3 -Recommended is 0.18.6 -Current version is 0.18.6 -phodav: -Latest upstream is 2.4 -Recommended is 2.2 -Current version is 2.2 -gvfs: -Latest upstream is 1.44.1 -Recommended is 1.44.1 -Current version is 1.40.2 -gjs: -Latest upstream is 1.65.1 -Recommended is 1.65.1 -Current version is 1.54.1 -glib-networking: -Latest upstream is 2.64.2 -Recommended is 2.64.2 -Current version is 2.58.0 -yelp-xsl: -Latest upstream is 3.36.0 -Recommended is 3.34.2 -Current version is 3.34.0 -gnome-bluetooth: -Latest upstream is 3.34.1 -Recommended is 3.34.1 -Current version is 3.28.2 -libgnomeui: -Latest upstream is 2.24.5 -Recommended is 2.24.5 -Current version is 2.24.5 -adwaita-icon-theme: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.32.0 -orca: -Latest upstream is 3.37.1 -Recommended is 3.37.1 -Current version is 3.30.0 -libgdata: -Latest upstream is 0.17.12 -Recommended is 0.17.9 -Current version is 0.17.9 -gtk-doc: -Latest upstream is 1.32 -Recommended is 1.29 -Current version is 1.29 -network-manager-applet: -Latest upstream is 1.17.0-dev -Recommended is 1.8.25-dev -Current version is 1.8.22 -NetworkManager-libreswan: -Latest upstream is 1.3.0-dev -Recommended is 1.2.13-dev -Current version is 1.2.4 -clutter-gtk: -Latest upstream is 1.8.4 -Recommended is 1.8.4 -Current version is 1.8.4 -gnome-shell-extensions: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.1 -file-roller: -Latest upstream is 3.36.2 -Recommended is 3.36.2 -Current version is 3.30.1 -gcr: -Latest upstream is 3.36 -Recommended is 3.35.91 -Current version is 3.34.0 -evince: -Latest upstream is 3.36.0 -Recommended is 3.35.92 -Current version is 3.30.1 -gnome-font-viewer: -Latest upstream is 3.34.0 -Recommended is 3.33.90 -Current version is 3.30.0 -gnome-dictionary: -Latest upstream is 3.26.1 -Recommended is 3.26.1 -Current version is 3.26.1 -geocode-glib: -Latest upstream is 3.26.2 -Recommended is 3.26.2 -Current version is 3.26.1 -mutter: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.1 -atk: -Latest upstream is EA_1_0 -Recommended is 2.30.0 -Current version is 2.30.0 -gnome-session: -Latest upstream is 3.36.0 -Recommended is 3.35.3 -Current version is 3.30.1 -gnome-menus: -Latest upstream is 3.36.0 -Recommended is 3.35.3 -Current version is 3.13.3 -ORBit2: -Latest upstream is 3.110 -Recommended is 3.110 -Current version is 2.14.19 -gnome-clocks: -Latest upstream is 3.36.0 -Recommended is 3.35.92 -Current version is 3.30.0 -gsound: -Latest upstream is 1.15.2 -Recommended is 1.15.2 -Current version is 1.0.2 -gnome-online-accounts: -Latest upstream is 3.36.0 -Recommended is 3.35.90 -Current version is 3.30.0 -gnome-keyring: -Latest upstream is 3.36.0 -Recommended is 3.35.90 -Current version is 3.28.2 -pango: -Latest upstream is 1.44.7 -Recommended is 1.44.7 -Current version is 1.43.0 -gnome-disk-utility: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.2 -totem-pl-parser: -Latest upstream is 3.26.5 -Recommended is 3.26.5 -Current version is 3.26.1 -libgnome: -Latest upstream is 2.32.1 -Recommended is 2.32.1 -Current version is 2.32.1 -metacity: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.1 -gnome-video-effects: -Latest upstream is 0.5.0 -Recommended is 0.4.3 -Current version is 0.4.3 -libmediaart: -Latest upstream is 1.9.4 -Recommended is 1.9.4 -Current version is 1.9.4 -pangomm: -Latest upstream is 2.43.2 -Recommended is 2.43.2 -Current version is 2.40.1 -libgxps: -Latest upstream is 0.3.1 -Recommended is 0.2.3.2 -Current version is 0.3.1 -gnome-initial-setup: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.0 -libsoup: -Latest upstream is 2.70.0 -Recommended is 2.69.90 -Current version is 2.66.1 -json-glib: -Latest upstream is 1.4.4 -Recommended is 1.4.4 -Current version is 1.4.4 -gnome-settings-daemon: -Latest upstream is 3.36.0 -Recommended is 3.35.92 -Current version is 3.30.1.2 -gspell: -Latest upstream is 1.8.3 -Recommended is 1.8.3 -Current version is 1.8.1 -gnome-terminal: -Latest upstream is 3.36.1.1 -Recommended is 3.36.1.1 -Current version is 3.30.1 -tracker: -Latest upstream is 2_2_0 -Recommended is 2.3.4 -Current version is 2.1.5 -vala: -Latest upstream is 0.48.5 -Recommended is 0.42.2 -Current version is 0.42.2 -atkmm: -Latest upstream is 2.53.3 -Recommended is 2.53.3 -Current version is 2.24.2 -dconf-editor: -Latest upstream is 3.36.0 -Recommended is 3.35.91 -Current version is 3.30.2 -libpeas: -Latest upstream is 1.26.0 -Recommended is 1.25.3 -Current version is 1.22.0 -libgit2-glib: -Latest upstream is .0.99.0 -Recommended is 0.27.8 -Current version is 0.27.8 -gnome-doc-utils: -Latest upstream is 0.20.10 -Recommended is 0.20.10 -Current version is 0.20.10 -gupnp: -Latest upstream is 1.2.2 -Recommended is 1.2.2 -Current version is 1.0.3 -libnotify: -Latest upstream is 0.7.9 -Recommended is 0.7.8 -Current version is 0.7.8 -dconf: -Latest upstream is 0.36.0 -Recommended is 0.34.0 -Current version is 0.34.0 -gupnp-igd: -Latest upstream is 0.2.5 -Recommended is 0.2.5 -Current version is 0.2.5 -libgsf: -Latest upstream is .1.14.47 -Recommended is .1.14.47 -Current version is 1.14.43 -evolution-data-server: -Latest upstream is 3.37.1 -Recommended is 3.37.1 -Current version is 3.30.1 -mobile-broadband-provider-info: -Latest upstream is 20190618 -Recommended is 20190116 -Current version is 20190116 -gnome-autoar: -Latest upstream is 0.2.4 -Recommended is 0.2.3 -Current version is 0.2.3 -glade: -Latest upstream is 3.22.2 -Recommended is 3.22.2 -Current version is 3.22.1 -libgnomekbd: -Latest upstream is 3.26.1 -Recommended is 3.26.1 -Current version is 3.26.1 -gnome-packagekit: -Latest upstream is 3.32.0 -Recommended is 3.25.90 -Current version is 3.30.0 -brasero: -Latest upstream is 3.12.2 -Recommended is 3.12.2 -Current version is 3.12.2 -gnome-contacts: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.1 -gnome-getting-started-docs: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.30.0 -gnome-calculator: -Latest upstream is 4.3.0 -Recommended is 4.3.0 -Current version is 3.30.1 -eog: -Latest upstream is 3.36.1 -Recommended is 3.36.1 -Current version is 3.28.4 -gtk-vnc: -Latest upstream is 1.0.0 -Recommended is 0.9.0 -Current version is 0.9.0 -folks: -Latest upstream is .0.9.8 -Recommended is .0.9.7.1 -Current version is 0.11.4 -gnome-common: -Latest upstream is 3.18.0 -Recommended is 3.7.4 -Current version is 3.18.0 -libgovirt: -Latest upstream is 0.3.7 -Recommended is 0.3.4 -Current version is 0.3.4 -yelp-tools: -Latest upstream is 3.32.2 -Recommended is 3.32.2 -Current version is 3.28.0 -gnome-screenshot: -Latest upstream is 3.36.0 -Recommended is 3.33.90 -Current version is 3.30.0 -libgweather: -Latest upstream is 3.36.0 -Recommended is 3.33.92 -Current version is 3.32.2 -notification-daemon: -Latest upstream is 3.20.0 -Recommended is 3.18.2 -Current version is 3.20.0 -gnome-color-manager: -Latest upstream is 3.36.0 -Recommended is 3.35.90 -Current version is 3.30.0 -gsettings-desktop-schemas: -Latest upstream is 3_3_92 -Recommended is 3.35.91 -Current version is 3.34.0 -gnome-system-monitor: -Latest upstream is 3.36.0 -Recommended is 3.35.92 -Current version is 3.28.2 -nautilus: -Latest upstream is 3.37.1 -Recommended is 3.37.1 -Current version is 3.33.90 -gnome-themes-standard: -Latest upstream is 3.28 -Recommended is 3.27.92 -Current version is 3.27.90 -gcab: -Latest upstream is 1.4 -Recommended is 1.1 -Current version is 1.1 -gssdp: -Latest upstream is 1.2.2 -Recommended is 1.2.2 -Current version is 1.0.2 diff --git a/results/metacpan.result b/results/metacpan.result deleted file mode 100644 index 69267f76..00000000 --- a/results/metacpan.result +++ /dev/null @@ -1,749 +0,0 @@ -perl-DBD-MySQL: -Latest upstream is 4.050 -Current version is 4.046 -perl-WWW-RobotRules: -Latest upstream is 6.02 -Current version is 6.02 -perl-Path-Class: -Latest upstream is 0.37 -Current version is 0.37 -perl-Module-Manifest-Skip: -Latest upstream is 0.23 -Current version is 0.23 -perl-Module-Package: -Latest upstream is 0.30 -Current version is 0.30 -perl-DB_File: -Latest upstream is 1.853 -Current version is 1.842 -perl-Data-Dumper: -Latest upstream is 2.173 -Current version is 2.172 -perl-Test-LeakTrace: -Latest upstream is 0.16 -Current version is 0.16 -perl-Package-Generator: -perl-Mail-DKIM: -Latest upstream is 0.58 -Current version is 0.53 -perl-bignum: -Latest upstream is 0.51 -Current version is 0.50 -perl-ExtUtils-InstallPaths: -Latest upstream is 0.012 -Current version is 0.012 -perl-File-Which: -Latest upstream is 1.23 -Current version is 1.22 -perl-Archive-Zip: -Latest upstream is 1.68 -Current version is 1.64 -perl-XML-LibXML: -Latest upstream is 2.0204 -Current version is 2.0132 -perl-Test-Fatal: -Latest upstream is 0.014 -Current version is 0.014 -perl-Text-WrapI18N: -Latest upstream is 0.06 -Current version is 0.06 -perl-Unicode-UTF8: -Latest upstream is 0.62 -Current version is 0.62 -perl-Sub-Exporter: -Latest upstream is 0.987 -Current version is 0.987 -perl-Devel-CheckLib: -Latest upstream is 1.14 -Current version is 1.13 -perl-MRO-Compat: -Latest upstream is 0.13 -Current version is 0.13 -perl-File-BaseDir: -Latest upstream is 0.08 -Current version is 0.08 -perl-strictures: -Latest upstream is 2.000006 -Current version is 2.000006 -perl-Text-Tabs+Wrap: -Latest upstream is 2013.0523 -Current version is 2013.0523 -perl-ExtUtils-ParseXS: -Latest upstream is 3.35 -Current version is 3.35 -perl-Socket-MsgHdr: -Latest upstream is 0.05 -Current version is 0.05 -perl-MailTools: -Latest upstream is 2.21 -Current version is 2.20 -perl-HTML-Parser: -Latest upstream is 3.72 -Current version is 3.72 -perl-Digest: -Latest upstream is 1.17 -Current version is 1.17 -perl-Package-Constants: -Latest upstream is 0.06 -Current version is 0.06 -perl-libxml-perl: -Latest upstream is 0.08 -Current version is 0.08 -perl-Term-Cap: -Latest upstream is 1.17 -Current version is 1.17 -perl-File-Sync: -Latest upstream is 0.11 -Current version is 0.11 -perl-Test-Needs: -Latest upstream is 0.002006 -Current version is 0.002005 -perl-Sub-Exporter-Progressive: -Latest upstream is 0.001013 -Current version is 0.001013 -perl-Crypt-OpenSSL-RSA: -Latest upstream is 0.31 -Current version is 0.30 -perl-CGI: -Latest upstream is 4.46 -Current version is 4.46 -perl-Module-Install-AuthorTests: -Latest upstream is 0.002 -Current version is 0.002 -perl-CPAN-Meta-YAML: -Latest upstream is 0.018 -Current version is 0.018 -perl-Path-Tiny: -Latest upstream is 0.112 -Current version is 0.108 -perl-Sys-MemInfo: -perl-Crypt-OpenSSL-Random: -Latest upstream is 0.15 -Current version is 0.15 -perl-Compress-Bzip2: -Latest upstream is 2.26 -Current version is 2.26 -perl-File-Copy-Recursive: -Latest upstream is 0.45 -Current version is 0.44 -perl-XML-Parser: -Latest upstream is 2.46 -Current version is 2.44 -perl-YAML: -Latest upstream is 1.30 -Current version is 1.26 -perl-Module-Load-Conditional: -Latest upstream is 0.70 -Current version is 0.68 -perl-Config-AutoConf: -Latest upstream is 0.318 -Current version is 0.317 -perl-Business-ISBN-Data: -Latest upstream is 20191107 -Current version is 20191107 -perl-Parallel-ForkManager: -Latest upstream is 2.02 -Current version is 2.02 -perl-Carp-Clan: -Latest upstream is 6.08 -Current version is 6.06 -perl-Sub-Install: -Latest upstream is 0.928 -Current version is 0.928 -perl-File-Listing: -Latest upstream is 6.04 -Current version is 6.04 -perl-Types-Serialiser: -Latest upstream is 1.0 -Current version is 1.0 -perl-Crypt-DES: -Latest upstream is 2.07 -Current version is 2.07 -perl-Bit-Vector: -Latest upstream is 7.4 -Current version is 7.4 -perl-Module-Metadata: -Latest upstream is 1.000037 -Current version is 1.000036 -perl-JSON-XS: -Latest upstream is 4.02 -Current version is 3.04 -perl-Module-Build-Tiny: -Latest upstream is 0.039 -Current version is 0.039 -perl-File-MimeInfo: -Latest upstream is 0.29 -Current version is 0.29 -perl-File-Slurp: -Latest upstream is 9999.30 -Current version is 9999.19 -perl-CPAN: -Latest upstream is 2.27 -Current version is 2.27 -perl-podlators: -Latest upstream is 4.14 -Current version is 4.11 -perl-Module-Build: -Latest upstream is 0.4231 -Current version is 0.42.24 -perl-Config-IniFiles: -Latest upstream is 3.000003 -Current version is 2.98 -perl-Net-HTTP: -Latest upstream is 6.19 -Current version is 6.18 -perl-local-lib: -Latest upstream is 2.000024 -Current version is 2.000024 -perl-List-MoreUtils: -Latest upstream is 0.428 -Current version is 0.428 -perl-Import-Into: -Latest upstream is 1.002005 -Current version is 1.002005 -perl-Mail-Sender: -Latest upstream is 0.903 -Current version is 0.903 -perl-Text-CharWidth: -Latest upstream is 0.04 -Current version is 0.04 -perl-Test-Deep: -Latest upstream is 1.130 -Current version is 1.128 -perl-File-pushd: -Latest upstream is 1.016 -Current version is 1.016 -perl-threads: -Latest upstream is 2.21 -Current version is 2.22 -perl-Devel-Symdump: -Latest upstream is 2.18 -Current version is 2.18 -perl-Getopt-Long: -Latest upstream is 2.51 -Current version is 2.50 -perl-IO-Compress: -Latest upstream is 2.093 -Current version is 2.081 -perl-B-Debug: -Latest upstream is 1.26 -Current version is 1.26 -perl-String-CRC32: -Latest upstream is 1.8 -Current version is 1.7 -perl-File-Temp: -Latest upstream is 0.2309 -Current version is 0.230.800 -perl-Sub-Quote: -Latest upstream is 2.006006 -Current version is 2.005001 -perl-IPC-SysV: -Latest upstream is 2.07 -Current version is 2.07 -perl-HTTP-Date: -Latest upstream is 6.05 -Current version is 6.02 -perl-IO-Multiplex: -Latest upstream is 1.16 -Current version is 1.16 -perl-Tk: -Latest upstream is 804.035 -Current version is 804.034 -perl-Unicode-LineBreak: -Latest upstream is 2019.001 -Current version is 2019.001 -perl-Test-Warn: -Latest upstream is 0.36 -Current version is 0.36 -perl-Test-Requires: -Latest upstream is 0.10 -Current version is 0.10 -perl-CPAN-Meta: -Latest upstream is 2.150010 -Current version is 2.150010 -perl-Locale-Codes: -Latest upstream is 3.63 -Current version is 3.58 -perl-Digest-HMAC: -Latest upstream is 1.03 -Current version is 1.03 -perl-Socket: -Latest upstream is 2.029 -Current version is 2.029 -perl-Perl-OSType: -Latest upstream is 1.010 -Current version is 1.010 -perl-Regexp-Common: -Latest upstream is 2017060201 -Current version is 2017060201 -perl-Module-Install-ManifestSkip: -Latest upstream is 0.24 -Current version is 0.24 -perl-ExtUtils-Manifest: -Latest upstream is 1.72 -Current version is 1.71 -perl-MIME-Lite: -Latest upstream is 3.031 -Current version is 3.030 -perl-String-ShellQuote: -Latest upstream is 1.04 -Current version is 1.04 -perl-Term-ANSIColor: -Latest upstream is 5.01 -Current version is 4.06 -perl-Module-Install-ReadmeMarkdownFromPod: -Latest upstream is 0.04 -Current version is 0.04 -perl-Switch: -Latest upstream is 2.17 -Current version is 2.17 -perl-Data-UUID: -Latest upstream is 1.226 -Current version is 1.221 -perl-Locale-Maketext: -Latest upstream is 1.29 -Current version is 1.28 -perl-gettext: -Latest upstream is 1.07 -Current version is 1.07 -perl-Devel-Size: -Latest upstream is 0.83 -Current version is 0.82 -perl-Test-FailWarnings: -Latest upstream is 0.008 -Current version is 0.008 -perl-Module-Runtime: -Latest upstream is 0.016 -Current version is 0.016 -perl-Exporter: -Latest upstream is 5.74 -Current version is 5.73 -perl-Class-Method-Modifiers: -Latest upstream is 2.13 -Current version is 2.12 -perl-Compress-Raw-Bzip2: -Latest upstream is 2.093 -Current version is 2.081 -perl-XML-Writer: -Latest upstream is 0.625 -Current version is 0.625 -perl-Net-SSLeay: -Latest upstream is 1.88 -Current version is 1.88 -perl-Math-BigInt: -Latest upstream is 1.999818 -Current version is 1.9998.13 -perl-XML-Simple: -Latest upstream is 2.25 -Current version is 2.25 -perl-File-Remove: -Latest upstream is 1.58 -Current version is 1.58 -perl-Test-InDistDir: -Latest upstream is 1.112071 -Current version is 1.112071 -perl-Net-Server: -Latest upstream is 2.009 -Current version is 2.009 -perl-File-Path: -Latest upstream is 2.16 -Current version is 2.16 -perl-Test-RequiresInternet: -Latest upstream is 0.05 -Current version is 0.05 -perl-Software-License: -Latest upstream is 0.103014 -Current version is 0.103013 -perl-XML-XPath: -Latest upstream is 1.44 -Current version is 1.42 -perl-JSON: -Latest upstream is 4.02 -Current version is 2.97.001 -perl-Readonly: -Latest upstream is 2.05 -Current version is 2.05 -perl-GSSAPI: -Latest upstream is 0.28 -Current version is 0.28 -perl-Digest-SHA1: -Latest upstream is 2.13 -Current version is 2.13 -perl-Authen-SASL: -Latest upstream is 2.16 -Current version is 2.16 -perl-Text-Unidecode: -Latest upstream is 1.30 -Current version is 1.30 -perl-List-MoreUtils-XS: -Latest upstream is 0.428 -Current version is 0.428 -perl-HTTP-Cookies: -Latest upstream is 6.08 -Current version is 6.04 -perl-Date-Manip: -Latest upstream is 6.81 -Current version is 6.73 -perl-inc-latest: -Latest upstream is 0.500 -Current version is 0.500 -perl-YAML-LibYAML: -Latest upstream is 0.81 -Current version is 0.74 -perl-MIME-Types: -Latest upstream is 2.17 -Current version is 2.17 -perl-Encode-Detect: -Latest upstream is 1.01 -Current version is 1.01 -perl-Digest-SHA3: -Latest upstream is 1.04 -Current version is 1.04 -perl-DBI: -Latest upstream is 1.643 -Current version is 1.642 -perl-Unicode-Normalize: -Latest upstream is 1.26 -Current version is 1.26 -perl-Text-Glob: -Latest upstream is 0.11 -Current version is 0.11 -perl-Data-Dump: -Latest upstream is 1.23 -Current version is 1.23 -perl-Compress-Raw-Zlib: -Latest upstream is 2.093 -Current version is 2.081 -perl-Carp: -Latest upstream is 1.50 -Current version is 1.50 -perl-Mozilla-CA: -Latest upstream is 20180117 -Current version is 20180117 -perl-IO-All: -Latest upstream is 0.87 -Current version is 0.87 -perl-common-sense: -Latest upstream is 3.75 -Current version is 3.7.4 -perl-MIME-Base64: -Latest upstream is 3.15 -Current version is 3.15 -perl-Pod-Escapes: -Latest upstream is 1.07 -Current version is 1.07 -perl-Pod-Markdown: -Latest upstream is 3.200 -Current version is 3.101 -perl-libwww-perl: -Latest upstream is 6.44 -Current version is 6.35 -perl-perlfaq: -Latest upstream is 5.20200125 -Current version is 5.20180915 -perl-CPAN-Meta-Requirements: -Latest upstream is 2.140 -Current version is 2.140 -perl-XML-TokeParser: -Latest upstream is 0.05 -Current version is 0.05 -perl-Test-Regexp: -Latest upstream is 2017040101 -Current version is 2017040101 -perl-threads-shared: -Latest upstream is 1.59 -Current version is 1.59 -perl-ExtUtils-Install: -Latest upstream is 2.14 -Current version is 2.14 -perl-File-DesktopEntry: -Latest upstream is 0.22 -Current version is 0.22 -perl-Encode-Locale: -Latest upstream is 1.05 -Current version is 1.05 -perl-Sub-Name: -Latest upstream is 0.26 -Current version is 0.21 -perl-Net-DNS: -Latest upstream is 1.23 -Current version is 1.17 -perl-IO-Socket-IP: -Latest upstream is 0.39 -Current version is 0.39 -perl-Date-Calc: -Latest upstream is 6.4 -Current version is 6.4 -perl-Pod-Usage: -Latest upstream is 1.70 -Current version is 1.69 -perl-URI: -Latest upstream is 1.76 -Current version is 1.76 -perl-Module-Install-ReadmeFromPod: -Latest upstream is 0.30 -Current version is 0.30 -perl-IO-HTML: -Latest upstream is 1.001 -Current version is 1.001 -perl-version: -Latest upstream is 0.9924 -Current version is 0.99.24 -perl-Text-Diff: -Latest upstream is 1.45 -Current version is 1.45 -perl-Module-Install-AutoLicense: -Latest upstream is 0.10 -Current version is 0.10 -perl-HTTP-Negotiate: -Latest upstream is 6.01 -Current version is 6.01 -perl-Moo: -Latest upstream is 2.004000 -Current version is 2.003004 -perl-parent: -Latest upstream is 0.238 -Current version is 0.237 -perl-Net-LibIDN: -Latest upstream is 0.12 -Current version is 0.12 -perl-Module-Install: -Latest upstream is 1.19 -Current version is 1.19 -perl-PathTools: -Latest upstream is 3.75 -Current version is 3.75 -perl-TermReadKey: -Latest upstream is 2.38 -Current version is 2.38 -perl-Pod-Perldoc: -Latest upstream is 3.28 -Current version is 3.28 -perl-ExtUtils-Config: -Latest upstream is 0.008 -Current version is 0.008 -perl-Devel-PPPort: -Latest upstream is 3.58 -Current version is 3.42 -perl-Sys-Virt: -Latest upstream is 6.1.0 -Current version is 4.7.0 -perl-File-ReadBackwards: -Latest upstream is 1.05 -Current version is 1.05 -perl-JSON-PP: -Latest upstream is 4.04 -Current version is 4.04 -perl-Module-Package-Au: -Latest upstream is 2 -Current version is 2 -perl-GD-Barcode: -Latest upstream is 1.15 -Current version is 1.15 -perl-ExtUtils-Helpers: -Latest upstream is 0.026 -Current version is 0.026 -perl-File-ShareDir-Install: -Latest upstream is 0.13 -Current version is 0.13 -perl-Params-Check: -Latest upstream is 0.38 -Current version is 0.38 -perl-ExtUtils-MakeMaker: -Latest upstream is 7.44 -Current version is 7.42 -perl-Data-OptList: -Latest upstream is 0.110 -Current version is 0.110 -perl-Archive-Tar: -Latest upstream is 2.36 -Current version is 2.30 -perl-Algorithm-Diff: -Latest upstream is 1.1903 -Current version is 1.1903 -perl-Capture-Tiny: -Latest upstream is 0.48 -Current version is 0.48 -perl-Pod-Simple: -Latest upstream is 3.40 -Current version is 3.35 -perl-Socket6: -Latest upstream is 0.29 -Current version is 0.28 -perl-Scalar-List-Utils: -Latest upstream is 1.55 -Current version is 1.52 -perl-LWP-MediaTypes: -Latest upstream is 6.04 -Current version is 6.02 -perl-BSD-Resource: -Latest upstream is 1.2911 -Current version is 1.291.100 -perl-NetAddr-IP: -Latest upstream is 4.079 -Current version is 4.079 -perl-XML-Catalog: -Latest upstream is 1.03 -Current version is 1.03 -perl-Storable: -Latest upstream is 3.15 -Current version is 3.15 -perl-Test-Harness: -Latest upstream is 3.42 -Current version is 3.43_01 -perl-libnet: -Latest upstream is 3.11 -Current version is 3.11 -perl-Text-ParseWords: -Latest upstream is 3.30 -Current version is 3.30 -perl-Test-Simple: -Latest upstream is 1.302175 -Current version is 1.302140 -perl-Canary-Stability: -Latest upstream is 2013 -Current version is 2013 -perl-Crypt-OpenSSL-Bignum: -Latest upstream is 0.09 -Current version is 0.09 -perl-Digest-SHA: -Latest upstream is 6.02 -Current version is 6.02 -perl-Parse-Yapp: -Latest upstream is 1.21 -Current version is 1.21 -perl-Class-XSAccessor: -Latest upstream is 1.19 -Current version is 1.19 -perl-Config-General: -Latest upstream is 2.63 -Current version is 2.63 -perl-File-ShareDir: -Latest upstream is 1.116 -Current version is 1.116 -perl-GD: -Latest upstream is 2.71 -Current version is 2.71 -perl-ExtUtils-CBuilder: -Latest upstream is 0.280234 -Current version is 0.280230 -perl-Test-Warnings: -Latest upstream is 0.030 -Current version is 0.026 -perl-XML-SAX-Base: -Latest upstream is 1.09 -Current version is 1.09 -perl-HTTP-Message: -Latest upstream is 6.22 -Current version is 6.18 -perl-Crypt-PasswdMD5: -Latest upstream is 1.40 -Current version is 1.4.0 -perl-Exporter-Tiny: -Latest upstream is 1.002001 -Current version is 1.002001 -perl-Module-CoreList: -Latest upstream is 5.20200320 -Current version is 5.20180920 -perl-Net-CIDR-Lite: -Latest upstream is 0.21 -Current version is 0.21 -perl-constant: -Latest upstream is 1.33 -Current version is 1.33 -perl-Filter: -Latest upstream is 1.59 -Current version is 1.59 -perl-IO-Socket-SSL: -Latest upstream is 2.068 -Current version is 2.066 -perl-Time-HiRes: -Latest upstream is 1.9760 -Current version is 1.9760 -perl-File-HomeDir: -Latest upstream is 1.004 -Current version is 1.004 -perl-Error: -Latest upstream is 0.17029 -Current version is 0.17026 -perl-Net-SMTP-SSL: -Latest upstream is 1.04 -Current version is 1.04 -perl-Params-Util: -Latest upstream is 1.07 -Current version is 1.07 -perl-Config-Perl-V: -Latest upstream is 0.31 -Current version is 0.30 -perl-Data-Section: -Latest upstream is 0.200007 -Current version is 0.200007 -perl-Test-File: -Latest upstream is 1.443 -Current version is 1.44.3 -perl-IO-stringy: -Latest upstream is 2.111 -Current version is 2.111 -perl-Test-Pod-Coverage: -Latest upstream is 1.10 -Current version is 1.10 -perl-Module-Install-Repository: -Latest upstream is 0.06 -Current version is 0.06 -perl-Module-Load: -Latest upstream is 0.34 -Current version is 0.32 -perl-Test-Pod: -Latest upstream is 1.52 -Current version is 1.52 -perl-Business-ISBN: -Latest upstream is 3.005 -Current version is 3.005 -perl-Text-Balanced: -Latest upstream is 2.03 -Current version is 2.03 -perl-YAML-Tiny: -Latest upstream is 1.73 -Current version is 1.73 -perl-HTML-Tagset: -Latest upstream is 3.20 -Current version is 3.20 -perl-Unicode-EastAsianWidth: -Latest upstream is 12.0 -Current version is 1.33 -perl-HTTP-Tiny: -Latest upstream is 0.076 -Current version is 0.076 -perl-Filter-Simple: -Latest upstream is 0.94 -Current version is 0.94 -perl-IPC-Cmd: -Latest upstream is 1.04 -Current version is 1.04 -perl-LWP-Protocol-https: -Latest upstream is 6.07 -Current version is 6.07 -perl-Math-BigInt-FastCalc: -Latest upstream is 0.5009 -Current version is 0.500.700 -perl-TimeDate: -Latest upstream is 2.32 -Current version is 2.30 -perl-Module-ScanDeps: -Latest upstream is 1.27 -Current version is 1.27 -perl-Net-SNMP: -Latest upstream is 6.0.1 -Current version is 6.0.1 -perl-IO-Socket-INET6: -Latest upstream is 2.72 -Current version is 2.72 -perl-DBD-SQLite: -Latest upstream is 1.64 -Current version is 1.58 -perl-Thread-Queue: -Latest upstream is 3.13 -Current version is 3.13 -perl-Email-Date-Format: -Latest upstream is 1.005 -Current version is 1.005 diff --git a/results/python.result b/results/python.result deleted file mode 100644 index 152fd687..00000000 --- a/results/python.result +++ /dev/null @@ -1,608 +0,0 @@ -python-docker-pycreds: -Latest upstream is 0.4.0 -Recommended is 0.4.0 -Current version is 0.4.0 -python-jinja2: -Latest upstream is 2.11.2 -Recommended is 2.11.2 -Current version is 2.10 -python3-mallard-ducktype: -Latest upstream is 1.0.2 -Recommended is 1.0.2 -Current version is 0.3 -python-aniso8601: -Latest upstream is 8.0.0 -Recommended is 7.0.0 -Current version is 7.0.0 -python-singledispatch: -Latest upstream is 3.4.0.3 -Recommended is 3.4.0.3 -Current version is 3.4.0.3 -python-urwid: -Latest upstream is 2.1.0 -Recommended is 2.0.1 -Current version is 2.0.1 -docker-compose: -Latest upstream is 1.25.5 -Recommended is 1.25.5 -Current version is 1.22.0 -python-docker: -Latest upstream is 4.2.0 -Recommended is 4.0.2 -Current version is 4.0.2 -python-threadpoolctl: -Latest upstream is 2.0.0 -Recommended is 1.1.0 -Current version is 1.1.0 -python-ethtool: -Latest upstream is 0.14 -Recommended is 0.14 -Current version is 0.14 -python-click: -Latest upstream is 7.1.1 -Recommended is 7.1.1 -Current version is 7.0 -python-sphinx: -Latest upstream is 3.0.2 -Recommended is 3.0.2 -Current version is 1.7.6 -python-apipkg: -Latest upstream is 1.5 -Recommended is 1.5 -Current version is 1.5 -python-setuptools_git: -Latest upstream is 1.2 -Recommended is 1.1 -Current version is 1.1 -kiwi: -Latest upstream is 9.20.9 -Recommended is 9.20.9 -Current version is 9.19.15 -python-IPy: -Latest upstream is 1.00 -Recommended is 0.81 -Current version is 0.81 -python-mimeparse: -Latest upstream is 0.1.4 -Recommended is 1.6.0 -Current version is 1.6.0 -pyflakes: -Latest upstream is 2.2.0 -Recommended is 2.0.0 -Current version is 2.0.0 -python-six: -Latest upstream is 1.14.0 -Recommended is 1.12.0 -Current version is 1.12.0 -python-pygments: -Latest upstream is 2.6.1 -Recommended is 2.6.1 -Current version is 2.2.0 -python-configparser: -Latest upstream is 5.0.0 -Recommended is 3.5.0b2 -Current version is 3.5.0b2 -python-hyperlink: -Latest upstream is 19.0.0 -Recommended is 18.0.0 -Current version is 18.0.0 -python-asn1crypto: -Latest upstream is 1.3.0 -Recommended is 1.3.0 -Current version is 0.24.0 -python-polib: -Latest upstream is 1.1.0 -Recommended is 1.1.0 -Current version is 1.1.0 -python-markdown: -Latest upstream is 3.2.1 -Recommended is 3.2.1 -Current version is 2.4.1 -python-parse: -Latest upstream is 1.15.0 -Recommended is 1.8.4 -Current version is 1.8.4 -python-tempita: -Latest upstream is 0.5.2 -Recommended is 0.5.1 -Current version is 0.5.1 -python-cryptography: -Latest upstream is 2.9.2 -Recommended is 2.9.2 -Current version is 2.6.1 -python-pluggy: -Latest upstream is 0.13.1 -Recommended is 0.6.0 -Current version is 0.6.0 -python-traceback2: -Latest upstream is 1.4.0 -Recommended is 1.4.0 -Current version is 1.4.0 -python-sphinxcontrib-spelling: -Latest upstream is 5.0.0 -Recommended is 4.2.0 -Current version is 4.2.0 -python-pyudev: -Latest upstream is 0.22.0 -Recommended is 0.21.0 -Current version is 0.21.0 -python-pytest-shutil: -Latest upstream is 1.7.0 -Recommended is 1.2.6 -Current version is 1.2.6 -python-blinker: -Latest upstream is 1.4 -Recommended is 1.4 -Current version is 1.4 -python-distro: -Latest upstream is 1.5.0 -Recommended is 1.3.0 -Current version is 1.3.0 -pytest: -Latest upstream is 5.4.1 -Recommended is 5.4.1 -Current version is 3.6.4 -python-unittest2: -Latest upstream is 1.1.0 -Recommended is 1.1.0 -Current version is 1.1.0 -python-funcsigs: -Latest upstream is 1.0.2 -Recommended is 1.0.2 -Current version is 1.0.2 -python-ruamel-yaml-clib: -Latest upstream is 0.2.0 -Recommended is 0.1.2 -Current version is 0.1.2 -python-markupsafe: -Latest upstream is 1.1.1 -Recommended is 1.1.1 -Current version is 1.0 -python-cheetah: -Latest upstream is 2.4.4 -Recommended is 2.4.4 -Current version is 3.1.0 -python-itsdangerous: -Latest upstream is 1.1.0 -Recommended is 1.1.0 -Current version is 1.1.0 -python-ntplib: -Latest upstream is 0.3.3 -Recommended is 0.3.3 -Current version is 0.3.3 -python-pytest-fixture-config: -Latest upstream is 1.7.0 -Recommended is 1.2.11 -Current version is 1.2.11 -python-ordered-set: -Latest upstream is 3.1.1 -Recommended is 3.1.1 -Current version is 2.0.2 -python-repoze-lru: -Latest upstream is 0.7 -Recommended is 0.7 -Current version is 0.7 -python-enum34: -Latest upstream is 1.1.10 -Recommended is 1.1.10 -Current version is 1.1.6 -python-futures: -Latest upstream is 3.3.0 -Recommended is 3.1.1 -Current version is 3.1.1 -python-constantly: -Latest upstream is 15.1.0 -Recommended is 15.1.0 -Current version is 15.1.0 -python-lit: -Latest upstream is 0.10.0 -Recommended is 0.7.0 -Current version is 0.7.0 -python-iso8601: -Latest upstream is 0.1.12 -Recommended is 0.1.11 -Current version is 0.1.11 -python-pytest-mock: -Latest upstream is 3.1.0 -Recommended is 3.1.0 -Current version is 1.10.0 -python-pytest-expect: -Latest upstream is 1.1.0 -Recommended is 1.1.0 -Current version is 1.1.0 -python-dateutil: -Latest upstream is 2.8.1 -Recommended is 2.8.1 -Current version is 2.7.0 -python-sphinx-theme-alabaster: -Latest upstream is -Recommended is 0.7.11 -Current version is 0.7.11 -python-jsonpatch: -Latest upstream is 1.25 -Recommended is 1.21 -Current version is 1.21 -python-ipaddress: -Latest upstream is 1.0.23 -Recommended is 1.0.18 -Current version is 1.0.18 -python-backports_abc: -Latest upstream is 0.5 -Recommended is 0.5 -Current version is 0.5 -python-virtualenv: -Latest upstream is 20.0.18 -Recommended is 20.0.18 -Current version is 16.0.0 -python-pretend: -Latest upstream is 1.0.9 -Recommended is 1.0.8 -Current version is 1.0.8 -python-xgboost: -Latest upstream is 1.0.2 -Recommended is 1.0.2 -Current version is 0.90 -python-prettytable: -Latest upstream is 0.7.2 -Recommended is 0.7.2 -Current version is 0.7.2 -python-bcrypt: -Latest upstream is 3.1.7 -Recommended is 3.1.7 -Current version is 3.1.4 -python-tornado: -Latest upstream is 6.0.4 -Recommended is 6.0.4 -Current version is 5.0.2 -python-linecache2: -Latest upstream is 1.0.0 -Recommended is 1.0.0 -Current version is 1.0.0 -python-beautifulsoup4: -Latest upstream is 4.9.0 -Recommended is 4.6.3 -Current version is 4.6.3 -python-pytest-virtualenv: -Latest upstream is 1.7.0 -Recommended is 1.2.11 -Current version is 1.2.11 -python-flask: -Latest upstream is 1.1.2 -Recommended is 1.1.2 -Current version is 1.0.4 -python-SecretStorage: -Latest upstream is 3.1.2 -Recommended is 3.1.2 -Current version is 2.3.1 -python-google-apputils: -Latest upstream is 0.4.2 -Recommended is 0.4.2 -Current version is 0.4.2 -python-kitchen: -Latest upstream is 1.2.6 -Recommended is 1.2.6 -Current version is 1.2.6 -python-cryptography-vectors: -Latest upstream is 2.9.2 -Recommended is 2.9.2 -Current version is 2.6.1 -m2crypto: -Latest upstream is 0.35.2 -Recommended is 0.30.1 -Current version is 0.30.1 -python-setuptools: -Latest upstream is 46.1.3 -Recommended is 46.1.3 -Current version is 40.4.3 -python-keyring: -Latest upstream is 21.2.0 -Recommended is 21.2.0 -Current version is 13.2.1 -python-construct: -Latest upstream is 2.10.56 -Recommended is 2.10.56 -Current version is 2.5.1 -python-backports-ssl_match_hostname: -Latest upstream is 3.7.0.1 -Recommended is 3.7.0.1 -Current version is 3.7.0.1 -python-execnet: -Latest upstream is 1.7.1 -Recommended is 1.7.1 -Current version is 1.5.0 -python-webob: -Latest upstream is 1.8.6 -Recommended is 1.8.6 -Current version is 1.8.2 -python-productmd: -Latest upstream is 1.26 -Recommended is 1.22 -Current version is 1.22 -python-ecdsa: -Latest upstream is 0.15 -Recommended is 0.14.1 -Current version is 0.14.1 -python-fixtures: -Latest upstream is 3.0.0 -Recommended is 3.0.0 -Current version is 3.0.0 -python-incremental: -Latest upstream is 17.5.0 -Recommended is 17.5.0 -Current version is 17.5.0 -python-werkzeug: -Latest upstream is 1.0.1 -Recommended is 1.0.1 -Current version is 0.14.1 -python-setuptools_scm: -Latest upstream is 3.5.0 -Recommended is 3.1.0 -Current version is 3.1.0 -python-mox: -Latest upstream is 0.5.3 -Recommended is 0.5.3 -Current version is 0.5.3 -python-pbr: -Latest upstream is 5.4.5 -Recommended is 5.4.5 -Current version is 4.1.1 -python-reportlab: -Latest upstream is 3.5.42 -Recommended is 3.5.42 -Current version is 3.4.0 -pyelftools: -Latest upstream is 0.26 -Recommended is 0.25 -Current version is 0.25 -python-imagesize: -Latest upstream is 1.2.0 -Recommended is 1.0.0 -Current version is 1.0.0 -python-extras: -Latest upstream is 1.0.0 -Recommended is 1.0.0 -Current version is 1.0.0 -python-contextlib2: -Latest upstream is 0.6.0.post1 -Recommended is 0.5.5 -Current version is 0.5.5 -python-sure: -Latest upstream is 1.4.11 -Recommended is 1.4.11 -Current version is 1.4.11 -python-scikit-optimize: -Latest upstream is 0.7.4 -Recommended is 0.5.2 -Current version is 0.5.2 -python-paste: -Latest upstream is 3.4.0 -Recommended is 3.4.0 -Current version is 2.0.3 -python-pandas: -Latest upstream is 1.0.3 -Recommended is 1.0.3 -Current version is 0.25.3 -python-jsonschema: -Latest upstream is 3.2.0 -Recommended is 3.2.0 -Current version is 2.6.0 -python-jsonpointer: -Latest upstream is 2.0 -Recommended is 1.10 -Current version is 1.10 -python-py: -Latest upstream is 1.8.1 -Recommended is 1.8.1 -Current version is 1.5.4 -python-packaging: -Latest upstream is 20.3 -Recommended is 20.3 -Current version is 17.1 -python-freezegun: -Latest upstream is 0.3.15 -Recommended is 0.3.8 -Current version is 0.3.8 -python-zope-event: -Latest upstream is 4.4 -Recommended is 4.2.0 -Current version is 4.2.0 -python-whoosh: -Latest upstream is 2.7.4 -Recommended is 2.7.4 -Current version is 2.7.4 -python-augeas: -Latest upstream is 1.1.0 -Recommended is 1.1.0 -Current version is 0.5.0 -python-pid: -Latest upstream is 3.0.3 -Recommended is 3.0.3 -Current version is 2.1.1 -python-cherrypy: -Latest upstream is 18.6.0 -Recommended is 3.5.0 -Current version is 3.5.0 -python-backports-unittest_mock: -Latest upstream is 1.5 -Recommended is 1.2.1 -Current version is 1.2.1 -python-pytest-cov: -Latest upstream is 2.8.1 -Recommended is 2.8.1 -Current version is 2.5.1 -python-pip: -Latest upstream is 20.0.2 -Recommended is 20.0.2 -Current version is 18.0 -python-toml: -Latest upstream is 0.10.0 -Recommended is 0.10.0 -Current version is 0.10.0 -pyxdg: -Latest upstream is 0.26 -Recommended is 0.26 -Current version is 0.26 -python-PyMySQL: -Latest upstream is 0.9.3 -Recommended is 0.9.2 -Current version is 0.9.2 -python-snowballstemmer: -Latest upstream is 2.0.0 -Recommended is 1.2.1 -Current version is 1.2.1 -python-sqlalchemy: -Latest upstream is 1.3.16 -Recommended is 1.3.16 -Current version is 1.2.11 -python2-typing: -Latest upstream is -Recommended is 3.6.2 -Current version is 3.6.2 -python-olefile: -Latest upstream is 0.46 -Recommended is 0.46 -Current version is 0.46 -python-cffi: -Latest upstream is 1.14.0 -Recommended is 1.11.5 -Current version is 1.11.5 -python-more-itertools: -Latest upstream is 8.2.0 -Recommended is 8.2.0 -Current version is 4.1.0 -python-humanize: -Latest upstream is 2.4.0 -Recommended is 2.4.0 -Current version is 0.5.1 -python-pysocks: -Latest upstream is 1.7.1 -Recommended is 1.7.1 -Current version is 1.7.0 -python-WSGIProxy2: -Latest upstream is 0.4.6 -Recommended is 0.4.1 -Current version is 0.4.1 -python-testscenarios: -Latest upstream is 0.5.0 -Recommended is 0.5.0 -Current version is 0.5.0 -babel: -Latest upstream is 2.8.0 -Recommended is 2.7.0 -Current version is 2.7.0 -python-pyquery: -Latest upstream is 1.4.1 -Recommended is 1.4.1 -Current version is 1.4.0 -python-idna: -Latest upstream is 2.9 -Recommended is 2.8 -Current version is 2.8 -python-importlib-metadata: -Latest upstream is 1.6.0 -Recommended is 1.6.0 -Current version is 0.23 -python-dict2xml: -Latest upstream is 1.7.0 -Recommended is 1.6.1 -Current version is 1.6.1 -python-simplegeneric: -Latest upstream is 0.8.1 -Recommended is 0.8.1 -Current version is 0.8.1 -python-nose: -Latest upstream is 1.3.7 -Recommended is 1.3.7 -Current version is 1.3.7 -python-enchant: -Latest upstream is 3.0.1 -Recommended is 3.0.1 -Current version is 2.0.0 -python-mock: -Latest upstream is 4.0.2 -Recommended is 4.0.2 -Current version is 2.0.0 -python-testtools: -Latest upstream is 2.4.0 -Recommended is 2.3.0 -Current version is 2.3.0 -python-gevent: -Latest upstream is 20.4.0 -Recommended is 20.4.0 -Current version is 1.3.6 -python-netaddr: -Latest upstream is 0.7.19 -Recommended is 0.7.19 -Current version is 0.7.19 -python-junitxml: -Latest upstream is 0.7 -Recommended is 0.7 -Current version is 0.7 -python-httplib2: -Latest upstream is 0.17.3 -Recommended is 0.13.1 -Current version is 0.13.1 -python-websocket-client: -Latest upstream is 0.57.0 -Recommended is 0.47.0 -Current version is 0.47.0 -python-memcached: -Latest upstream is 1.59 -Recommended is 1.58 -Current version is 1.58 -python-mysqlclient: -Latest upstream is 1.4.6 -Recommended is 1.4.6 -Current version is 1.3.12 -python-path: -Latest upstream is 13.2.0 -Recommended is 5.2 -Current version is 5.2 -python-rsa: -Latest upstream is 4.0 -Recommended is 3.4.2 -Current version is 3.4.2 -python-ldap: -Latest upstream is 3.2.0 -Recommended is 3.1.0 -Current version is 3.1.0 -pyliblzma: -Latest upstream is 0.5.3 -Recommended is 0.5.3 -Current version is 0.5.3 -python-sphinx_rtd_theme: -Latest upstream is 0.4.3 -Recommended is 0.4.1 -Current version is 0.4.1 -python-jwt: -Latest upstream is 1.0.0 -Recommended is 1.7.1 -Current version is 1.7.1 -python-logutils: -Latest upstream is 0.3.5 -Recommended is 0.3.5 -Current version is 0.3.5 -python-zope-interface: -Latest upstream is 5.1.0 -Recommended is 5.1.0 -Current version is 4.5.0 -python-httpretty: -Latest upstream is 1.0.2 -Recommended is 1.0.2 -Current version is 0.9.5 -python-u-msgpack-python: -Latest upstream is 2.6.0 -Recommended is 2.5.0 -Current version is 2.5.0 -python-cheetah: -Latest upstream is 3.2.4 -Recommended is 3.2.4 -Current version is 3.1.0 -python-mimeparse: -Latest upstream is 1.6.0 -Recommended is 1.6.0 -Current version is 1.6.0 -python-jwt: -Latest upstream is 1.7.1 -Recommended is 1.7.1 -Current version is 1.7.1 diff --git a/temp/check b/temp/check deleted file mode 100755 index c41fc661..00000000 --- a/temp/check +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -specfile=`find ~/openEuler/src-openeuler -name $1.spec` -if [ $specfile != "" ]; then - cur_ver=`grep Version $specfile | awk -F: '{print $2}' | sed -e "s/[ \t]*//g"` - #deal with the special Version defination, like "Version: %{xxx}" - if [[ "$cur_ver" == %{* ]]; then - new_ver=`echo $cur_ver | sed 's/.*{\(.*\)}.*/\1/g'` - new_lable='%global '$new_ver' ' - cur_ver=`grep "${new_lable}" $specfile | awk -F "${new_lable}" '{print $2}'` - fi - ./check_upstream.rb $1 $cur_ver -else - echo $1, "is not found in src-openeuler\n" -fi diff --git a/temp/checkout-git.sh b/temp/checkout-git.sh deleted file mode 100755 index bd57296d..00000000 --- a/temp/checkout-git.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -name=$1 -repo=$2 - -mkdir -p temp -cd temp -git clone $2 diff --git a/temp/cleanup-git.sh b/temp/cleanup-git.sh deleted file mode 100755 index 6385f0c2..00000000 --- a/temp/cleanup-git.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -name=$1 -repo=$2 - -rm -rf temp/$1 diff --git a/temp/ls-tag-git.sh b/temp/ls-tag-git.sh deleted file mode 100755 index 941ef7f2..00000000 --- a/temp/ls-tag-git.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -name=$1 -repo=$2 -prefix=$3 - -cd temp/$1 -git tag -l --sort -version:refname "$3*" - diff --git a/temp/test_run.sh b/temp/test_run.sh deleted file mode 100755 index aafab151..00000000 --- a/temp/test_run.sh +++ /dev/null @@ -1,8 +0,0 @@ -for file in `find upstream-info -name "*.yaml"`; do - grep version_control $file | egrep -q $1"[ \t]*$" - if [ $? -eq 0 ]; then # found this - name=`echo $file | awk -F/ '{print substr($0, index($0, $2))}' | sed -e "s/\.yaml//g"` - echo $name - #./check $name - fi -done -- Gitee From 00dff354e8b3ec204a324fcff63e960021b6ff3c Mon Sep 17 00:00:00 2001 From: Shinwell Hu Date: Mon, 15 Jun 2020 03:03:07 +0000 Subject: [PATCH 4/9] remove redundent files --- check_inactive_repo.rb | 54 ---- check_missing_specs.rb | 48 ---- check_upgradable.rb | 178 ------------- check_upstream/common.rb | 121 --------- check_upstream/git.rb | 20 -- check_upstream/github.rb | 100 -------- check_upstream/gnome.rb | 21 -- check_upstream/hg.rb | 39 --- check_upstream/metacpan.rb | 43 ---- check_upstream/pypi.rb | 37 --- check_upstream/svn.rb | 39 --- create_repo.py | 73 ------ create_repo_with_srpm | 110 -------- gitee.py | 146 ----------- gitee/advisor.rb | 26 -- gitee/prepare_token.sh | 7 - helper/download_spec.rb | 25 -- helper/rpmparser.rb | 175 ------------- helper/specfile_exceptions.yaml | 55 ---- packager/python-packager.py | 441 -------------------------------- simple-update-robot.py | 136 ---------- tc_reminder.py | 130 ---------- who_maintain.py | 103 -------- 23 files changed, 2127 deletions(-) delete mode 100755 check_inactive_repo.rb delete mode 100755 check_missing_specs.rb delete mode 100755 check_upgradable.rb delete mode 100755 check_upstream/common.rb delete mode 100755 check_upstream/git.rb delete mode 100755 check_upstream/github.rb delete mode 100755 check_upstream/gnome.rb delete mode 100755 check_upstream/hg.rb delete mode 100755 check_upstream/metacpan.rb delete mode 100755 check_upstream/pypi.rb delete mode 100755 check_upstream/svn.rb delete mode 100755 create_repo.py delete mode 100755 create_repo_with_srpm delete mode 100755 gitee.py delete mode 100755 gitee/advisor.rb delete mode 100755 gitee/prepare_token.sh delete mode 100755 helper/download_spec.rb delete mode 100755 helper/rpmparser.rb delete mode 100755 helper/specfile_exceptions.yaml delete mode 100755 packager/python-packager.py delete mode 100755 simple-update-robot.py delete mode 100755 tc_reminder.py delete mode 100755 who_maintain.py diff --git a/check_inactive_repo.rb b/check_inactive_repo.rb deleted file mode 100755 index 6a6792d5..00000000 --- a/check_inactive_repo.rb +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'set' -require 'optparse' - -require './helper/download_spec' -require './gitee/advisor' - -INACTIVE_THRESHOLD = 3 - -options = {} -OptionParser.new do |opts| - opts.banner = "Usage: check_inactive_repo.rb [options]" - opts.on("-p", "--push", "Push the advise to gitee.com/openeuler") do |v| - options[:push] = v - end - opts.on("-r", "--repo REPO_NAME", "Repo to check upstream info") do |n| - puts "Checking #{n}" - options[:repo] = n - end - opts.on("-h", "--help", "Prints this help") do - puts opts - exit - end -end.parse! - -if not options[:repo] then - puts "Missing repo name\n" - exit 1 -end - -cmd = "git ls-remote https://gitee.com/openeuler/#{options[:repo]}/" -refs = %x[#{cmd}] -merge_count = 0 -refs.each_line { |line| - if line.match(/\/pull\/(\d*)\/MERGE/) then - merge_count = merge_count + 1 - end - puts line -} -if merge_count < INACTIVE_THRESHOLD then - if options[:push] then - ad = Advisor.new - ad.new_issue("openeuler", options[:repo], - "Inactive repository", - "Dear #{options[:repo]} developer:\n亲爱的 #{options[:repo]} 开发者:\n\n We found this repository has not fulfill what it prupose to be.\n我们发现这个代码仓并没有承载它被期望的功能。\n\n Long time no progress will discourge other developers to follow and participant this initiative.\n长期没有代码会使得关注这个项目的开发者失望。\n\n Please start submit something as soon as possible.\n建议您尽快向代码仓提交进展。\n\n This is a automatic advise from openEuler-Advisor. If you think the advise is not correct, please fill an issue at https\:\/\/gitee.com\/openeuler\/openEuler-Advisor to help us improve.\n这是一条由 openEuler-Advisor 自动生成的建议。如果您认为这个建议不对,请访问 https\:\/\/gitee.com\/openeuler\/openEuler-Advisor 来帮助我们改进。\n\n Yours openEuler Advisor.") - else - puts "#{options[:repo]} is not active. But we keep it between us" - end -else - puts "#{options[:repo]} is active and good." -end - diff --git a/check_missing_specs.rb b/check_missing_specs.rb deleted file mode 100755 index d8ca43d8..00000000 --- a/check_missing_specs.rb +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'set' -require 'optparse' - -require './helper/download_spec' -require './gitee/advisor' - -options = {} -OptionParser.new do |opts| - opts.banner = "Usage: check_missing_spec.rb [options]" - opts.on("-p", "--push", "Push the advise to gitee.com/src-openeuler") do |v| - options[:push] = v - end - opts.on("-r", "--repo REPO_NAME", "Repo to check upstream info") do |n| - puts "Checking #{n}" - options[:repo] = n - end - opts.on("-h", "--help", "Prints this help") do - puts opts - exit - end -end.parse! - -if not options[:repo] then - puts "Missing repo name\n" - exit 1 -end - -specfile = download_spec(options[:repo]) - -if specfile == "" then - puts "no spec file found for #{options[:repo]} project\n" - if options[:push] then - puts "Push this advise to gitee\n" - ad = Advisor.new - ad.new_issue("src-openeuler", options[:repo], - "Submit spec file into this repository", - "Dear #{options[:repo]} maintainer:\n亲爱的 #{options[:repo]} 维护者:\n\n We found there is no spec file in this repository yet.\n我们发现这个代码仓中没有 spec 文件。\n\n Missing spec file implies that this components will not be integtaed into openEuler release, and your hardworking cannot help others.\n缺少 spec 文件意味着这个项目还不能被集成到 openEuler 项目中,而您的贡献还不能帮助到社区中的其他人。\n\n We courage you submit your spec file into this repository as soon as possible.\n我们鼓励您尽快提交 spec 文件到这个代码仓中\n\n This is a automatic advise from openEuler-Advisor. If you think the advise is not correct, please fill an issue at https\:\/\/gitee.com\/openeuler\/openEuler-Advisor to help us improve.\n这是一条由 openEuler-Advisor 自动生成的建议。如果您认为这个建议不对,请访问 https\:\/\/gitee.com\/openeuler\/openEuler-Advisor 来帮助我们改进。\n\n Yours openEuler Advisor.") - else - puts "Keep it between us\n" - end -else - puts "Everything's fine\n" -end - -File.delete(specfile) if specfile != "" diff --git a/check_upgradable.rb b/check_upgradable.rb deleted file mode 100755 index 05392b24..00000000 --- a/check_upgradable.rb +++ /dev/null @@ -1,178 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'json' -require 'date' -require 'optparse' - -require './check_upstream/github' -require './check_upstream/git' -require './check_upstream/hg' -require './check_upstream/svn' -require './check_upstream/metacpan' -require './check_upstream/gnome' -require './check_upstream/pypi' -require './helper/download_spec' -require './helper/rpmparser' -require './gitee/advisor' - -options = {} - -OptionParser.new do |opts| - opts.banner = "Usage: check_upgradable.rb [options]" - opts.on("-p", "--push", "Push the advise to gitee.com/src-openeuler") do |v| - options[:push] = v - end - opts.on("-r", "--repo REPO_NAME", "Repo to check upstream info") do |n| - puts "Checking #{n}" - options[:repo] = n - end - opts.on("-h", "--help", "Prints this help") do - puts opts - exit - end -end.parse! - -if not options[:repo] then - puts "Missing repo name\n" - exit 1 -end - -Prj_name = options[:repo] -specfile=download_spec(Prj_name) -if specfile == "" then - puts "no specfile found for project\n" - exit 1 -end -spec_struct = Specfile.new(specfile) -Cur_ver = spec_struct.get_version - -Prj_info = YAML.load(File.read "upstream-info/"+Prj_name+".yaml") - -def compare_tags (a, b) - arr_a = a.split(".") - arr_b = b.split(".") - len = [arr_a.length, arr_b.length].min - idx = 0 - while idx < len do - res1 = arr_a[idx].to_i <=> arr_b[idx].to_i - return res1 if res1 != 0 - res2 = arr_a[idx].length <=> arr_b[idx].length - return -res2 if res2 != 0 - res3 = arr_a[idx][-1].to_i <=> arr_b[idx][-1].to_i - return res3 if res3 != 0 - idx = idx + 1 - end - return arr_a.length <=> arr_b.length -end - -def sort_tags (tags) - tags.sort! { |a, b| - compare_tags(a,b) - } - return tags -end - -def clean_tags(tags) - new_tags = [] - tags.each{|line| - new_tags = new_tags.append clean_tag(line, Prj_info) - } - return new_tags -end - -def upgrade_recommend(tags_param, cur_tag, policy) - tags = tags_param.reverse - tag1 = cur_tag - tag2 = cur_tag - if policy == "latest" then - return tags[0] - elsif policy == "latest-stable" then - tags.each { |tag| - if tag.split(".").count {|f| f.to_i != 0 } >= 3 then - tag1 = tag - break - end - } - tags.each { |tag| - if tag.split(".").count {|f| f.to_i != 0} >= 2 then - tag2 = tag - break - end - } - if tag2[0].to_i > tag1[0].to_i then - return tag2 - else - return tag1 - end - elsif policy == "perfer-stable" then - tags.each { |tag| - if tag.start_with?(cur_tag) then - return tag - end - } - if cur_tag.split(".").length >= 3 then - search_tag = cur_tag.split(".")[0..1].join(".") - tags.each { |tag| - if tag.start_with?(search_tag) then - return tag - end - } - end - return cur_tag - else - return cur_tag - end - -end - -print Prj_name, ":\n" - -if Prj_info["version_control"] == "svn" then - tags = check_upstream_svn(Prj_info) -elsif Prj_info["version_control"] == "github" then - tags = check_upstream_github_by_api(Prj_info) - if tags == nil or tags == "" then - tags = check_upstream_github_by_git(Prj_info) - end - tags = clean_tags(tags.lines) -elsif Prj_info["version_control"] == "git" then - tags = check_upstream_git(Prj_info) - tags = clean_tags(tags.lines) -elsif Prj_info["version_control"] == "hg" then - tags = check_upstream_hg(Prj_info) - tags = clean_tags(tags.lines) -elsif Prj_info["version_control"] == "metacpan" then - tags = check_upstream_metacpan(Prj_info) - tags = clean_tags(tags.lines) -elsif Prj_info["version_control"] == "gitlab.gnome" then - tags = check_upstream_gnome(Prj_info) - tags = clean_tags(tags.lines) -elsif Prj_info["version_control"] == "pypi" then - tags = check_upstream_pypi(Prj_info) - tags = clean_tags(tags.lines) -end - -tags = sort_tags(tags) -print "Latest upstream is ", tags[-1], "\n" -#print "Recommended is ", upgrade_recommend(tags, Cur_ver, "latest-stable"), "\n" -print "Current version is ", Cur_ver, "\n" - -puts "This package has #{spec_struct.get_diverse} patches" - -if tags.length == 0 or compare_tags(tags[-1], Cur_ver) < 0 then - STDERR.puts "DEBUG #{Prj_name} > tags are #{tags}" - File.delete("upstream-info/"+Prj_name+".yaml") if File.exist?("upstream-info/"+Prj_name+".yaml") - File.open("known-issues/"+Prj_name+".yaml", "w") { |file| file.write(Prj_info.to_yaml) } -else - File.open("upstream-info/"+Prj_name+".yaml", "w") { |file| file.write(Prj_info.to_yaml) } -end -File.delete(specfile) if specfile != "" - -if options[:push] then - puts "Push to gitee\n" - ad = Advisor.new - ad.new_issue("src-openeuler", Prj_name, "Upgrade to Latest Release", "Dear #{Prj_name} maintainer:\n\n We found the latst version of #{Prj_name} is #{tags[-1]}, while the current version in openEuler is #{Cur_ver}.\n\n Please consider upgrading.\n\n\nYours openEuler Advisor.") -else - puts "keep it to us\n" -end diff --git a/check_upstream/common.rb b/check_upstream/common.rb deleted file mode 100755 index 4ff8752d..00000000 --- a/check_upstream/common.rb +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'json' -require 'date' - -def compare_tags (a, b) - arr_a = a.split(".") - arr_b = b.split(".") - len = [arr_a.length, arr_b.length].min - idx = 0 - while idx < len do - res1 = arr_a[idx].to_i <=> arr_b[idx].to_i - return res1 if res1 != 0 - res2 = arr_a[idx].length <=> arr_b[idx].length - return -res2 if res2 != 0 - res3 = arr_a[idx][-1].to_i <=> arr_b[idx][-1].to_i - return res3 if res3 != 0 - idx = idx + 1 - end - return arr_a.length <=> arr_b.length -end - -def clean_tag(tag, prj_info) - if prj_info.has_key?("tag_pattern") then - tag = tag.gsub(Regexp.new(prj_info["tag_pattern"]), "\\1") - elsif prj_info.has_key?("tag_prefix") then - tag = tag.gsub(Regexp.new(prj_info["tag_prefix"]), "") - end - if prj_info.has_key?("seperator") and prj_info["seperator"] != "." then - tag = tag.gsub(Regexp.new(prj_info["seperator"]), ".") - end - return tag.gsub("\n", "") -end - -def sort_tags (tags) - tags.sort! { |a, b| - compare_tags(a,b) - } - return tags -end - -def upgrade_recommend(tags, cur_tag, policy) - tags.reverse! - tag1 = cur_tag - tag2 = cur_tag - if policy == "latest" then - return tags[0] - elsif policy == "latest-stable" then - tags.each { |tag| - if tag.split(".").count {|f| f.to_i != 0 } >= 3 then - tag1 = tag - break - end - } - tags.each { |tag| - if tag.split(".").count {|f| f.to_i != 0} >= 2 then - tag2 = tag - break - end - } - if tag2[0].to_i > tag1[0].to_i then - return tag2 - else - return tag1 - end - elsif policy == "perfer-stable" then - tags.each { |tag| - if tag.start_with?(cur_tag) then - return tag - end - } - if cur_tag.split(".").length >= 3 then - search_tag = cur_tag.split(".")[0..1].join(".") - tags.each { |tag| - if tag.start_with?(search_tag) then - return tag - end - } - end - return cur_tag - else - return cur_tag - end - -end - -def load_last_query_result(prj_info, force_reload=false) - if force_reload == true then - prj_info.delete("last_query") - STDERR.puts "DEBUG: #{prj_info["src_repo"].gsub("\n", "")} > Force Reload\n" - return "" - else - if prj_info.has_key?("last_query") then - last_query = prj_info["last_query"] - if Time.now - last_query["time_stamp"] < 60*60*24*3 then - STDERR.puts "DEBUG: #{prj_info["src_repo"].gsub("\n", "")} > Reuse Last Query\n" - return last_query["raw_data"].dup - else - prj_info.delete("last_query") - STDERR.puts "DEBUG: #{prj_info["src_repo"].gsub("\n", "")} > Last Query Too Old.\n" - return "" - end - else - return "" - end - end -end - -def resp_to_git_tags(resp) - tags = "" - resp.each_line { |line| - if line.match(/refs\/tags/) then - match = line.scan(/^([^ \t]*)[ \t]*refs\/tags\/([^ \t]*)\n/) - if match != nil then - tags = tags + match[0][1].to_s + "\n" - end - end - } - return tags -end diff --git a/check_upstream/git.rb b/check_upstream/git.rb deleted file mode 100755 index 0e663f20..00000000 --- a/check_upstream/git.rb +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'date' -require_relative 'common' - -def check_upstream_git (prj_info) - resp = load_last_query_result(prj_info) - cmd="git ls-remote --tags "+prj_info["src_repo"] - if resp == "" then - resp=%x[#{cmd}] - last_query={} - last_query["time_stamp"] = Time.now - last_query["raw_data"] = resp.dup - prj_info["last_query"] = last_query - end - tags = resp_to_git_tags(resp) - return tags -end - diff --git a/check_upstream/github.rb b/check_upstream/github.rb deleted file mode 100755 index c05d40be..00000000 --- a/check_upstream/github.rb +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'json' -require 'date' -require_relative 'common' - -def check_upstream_github_by_api (prj_info) - cmd="/usr/bin/curl -m 60 -s https://api.github.com/repos/"+prj_info["src_repo"]+"/releases" - resp = load_last_query_result(prj_info) - if resp == "" then - STDERR.puts "DEBUG #{prj_info["src_repo"]} > Using api.github to get releases" - begin - retries ||= 0 - resp=%x[#{cmd}] - release = JSON.parse(resp) - rescue - STDERR.puts "DEBUG #{prj_info["src_repo"]} > No Response or JSON Parse failed. Retry in 3 seconds.\n" - sleep 3 - retry if (retries+=1) < 10 - end - if release != [] and release != nil then - last_query = {} - last_query["time_stamp"] = Time.now - last_query["raw_data"] = resp.dup - prj_info["last_query"] = last_query - prj_info["query_type"] = "api.github.releases" - else - # fall back to tags - STDERR.puts "DEBUG #{prj_info["src_repo"]} > Using api.github to get tags" - resp="" - cmd="/usr/bin/curl -m 60 -s https://api.github.com/repos/"+prj_info["src_repo"]+"/tags" - tags=[] - begin - retries ||= 0 - resp=%x[#{cmd}] - tags=JSON.parse(resp) - rescue - STDERR.puts "DEBUG #{prj_info["src_repo"]} > No Response or JSON Parse failed. Retry in 3 seconds.\n" - sleep 3 - retry if (retries += 1) < 10 - end - if tags == [] or tags == nil then - print "WARNING: #{prj_info["src_repo"]}'s upstream version not available~" - return "" - else - last_query = {} - last_query["time_stamp"] = Time.now - last_query["raw_data"] = resp.dup - prj_info["last_query"] = last_query - prj_info["query_type"] = "api.github.tags" - end - end - end - - if prj_info["query_type"] == "api.github.releases" then - result = "" - begin - release = JSON.parse(resp) - release.sort_by! { |e| e["created_at"]} - release.each { |r| - result = result + clean_tag(r["tag_name"], prj_info) + "\n" - } - rescue - end - return result - elsif prj_info["query_type"] == "api.github.tags" then - result = "" - begin - tags = JSON.parse(resp) - tags.each { |r| - result = result + clean_tag(r["name"], prj_info) + "\n" - } - rescue - end - return result - else - return "" - end -end - -def check_upstream_github_by_git(prj_info) - resp = load_last_query_result(prj_info) - if prj_info.has_key?("query_type") and prj_info["query_type"] != "git-ls" then - resp = "" - end - cmd="git ls-remote --tags https://github.com/"+prj_info["src_repo"]+".git" - if resp == "" then - STDERR.puts "DEBUG #{prj_info["src_repo"]} > Using git ls-remote" - resp=%x[#{cmd}] - last_query = {} - last_query["time_stamp"] = Time.now - last_query["raw_data"] = resp.dup - prj_info["last_query"] = last_query - prj_info["query_type"] = "git-ls" - end - tags = resp_to_git_tags(resp) - return tags -end - diff --git a/check_upstream/gnome.rb b/check_upstream/gnome.rb deleted file mode 100755 index 0a0fd112..00000000 --- a/check_upstream/gnome.rb +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'date' -require_relative 'common' - -def check_upstream_gnome (prj_info) - resp = "" - resp = load_last_query_result(prj_info) - if resp == "" then - cmd="git ls-remote --tags https://gitlab.gnome.org/GNOME/"+prj_info["src_repo"]+".git" - resp = %x[#{cmd}] - last_query={} - last_query["time_stamp"] = Time.now - last_query["raw_data"] = resp.dup - prj_info["last_query"] = last_query - end - tags = resp_to_git_tags(resp) - return tags -end - diff --git a/check_upstream/hg.rb b/check_upstream/hg.rb deleted file mode 100755 index 23413853..00000000 --- a/check_upstream/hg.rb +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'date' -require_relative 'common' - -def check_upstream_hg (prj_info) - cookie = "" - cmd="curl -s "+prj_info["src_repo"]+"/raw-tags" - resp = load_last_query_result(prj_info) - if resp == "" then - resp = %x[#{cmd}] - if resp.lines[0].match(/html/) then # we got html response, resend with cookie - resp.each_line { |line| - match = line.scan(/document\.cookie=\"(.*)\";/) - if match != [] then - cookie = cookie + match[0][0] - end - } - cmd="curl -s --cookie \""+cookie+"\" "+prj_info["src_repo"]+"/raw-tags" - resp = %x[#{cmd}] - end - last_query={} - last_query["time_stamp"] = Time.now - last_query["raw_data"] = resp.dup - prj_info["last_query"] = last_query - end - tags = "" - resp.each_line { |line| - if line.match(/^tip/) then - next - end - match = line.scan(/^([\w\d\-\.]*)[ \t]*([\w\d\-\.]*)/) - if match != [] then - tags = tags + match[0][0].to_s + "\n" - end - } - return tags -end diff --git a/check_upstream/metacpan.rb b/check_upstream/metacpan.rb deleted file mode 100755 index 937ee618..00000000 --- a/check_upstream/metacpan.rb +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'json' -require 'date' -require './check_upstream/common' - -def check_upstream_metacpan (prj_info) - resp = "" - info={} - tags = "" - cmd="curl -m 60 -s https://fastapi.metacpan.org/release/"+prj_info["src_repo"] - resp = load_last_query_result(prj_info) - if resp == "" - begin - retries ||= 0 - resp=%x[#{cmd}] - info=JSON.parse(resp) - rescue - STDERR.puts "DEBUG #{prj_info["src_repo"]} > No Respose or JSON parse failed\n" - sleep 3 - retry if (retries += 1) < 10 - end - else - info = JSON.parse(resp) - end - if info != {} then - if ! info.key?("version") then - STDERR.puts "DEBUG #{prj_info["src_repo"]} > ERROR FOUND" - return tags - else - tags = tags +info["version"].to_s+"\n" - end - else - STDERR.puts "DEBUG #{prj_info["src_repo"]} > found unsorted on cpan.metacpan.org\n" - return tags - end - last_query = {} - last_query["time_stamp"] = Time.now - last_query["raw_data"] = resp.dup - prj_info["last_query"] = last_query - return tags -end diff --git a/check_upstream/pypi.rb b/check_upstream/pypi.rb deleted file mode 100755 index 34902a40..00000000 --- a/check_upstream/pypi.rb +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'json' -require 'date' -require './check_upstream/common.rb' - -def check_upstream_pypi (prj_info) - resp = "" - info={} - tags = "" - resp = load_last_query_result(prj_info) - if resp == "" then - last_query={} - last_query["time_stamp"] = Time.now - cmd="curl -m 60 -s -L https://pypi.org/pypi/"+prj_info["src_repo"]+"/json" - begin - retries ||= 0 - resp=%x[#{cmd}] - info=JSON.parse(resp) - rescue - STDERR.puts "DEBUG: #{prj_info["src_repo"].gsub("\n", "")} > No Respose or JSON parse failed\n" - sleep 3 - retry if (retries+=1)<10 - end - if info != {} then - last_query["raw_data"] = resp - prj_info["last_query"] = last_query - end - else - info=JSON.parse(resp) - end - if info != {} then - tags = tags + info["info"]["version"].to_s+"\n" - end - return tags -end diff --git a/check_upstream/svn.rb b/check_upstream/svn.rb deleted file mode 100755 index cac2e034..00000000 --- a/check_upstream/svn.rb +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'json' -require 'date' -require_relative 'common' - -def check_upstream_svn (prj_info) - cmd="/usr/bin/svn ls -v "+prj_info["src_repo"]+"/tags" - resp = load_last_query_result(prj_info) - if resp == "" then - resp = %x[#{cmd}] - last_query = {} - last_query["time_stamp"] = Time.now - last_query["raw_data"] = resp.dup - prj_info["last_query"] = last_query - else - end - sorted_tags = [] - resp.each_line { |tag_line| - match = tag_line.scan(/([.\w]+)/) - if match != nil then - if match[5][0].include?(prj_info["tag_prefix"]) then - new_tag = Hash.new - new_tag["Date"] = Date.parse(match[2][0]+" "+match[3][0]+" "+match[4][0]) - tag = match[5][0] - new_tag["Tag"] = tag.gsub(prj_info["tag_prefix"], "").gsub(prj_info["seperator"], ".") - sorted_tags.append(new_tag) - end - end - } - sorted_tags.sort_by! {|t| t["Date"] } - result = [] - sorted_tags.each { |t| - result.append(t["Tag"]) - } - return result -end - diff --git a/create_repo.py b/create_repo.py deleted file mode 100755 index 01030a22..00000000 --- a/create_repo.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/python3 -""" -This is a command line tool for adding new repo -""" - -import argparse -import yaml -import sys - - -if __name__ == "__main__": - par = argparse.ArgumentParser() - par.add_argument("-r", "--repo", help="YAML file for repositories", type=str, required=True) - par.add_argument("-i", "--sigs", help="YAML file for sigs", type=str, required=True) - par.add_argument("-s", "--sig", help="Sig manage this repo", type=str, required=True) - par.add_argument("-n", "--name", help="Name for new repo", type=str, required=True) - par.add_argument("-d", "--desc", help="Description for new repo", type=str, required=True) - par.add_argument("-u", "--upstream", help="Upstream for new repo", type=str, required=True) - - args = par.parse_args() - - f = open(args.sigs) - sigs = yaml.load(f.read(), Loader=yaml.Loader) - if not sigs: - print("Failed to load {file}".format(file=args.sigs)) - sys.exit(1) - f.close() - - f = open(args.repo) - repo = yaml.load(f.read(), Loader=yaml.Loader) - if not repo: - print("Failed to load {file}".format(file=args.repo)) - sys.exit(1) - f.close() - - nr = {} - nr["name"] = args.name - nr["description"] = args.desc - nr["upstream"] = args.upstream - nr["protected_branches"] = ["master"] - nr["type"] = "public" - - exist = [x for x in repo["repositories"] if x["name"] == args.name] - if exist != []: - print("Repo already exist") - sys.exit(1) - - if repo["community"] == "openeuler": - repo["repositories"].append(nr) - elif repo["community"] == "src-openeuler": - nr["upstream"] = args.upstream - repo["repositories"].append(nr) - - repo["repositories"].sort(key=lambda r: r["name"]) - - valid_sig = False - for s in sigs["sigs"]: - if s["name"] == args.sig: - s["repositories"].append(repo["community"] + "/" + args.name) - s["repositories"].sort() - valid_sig=True - continue - - if valid_sig: - f = open(args.repo, "w") - yaml.dump(repo, f) - f.close() - f = open(args.sigs, "w") - yaml.dump(sigs, f) - f.close() - else: - print("SIG name is not valid") - sys.exit(1) diff --git a/create_repo_with_srpm b/create_repo_with_srpm deleted file mode 100755 index 5e980d12..00000000 --- a/create_repo_with_srpm +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/python3 -""" -This is a command line tool for adding new repo -""" - -import argparse -import yaml -import sys -from os import path -import subprocess - -nr = {} - -def get_info(pkg): - proc = subprocess.Popen(["rpm", "-qpi", pkg], stdout=subprocess.PIPE) - while (True): - line = proc.stdout.readline() - if not line: - break; - info = str(line.strip().decode()).split(':') - if (len(info) < 2): - continue - info[0] = info[0].strip() - info[1] = info[1].strip() - if (info[0] == "Name"): - nr["name"] = info[1] - elif (info[0] == "Summary"): - nr["description"] = info[1] - elif (info[0] == "URL"): - if (len(info) >= 3): - nr["upstream"] = info[1] + ":" + info[2] - else: - nr["upstream"] = info[1] - - - proc.stdout.close() - proc.wait() - - return len(nr) - -if __name__ == "__main__": - par = argparse.ArgumentParser() - par.add_argument("-r", "--repo", help="YAML file for repositories", type=str, required=True) - par.add_argument("-i", "--sigs", help="YAML file for sigs", type=str, required=True) - par.add_argument("-s", "--sig", help="The SIG which contains the package", type=str, required=True) - par.add_argument("-p", "--pkg", help="Package for upoad", type=str, required=True) - - args = par.parse_args() - - if (path.exists(args.pkg) and path.isfile(args.pkg)): - ret = get_info(args.pkg) - if (ret < 3): - print("Somthing is wrong\n") - sys.exit(1) - else: - print("%s does not exist\n" & args.pkg) - sys.exit(1) - - f = open(args.sigs) - sigs = yaml.load(f.read(), Loader=yaml.Loader) - if not sigs: - print("Failed to load {file}".format(file=args.sigs)) - sys.exit(1) - f.close() - - f = open(args.repo) - repo = yaml.load(f.read(), Loader=yaml.Loader) - if not repo: - print("Failed to load {file}".format(file=args.repo)) - sys.exit(1) - f.close() - - nr["protected_branches"] = ["master"] - nr["type"] = "public" - - exist = [x for x in repo["repositories"] if x["name"] == nr["name"]] - if exist != []: - print("Repo already exist") - sys.exit(1) - - if repo["community"] == "openeuler": - del nr["upstream"] - repo["repositories"].append(nr) - elif repo["community"] == "src-openeuler": - repo["repositories"].append(nr) - - repo["repositories"].sort(key=lambda r: r["name"]) - - valid_sig = False - for s in sigs["sigs"]: - if s["name"] == args.sig: - s["repositories"].append(repo["community"] + "/" + nr["name"]) - s["repositories"].sort() - valid_sig=True - continue - - if valid_sig: - f = open(args.repo, "w") - yaml.dump(repo, f) - f.close() - f = open(args.sigs, "w") - yaml.dump(sigs, f) - f.close() - else: - print("SIG name is not valid") - sys.exit(1) - - - print("create repo %s successfully\n" % nr["name"]) - sys.exit(0) diff --git a/gitee.py b/gitee.py deleted file mode 100755 index 455fb052..00000000 --- a/gitee.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/python3 -""" -This is a helper script for working with gitee.com -""" - -import urllib -import urllib.request -import urllib.parse -import urllib.error -import argparse -import yaml -import re -import os.path -import json -import pprint - - -class Gitee(object): - """ - Gitee is a helper class to abstract gitee.com api - """ - def __init__(self): - self.secret = open(os.path.expanduser("~/.gitee_personal_token.json"), "r") - self.token = json.load(self.secret) - - self.headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW 64; rv:50.0) Gecko/20100101 Firefox/50.0'} - self.gitee_url = "https://gitee.com/" - self.src_openeuler_url = self.gitee_url + "src-openeuler/{package}/raw/master/" - self.advisor_url = self.gitee_url + "openeuler/openEuler-Advisor/raw/master/" - self.specfile_url_template = self.src_openeuler_url + "{specfile}" - self.yamlfile_url_template = self.src_openeuler_url + "{package}.yaml" - #self.advisor_url_template = "https://gitee.com/openeuler/openEuler-Advisor/raw/master/upstream-info/{package}.yaml" - self.advisor_url_template = self.advisor_url + "upstream-info/{package}.yaml" - #self.specfile_exception_url = "https://gitee.com/openeuler/openEuler-Advisor/raw/master/helper/specfile_exceptions.yaml" - self.specfile_exception_url = self.advisor_url + "helper/specfile_exceptions.yaml" - - def post_gitee(self, url, values, headers=None): - """ - POST into gitee API - """ - if headers is None: - headers = self.headers.copy() - data = urllib.parse.urlencode(values).encode('utf-8') - req = urllib.request.Request(url=url, data=data, headers=headers, method="POST") - try: - u = urllib.request.urlopen(req) - return u.read().decode("utf-8") - except urllib.error.HTTPError as err: - print("WARNING:" + str(err.code)) - print("WARNING:" + str(err.headers)) - return False - - def fork_repo(self, repo): - """ - Fork repository in gitee - """ - url = "https://gitee.com/api/v5/repos/src-openeuler/{repo}/forks".format(repo=repo) - values = {} - values["access_token"] = self.token["access_token"] - # headers["User-Agent"] = "curl/7.66.0" - #headers["Content-Type"] = "application/json;charset=UTF-8" - #headers["HOST"] = "gitee.com" - #headers["Accept"] = "*/*" - return self.post_gitee(url, values) - - def create_pr(self, head, repo): - """ - Create PR in gitee - """ - url = "https://gitee.com/api/v5/repos/src-openeuler/{repo}/pulls".format(repo=repo) - values = {} - values["access_token"] = self.token["access_token"] - values["title"] = "Upgrade to latest version of {repo}".format(repo=repo) - values["head"] = "{head}:master".format(head=head) - values["base"] = "master" - values["body"] = """This is a (mostly) automatically created PR by openEuler-Advisor. -Please be noted that it's not throughly tested. -Review carefully before accept this PR. -Thanks. -Yours openEuler-Advisor. -""" - return self.post_gitee(url, values) - - def get_gitee(self, url, headers=None): - """ - GET from gitee api - """ - if headers is None: - req = urllib.request.Request(url=url, headers=self.headers) - else: - req = urllib.request.Request(url=url, headers=headers) - u = urllib.request.urlopen(req) - return u.read().decode("utf-8") - - def get_gitee_json(self, url): - """ - get and load gitee json response - """ - #headers = self.headers.copy() - headers = {} - headers["Content-Type"] = "application/json;charset=UTF-8" - resp = self.get_gitee(url, headers) - return json.loads(resp) - - def get_spec_exception(self): - """ - get well known spec file exceptions - """ - resp = self.get_gitee(self.specfile_exception_url) - exps = yaml.load(resp, Loader=yaml.Loader) - return exps - - def get_spec(self, pkg): - """ - get openeuler spec file for specific package - """ - exp = self.get_spec_exception() - if pkg in exp: - dir_name = exp[pkg]["dir"] - file_name = exp[pkg]["file"] - specurl = self.specfile_url_template.format(package=pkg, specfile=dir_name + "/" + file_name) - else: - specurl = self.specfile_url_template.format(package=pkg, specfile=pkg + ".spec") - - return self.get_gitee(specurl) - - def get_yaml(self, pkg): - """ - get upstream yaml metadata for specific package - """ - yamlurl = self.advisor_url_template.format(package=pkg) - resp = self.get_gitee(yamlurl) - if re.match("Not found", resp): - yamlurl = self.yamlfile_url_template.format(package=pkg) - resp = self.get_gitee(yamlurl) - if re.match("Not found", resp): - print("Cannot find upstream metadata") - return False - else: - return resp - else: - return False - -if __name__ == "__main__": - pass - diff --git a/gitee/advisor.rb b/gitee/advisor.rb deleted file mode 100755 index a4a71f03..00000000 --- a/gitee/advisor.rb +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/ruby - -require 'json' - -class Advisor - def initialize - @token = JSON.parse(File.read (File.expand_path "~/.gitee_token.json")) - @cmd = "curl -s -X POST --header 'Content-Type: application/json;charset=UTF-8'" - @param = {} - end - - def new_issue(owner, repo, title, body) - @param["access_token"] = @token["access_token"] - @param["repo"] = repo - @param["title"] = title - @param["body"] = body - @cmd += " 'https://gitee.com/api/v5/repos/#{owner}/issues'" - @cmd += " -d '" + @param.to_json + "'" - #puts @cmd - resp = %x[#{@cmd}] - #puts resp - end -end - -#ad = Advisor.new -#ad.new_issue("Shinwell_Hu", "openEuler-Toolbox") diff --git a/gitee/prepare_token.sh b/gitee/prepare_token.sh deleted file mode 100755 index 39c5bc33..00000000 --- a/gitee/prepare_token.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# refer to gitee.com/api/v5/oauth_doc#/list-item-2 -source ~/.gitee_secret -echo "Refreshing ~/.gitee_token.json" -curl -s -X POST --data-urlencode "grant_type=password" --data-urlencode "username=$username" --data-urlencode "password=$password" --data-urlencode "client_id=$client_id" --data-urlencode "client_secret=$client_secret" --data-urlencode "scope=projects issues" https://gitee.com/oauth/token > ~/.gitee_token.json -chmod 400 ~/.gitee_token.json diff --git a/helper/download_spec.rb b/helper/download_spec.rb deleted file mode 100755 index 0c3403d9..00000000 --- a/helper/download_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' - -def download_spec(name) - output_dir = "." - exception_load = YAML.load(File.read(File.dirname(__FILE__)+"/specfile_exceptions.yaml")) - if exception_load.has_key?(name) then - output_file = "#{output_dir}/#{exception_load[name]["file"]}" - cmd = "curl -s https://gitee.com/src-openeuler/#{name}/raw/master/#{exception_load[name]["dir"]}/#{exception_load[name]["file"]} -o #{output_file}" - else - output_file = "#{output_dir}/#{name}.spec" - cmd = "curl -s https://gitee.com/src-openeuler/#{name}/raw/master/#{name}.spec -o #{output_file}" - - end - %x[#{cmd}] if ! File.exists?(output_file) - s = File.size(output_file) - if s == 52 then - STDERR.puts "> No SPEC file found for #{name}" - File.delete output_file - return "" - end - return output_file -end - diff --git a/helper/rpmparser.rb b/helper/rpmparser.rb deleted file mode 100755 index 8e2908cc..00000000 --- a/helper/rpmparser.rb +++ /dev/null @@ -1,175 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'set' - -def rpmspec_split_file (line, prefix) - m = line.scan (/#{prefix}\s*(.*)/) - if m != [] then - return m[0][0] - else - return nil - end -end - -def rpmspec_split_tags (line, prefix) - m = line.scan (/#{prefix}\s*(.*)/) - if m != [] then - br = m[0][0] - if br.index(',') then - bra = br.split(',').map(&:strip) - return bra - elsif br =~ /\w\s+\w/ then - bra = br.split(/\s+/) - return bra - end - end - return nil -end - -def rpmspec_clean_tag (oset, mac) - - new_set = Set.new - - oset.each { |br| - if br[0] =~ /[\d<=>!]/ then - oset.delete(br) - elsif br =~ /[<=>!]/ then - bra = br.split("\s").map(&:strip) - oset.delete(br) - new_set << bra[0] - elsif br.match(/%{/) then - m = br.scan(/%{(.*?)}/) - i = 0 - nbr = br - while i < m.length do - if mac[m[i][0]] then - nbr = nbr.gsub(/%{#{m[i][0]}}/, mac[m[i][0]]) - else - # some strange RPM macro needs shell expand, I dont know ohw to handle this - end - i = i + 1 - end - oset.delete(br) - new_set << nbr - end - } - oset += new_set - return oset -end - -def rpmspec_macro_expand(tag, macro) - ##This needs a fix - if tag.match(/%{/) then - m = tag.scan(/%{(.*)}/) - if m != [] then - if macro[m[0][0]] then - tag = tag.gsub(/%{#{m[0][0]}}/, macro[m[0][0]]) - end - end - end - return tag -end - -class Specfile - def initialize(filepath) - spec = File.open("#{filepath}") - @macros = {} - @macros["epoch"] = "1" - @macros["?_isa"] = "aarch64" - @name = "" - @version = "" - @release = "" - - @build_requires = Set.new - @requires = Set.new - @provides = Set.new - - @sources = Set.new - @patches = Set.new - - spec.each_line { |line| - m = line.scan (/^[Nn]ame\s*:\s*([^\s]*)\s*/) - if m != [] then - @name = m[0][0] - end - m = line.scan (/^[Vv]ersion\s*:\s*([^\s]*)\s*/) - if m != [] then - @version = m[0][0] - end - m = line.scan (/^[Rr]elease\s*:\s*([^\s]*)\s*/) - if m != [] then - @release = m[0][0] - end - m = line.scan (/%global\s*([^\s]*)\s*(.*)/) - if m != [] then - @macros[m[0][0]] = m[0][1] - end - m = line.scan (/%define\s*([^\s]*)\s*(.*)/) - if m != [] then - @macros[m[0][0]] = m[0][1] - end - bra = rpmspec_split_tags(line, "BuildRequires:") - if bra != nil then - @build_requires += bra - end - ra = rpmspec_split_tags(line, "Requires:") - if ra != nil then - @requires += ra - end - po = rpmspec_split_tags(line, "Provides:") - if po != nil then - @provides += po - end - src = rpmspec_split_file(line, "Source\\d*:") - if src != nil then - @sources << src - end - pa = rpmspec_split_file(line, "Patch\\d*:") - if pa != nil then - @patches << pa - end - } - @name = rpmspec_macro_expand(@name, @macros) - @macros["name"] = @name - - @version = rpmspec_macro_expand(@version, @macros) - @macros["version"] = @version - - @release = rpmspec_macro_expand(@release, @macros) - @macros["release"] = @release - - @build_requires = rpmspec_clean_tag(@build_requires, @macros) - @requires = rpmspec_clean_tag(@requires, @macros) - @provides = rpmspec_clean_tag(@provides, @macros) - end - - def get_name - return @name - end - - def get_version - return @version - end - - def get_diverse - return @patches.length - end - - def get_sources - return @sources - end - - def expand_macros(s) - return rpmspec_clean_tag(s, @macros) - end -#newspec = {} -#newspec["name"] = name -#newspec["release"] = release -#newspec["version"] = version -#newspec["build_requires"] = build_requires -#newspec["provides"] = provides -#newspec["requires"] = requires - -end - diff --git a/helper/specfile_exceptions.yaml b/helper/specfile_exceptions.yaml deleted file mode 100755 index 0e51e521..00000000 --- a/helper/specfile_exceptions.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -libnetwork: - dir: script - file: docker-proxy.spec -authz: - dir: hack - file: authz.spec -lxcfs-tools: - dir: hack - file: lxcfs-tools.spec -libkae: - dir: . - file: kae.spec -autotune: - dir: . - file: atune.spec -dvdplusrw-tools: - dir: . - file: dvd+rw-tools.spec -gtk: - dir: . - file: gtk+.spec -docker: - dir: . - file: docker-engine-openeuler.spec -libsigcpp20: - dir: . - file: libsigc++20.spec -libwd: - dir: . - file: warpdrive.spec -kmod-kvdo: - dir: . - file: kvdo.spec -jboss-el: - dir: . - file: jboss-el-2.2-api.spec -openEuler-rpm-config: - dir: . - file: generic-rpm-config.spec -openEuler-release: - dir: . - file: generic-release.spec -openjdk-1.8.0: - dir: . - file: java-1.8.0-openjdk.spec -openjdk-11: - dir: . - file: java-11-openjdk.spec -A-Tune: - dir: . - file: atune.spec -runc: - dir: . - file: runc-openeuler.spec \ No newline at end of file diff --git a/packager/python-packager.py b/packager/python-packager.py deleted file mode 100755 index ce131ebf..00000000 --- a/packager/python-packager.py +++ /dev/null @@ -1,441 +0,0 @@ -#!/usr/bin/python3 -""" -This is a packager bot for python modules from pypi.org -""" -#****************************************************************************** -# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. -# licensed under the Mulan PSL v2. -# You can use this software according to the terms and conditions of the Mulan PSL v2. -# You may obtain a copy of Mulan PSL v2 at: -# http://license.coscl.org.cn/MulanPSL2 -# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR -# PURPOSE. -# See the Mulan PSL v2 for more details. -# Author: Shinwell_Hu Myeuler -# Create: 2020-05-07 -# Description: provide a tool to package python module automatically -# ******************************************************************************/ - -import urllib -import urllib.request -from pprint import pprint -from os import path -import json -import sys -import re -import datetime -import argparse -import subprocess -import os -from pathlib import Path -# python3-wget is not default available on openEuler yet. -# import wget - -url_template = 'https://pypi.org/pypi/{pkg_name}/json' -json_file_template = '{pkg_name}.json' -name_tag_template = 'Name:\t\tpython-{pkg_name}' -summary_tag_template = 'Summary:\t{pkg_sum}' -version_tag_template = 'Version:\t{pkg_ver}' -release_tag_template = 'Release:\t1' -license_tag_template = 'License:\t{pkg_lic}' -home_tag_template = 'URL:\t\t{pkg_home}' -source_tag_template = 'Source0:\t{pkg_source}' - -buildreq_tag_template = 'BuildRequires:\t{req}' - -build_noarch = True # Usually python modules are arch independent - -def get_license(j): - """ - By default, the license info can be achieved from json["info"]["license"] - In rare cases it doesn't work. - We fall back to json["info"]["classifiers"], it looks like License :: OSI Approved :: BSD Clause - """ - if j["info"]["license"] != "": - return j["info"]["license"] - for k in j["info"]["classifiers"]: - if k.startswith("License"): - ks = k.split("::") - return ks[2].strip() - return "" - - -def get_source_url(j): - """ - return URL for source file for the latest version - return "" in errors - """ - v = j["info"]["version"] - rs = j["releases"][v] - for r in rs: - if r["packagetype"] == "sdist": - return r["url"] - return "" - - -def transform_module_name(n): - """ - return module name with version restriction. - Any string with '.' or '/' is considered file, and will be ignored - Modules start with python- will be changed to python3- for consistency. - """ - # remove () - ns = re.split("[()]", n) - ver_constrain = [] - ns[0] = ns[0].strip() - if ns[0].startswith("python-"): - ns[0] = ns[0].replace("python-", "python3-") - else: - ns[0] = "python3-" + ns[0] - if ns[0].find("/") != -1 or ns[0].find(".") != -1: - return "" - if len(ns) > 1: - vers = ns[1].split(",") - for ver in vers: - m = re.match(r"([!<>=]+)( *)(\d.*)", ver.strip()) - ver_constrain.append(ns[0] + " " + m[1] + " " + m[3]) - return ", ".join(ver_constrain) - else: - return ns[0] - - -def get_requires(j): - """ - return all requires no matter if extra is required. - """ - rs = j["info"]["requires_dist"] - if rs is None: - return - for r in rs: - idx = r.find(";") - mod = transform_module_name(r[:idx]) - print("Requires:\t" + mod) - - -def refine_requires(req): - """ - return only requires without ';' (thus no extra) - """ - ra = req.split(";", 1) - # - # Do not add requires which has ;, which is often has very complicated precondition - # Will need more parsing of the denpency after ; - return transform_module_name(ra[0]) - -def get_build_requires(resp): - req_list=[] - rds = resp["info"]["requires_dist"] - if rds is not None: - for rp in rds: - br = refine_requires(rp) - if (br == ""): - continue - # - # Do not output BuildRequires: - # just collect all build requires and using pip to install - # than can help to build all rpm withoud trap into - # build dependency nightmare - # - #print(buildreq_tag_template.format(req=br)) - name=str.lstrip(br).split(" ") - req_list.append(name[0]) - return req_list - -def get_buildarch(j): - """ - If this module has a prebuild package for amd64, then it is arch dependent. - print BuildArch tag if needed. - """ - v = j["info"]["version"] - rs = j["releases"][v] - for r in rs: - if r["packagetype"] == "bdist_wheel": - if r["url"].find("amd64") != -1: - global build_noarch - build_noarch = False - return - print("BuildArch:\tnoarch") - - -def get_description(j): - """ - return description. - Usually it's json["info"]["description"] - If it's rst style, then only use the content for the first paragraph, and remove all tag line. - For empty description, use summary instead. - """ - desc = j["info"]["description"].splitlines() - res = [] - paragraph = 0 - for d in desc: - if len(d.strip()) == 0: - continue - first_char = d.strip()[0] - ignore_line = False - if d.strip().startswith("===") or d.strip().startswith("---"): - paragraph = paragraph + 1 - ignore_line = True - elif d.strip().startswith(":") or d.strip().startswith(".."): - ignore_line = True - if ignore_line != True and paragraph == 1: - res.append(d) - if paragraph >= 2: - del res[-1] - return "\n".join(res) - if res != []: - return "\n".join(res) - elif paragraph == 0: - return j["info"]["description"] - else: - return j["info"]["summary"] - - -def store_json(j, pkg, spath): - """ - save json file - """ - fname = json_file_template.format(pkg_name=pkg) - json_file = os.path.join(spath, fname) - - # if file exist, do nothing - if path.exists(json_file) and path.isfile(json_file): - with open(json_file, 'r') as f: - resp = json.load(f) - else: - with open(json_file, 'w') as f: - json.dump(j, f) - - -def get_pkg_json(pkg): - """ - recieve json from pypi.org - """ - url = url_template.format(pkg_name=pkg) - - u = urllib.request.urlopen(url) - resp = json.loads(u.read().decode('utf-8')) - - return resp - - -def download_source(j, tgtpath): - """ - download source file from url, and save it to target path - """ - if (os.path.exists(tgtpath) == False): - print("download path %s does not exist\n", tgtpath) - return False - s_url = get_source_url(j) - return subprocess.call(["wget", s_url, "-P", tgtpath]) - - -def prepare_rpm_build_env(buildroot): - """ - prepare environment for rpmbuild - """ - if (os.path.exists(buildroot) == False): - print("Build Root path %s does not exist\n", buildroot) - return False - - for sdir in ['SPECS', 'BUILD', 'SOURCES', 'SRPMS', 'RPMS', 'BUILDROOT']: - bpath = os.path.join(buildroot, sdir) - if (os.path.exists(bpath) == False): - os.mkdir(bpath) - - return True - - -def try_install_package(pkg): - """ - install packages listed in build requires - """ - print(pkg) - ret = subprocess.call(["rpm", "-qi", pkg]) - if ret == 0: - return True - - # try pip installation - pip_name = pkg.split("-") - if len(pip_name) == 2: - ret = subprocess.call(["pip3", "install", "--user", pip_name[1]]) - else: - ret = subprocess.call(["pip3", "install", "--user", pip_name[0]]) - - if ret != 0: - print("%s can not be installed correctly, Fix it later, go ahead to do building..." % pip_name) - - # - # Try to build anyway, fix it later - # - return True - -def prepare_dependencies(req_list): - for req in req_list: - if (try_install_package(req) == False): - return req - return "" - -def build_package(specfile): - """ - build rpm package with rpmbuild - """ - ret = subprocess.call(["rpmbuild", "-ba", specfile]) - return ret - - -def build_rpm(j, buildroot): - """ - full process to build rpm - """ - if(prepare_rpm_build_env(buildroot) == False): - return False - - specfile = os.path.join(buildroot, "SPECS", "python-" + j["info"]["name"] + ".spec") - - req_list = build_spec(j, specfile) - ret = prepare_dependencies(req_list) - if ret != "": - print("%s can not be installed automatically, Please handle it" % ret) - return ret - - download_source(j, os.path.join(buildroot, "SOURCES")) - - build_package(specfile) - - return "" - - -def build_spec(resp, output): - """ - print out the spec file - """ - if os.path.isdir(output): - output = os.path.join(output, "python3-" + resp["info"]["name"]) - tmp = sys.stdout - if (output == ""): - print() - else: - sys.stdout = open(output, 'w+') - - print(name_tag_template.format(pkg_name=resp["info"]["name"])) - print(version_tag_template.format(pkg_ver=resp["info"]["version"])) - print(release_tag_template) - print(summary_tag_template.format(pkg_sum=resp["info"]["summary"])) - print(license_tag_template.format(pkg_lic=get_license(resp))) - print(home_tag_template.format(pkg_home=resp["info"]["project_urls"]["Homepage"])) - print(source_tag_template.format(pkg_source=get_source_url(resp))) - get_buildarch(resp) - print("") - get_requires(resp) - print("") - print("%description") - print(get_description(resp)) - print("") - print("%package -n python3-{name}".format(name=resp["info"]["name"])) - print(summary_tag_template.format(pkg_sum=resp["info"]["summary"])) - print("Provides:\tpython-" + resp["info"]["name"]) - print(buildreq_tag_template.format(req='python3-devel')) - print(buildreq_tag_template.format(req='python3-setuptools')) - - if build_noarch == False: - print(buildreq_tag_template.format(req='python3-cffi')) - print(buildreq_tag_template.format(req='gcc')) - print(buildreq_tag_template.format(req='gdb')) - - - build_req_list=get_build_requires(resp) - - print("%description -n python3-" + resp["info"]["name"]) - print(get_description(resp)) - print("") - print("%package help") - print("Summary:\tDevelopment documents and examples for {name}".format(name=resp["info"]["name"])) - print("Provides:\tpython3-{name}-doc".format(name=resp["info"]["name"])) - print("%description help") - print(get_description(resp)) - print("") - print("%prep") - print("%autosetup -n {name}-{ver}".format(name=resp["info"]["name"], ver=resp["info"]["version"])) - print("") - print("%build") - print("%py3_build") - print("") - print("%install") - print("%py3_install") - print("install -d -m755 %{buildroot}/%{_pkgdocdir}") - print("if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi") - print("if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi") - print("if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi") - print("if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi") - print("pushd %{buildroot}") - print("if [ -d usr/lib ]; then") - print("\tfind usr/lib -type f -printf \"/%h/%f\\n\" >> filelist.lst") - print("fi") - print("if [ -d usr/lib64 ]; then") - print("\tfind usr/lib64 -type f -printf \"/%h/%f\\n\" >> filelist.lst") - print("fi") - print("if [ -d usr/bin ]; then") - print("\tfind usr/bin -type f -printf \"/%h/%f\\n\" >> filelist.lst") - print("fi") - print("if [ -d usr/sbin ]; then") - print("\tfind usr/sbin -type f -printf \"/%h/%f\\n\" >> filelist.lst") - print("fi") - print("popd") - print("mv %{buildroot}/filelist.lst .") - print("") - print("%files -n python3-{name} -f filelist.lst".format(name=resp["info"]["name"])) -# print("%{python3_sitelib}/*.egg-info/") -# print("%{python3_sitelib}/" + resp["info"]["name"]) - - if build_noarch: - print("%dir %{python3_sitelib}/*") - else: - print("%dir %{python3_sitearch}/*") - - print("") - print("%files help") - print("%{_pkgdocdir}") - print("") - print("%changelog") - date_str = datetime.date.today().strftime("%a %b %d %Y") - print("* {today} Python_Bot ".format(today=date_str)) - print("- Package Spec generated") - - sys.stdout = tmp - - return build_req_list - - -if __name__ == "__main__": - - dft_root_path=os.path.join(str(Path.home()), "rpmbuild") - - parser = argparse.ArgumentParser() - - parser.add_argument("-s", "--spec", help="Create spec file", action="store_true") - parser.add_argument("-b", "--build", help="Build rpm package", action="store_true") - parser.add_argument("-r", "--rootpath", help="Build rpm package in root path", type=str, default=dft_root_path) - parser.add_argument("-d", "--download", help="Download source file indicated path", action="store_true") - parser.add_argument("-p", "--path", help="indicated path to store files", type=str, default=os.getcwd()) - parser.add_argument("-j", "--json", help="Get Package JSON info", action="store_true") - parser.add_argument("-o", "--output", help="Output to file", type=str, default="") - parser.add_argument("pkg", type=str, help="The Python Module Name") - args = parser.parse_args() - - response = get_pkg_json(args.pkg) - - if (args.spec): - build_spec(response, args.output) - - if (args.build): - ret = build_rpm(response, args.rootpath) - if ret != "": - print("BuildRequire : %s" % ret) - - if (args.download): - download_source(response, args.path) - - if (args.json): - store_json(response, args.pkg, args.path) - diff --git a/simple-update-robot.py b/simple-update-robot.py deleted file mode 100755 index fff62082..00000000 --- a/simple-update-robot.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/python3 -""" -This is a robot to do package upgrade automation -Expected process: - 1. get URL to download updated version - 2. Change Version to new one - 3. Change Source or Source0 if needed - 4. Update %changelog - 5. try rpmbuild -bb (not yet) - 6. fork on gitee - 7. git clone, git add, git commit, git push (manually now) - 8. PR on gitee -""" - -from pyrpm.spec import Spec, replace_macros -import yaml -import argparse -import gitee -import sys -import subprocess -import os.path -import re -import datetime - -def download_source_url(spec, o_ver, n_ver): - """ - Download source file from Source or Source0 URL - """ - source = replace_macros(spec.sources[0], spec).replace(o_ver, n_ver) - if re.match(r"%{.*?}", source): - print("Extra macros in URL which failed to be expanded") - return False - elif source.startswith("http") or source.startswith("ftp"): - fn = os.path.basename(source) - subprocess.call(["curl", "-L", source, "-o", fn]) - return fn - else: - print("Not valid URL for Source code") - return False - - -def download_upstream_url(gt, repo, n_ver): - """ - Download source from upstream metadata URL - """ - upstream_yaml = gt.get_yaml(repo) - if not upstream_yaml: - return False - - rp_yaml = yaml.loads(upstream_yaml, Loader=yaml.Loader) - if rp_yaml["version_control"] == "github": - url = "https://github.com/{rp}/archive/{nv}.tar.gz".format(rp=rp_yaml["src_repo"], nv=n_ver) - fn = "{rp}.{nv}.tar.gz".format(rp=repo, nv=n_ver) - subprocess.call(["curl", "-L", url, "-o", fn]) - return fn - else: - print("Handling {vc} is still under developing".format(vc=rp_yaml["version_control"])) - return False - - -def create_spec(repo, spec_str, o_ver, n_ver, src_fn=None): - """ - Create new spec file for upgraded package - """ - fn = open(repo + ".spec", "w") - in_changelog = False - for l in spec_str.splitlines(): - if l.startswith("Release:"): - fn.write("Release:\t0\n") - continue - if l.startswith("Source:") or l.startswith("Source0:"): - if src_fn: - fn.write("Source: {src_fn}\n".format(src_fn=src_fn).replace(o_ver, n_ver)) - else: - fn.write(l.replace(o_ver, n_ver)+"\n") - continue - if not in_changelog: - nl = l.replace(o_ver, n_ver) - else: - nl = l - fn.write(nl + "\n") - - if nl.startswith("%changelog"): - in_changelog = True - d = datetime.date.today() - fn.write(d.strftime("* %a %b %d %Y SimpleUpdate Robot - {ver}-0\n").format(ver=n_ver)) - fn.write("- Update to version {ver}\n".format(ver=n_ver)) - fn.write("\n") - fn.close() - -if __name__ == "__main__": - pars = argparse.ArgumentParser() - pars.add_argument("pkg", type=str, help="The package to be upgraded") - pars.add_argument("-o", "--old_version", type=str, help="Current upstream version of package") - pars.add_argument("-n", "--new_version", type=str, help="New upstream version of package will be upgrade to") - pars.add_argument("-s", "--create_spec", help="Create spec file", action="store_true") - pars.add_argument("-d", "--download", help="Download upstream source code", action="store_true") - pars.add_argument("-f", "--fork", help="fork src-openeuler repo into users", action="store_true") - pars.add_argument("-c", "--clone", help="clone privatge repo to local", action="store_true") - pars.add_argument("-p", "--PR", help="Create upgrade PR", action="store_true") - args = pars.parse_args() - - my_gitee = gitee.Gitee() - spec_string= my_gitee.get_spec(args.pkg) - - s_spec = Spec.from_string(spec_string) - - if args.fork: - my_gitee.fork_repo(args.pkg) - - if args.clone: - user=my_gitee.token["user"] - subprocess.call(["git", "clone", "git@gitee.com:{user}/{pkg}".format(user=user, pkg=args.pkg)]) - os.chdir(args.pkg) - - if args.download: - source_file = download_source_url(s_spec, args.old_version, args.new_version) - if source_file: - print(source_file) - else: - source_file = download_upstream_url(my_gitee, args.pkg, args.new_version) - if source_file: - print(source_file) - else: - print("Failed to download the latest source code.") - sys.exit(1) - - if args.create_spec: - if len(s_spec.patches) >= 1: - print("I'm too naive to handle complicated package.") - print("This package has multiple in-house patches.") - sys.exit(1) - create_spec(args.pkg, spec_string, args.old_version, args.new_version) - - if args.PR: - my_gitee.create_pr(my_gitee.token["user"], args.pkg) diff --git a/tc_reminder.py b/tc_reminder.py deleted file mode 100755 index 1c76f68a..00000000 --- a/tc_reminder.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/python3 -""" -This is a command line tool to create reminder list for TC member -""" - -import urllib -import urllib.request -import urllib.parse -import argparse -import json -import sys -import os -import yaml -from pprint import pprint -from datetime import datetime - -class Advisor(object): - """ - This is a object abstract TC robot - """ - def __init__(self): - self.secret = open(os.path.expanduser("~/.gitee_personal_token.json"), "r") - self.token = json.load(self.secret) - self.header = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0"} - self.tc_members = None - self.time_format = "%Y-%m-%dT%H:%M:%S%z" - - def get_json(self, url): - """ - Return object parsed from remote json - """ - headers = self.header.copy() - headers["Content-Type"] = "application/json;charset=UTF-8" - req = urllib.request.Request(url = url, - headers = headers, - method = "GET") - - with urllib.request.urlopen(req) as u: - resp = json.loads(u.read().decode("utf-8")) - return resp - - def get_file(self, repo, path): - """ - Get remote raw file - """ - url = "https://gitee.com/{repo}/raw/master/{path}".format(repo=repo, path=path) - req = urllib.request.Request(url = url, - headers = self.header, - method = "GET") - - with urllib.request.urlopen(req) as u: - resp = u.read() - - return resp - - def get_prs(self): - """ - Get list of PRs - """ - pulls_url = "https://gitee.com/api/v5/repos/openeuler/community/pulls" - list_url = pulls_url + "?access_token={token}&state=open&sort=created&direction=desc&page=1&per_page=100" - url = list_url.format(token=self.token["access_token"]) - return self.get_json(url) - - def get_pr_comments(self, number): - """ - Get Comments for a specific PR - """ - pulls_url = "https://gitee.com/api/v5/repos/openeuler/community/pulls" - desc_url = pulls_url + "/{number}/comments?access_token={token}&page=1&per_page=100" - url = desc_url.format(number=number, token=self.token["access_token"]) - return self.get_json(url) - - def get_tc_members(self): - """ - Get list of current TC members - """ - m = yaml.load(adv.get_file("openeuler/community", "sig/TC/OWNERS"), Loader=yaml.Loader) - self.tc_members = m["maintainers"] - return m["maintainers"] - - def filter_out_tc(self, users): - """ - Pick TC members from users - """ - if not self.tc_members: - self.get_tc_members() - return [x for x in self.tc_members if x in users] - - -if __name__ == "__main__": - par = argparse.ArgumentParser() - - args = par.parse_args() - - adv = Advisor() - PRs = adv.get_prs() - PRs.reverse() - for pr in PRs: - commenters = [] - commenters.append(pr["user"]["login"]) - last_update = pr["updated_at"] - print("URL: https://gitee.com/openeuler/community/pulls/{number}".format(number=pr["number"])) - print("Title: " + pr["title"]) - comments = adv.get_pr_comments(pr["number"]) - last_update = datetime.strptime(comments[0]["updated_at"], adv.time_format) - comments.reverse() - current_lgtm = 0 - current_approve = False - for comment in comments: - commenters.append(comment["user"]["login"]) - if comment["body"].startswith("new changes are detected"): - last_update = datetime.strptime(comment["updated_at"], adv.time_format) - break # older comments are ignored - elif comment["body"].startswith("***lgtm*** is added in this pull request"): - current_lgtm = current_lgtm + 1 - elif comment["body"].startswith("***approved*** is added in this pull request"): - current_approve = True - - tc = adv.filter_out_tc(commenters) - age = datetime.now() - last_update.replace(tzinfo=None) - age_days = max(age.days, 0) - print("Currently {num} days old".format(num=age_days)) - print("Currently involved TC members: " + ", ".join(tc)) - print("Currently has {num} /lgtm".format(num=current_lgtm)) - if current_approve: - print("Currently /approve") - print("") - - diff --git a/who_maintain.py b/who_maintain.py deleted file mode 100755 index 21ddd5e8..00000000 --- a/who_maintain.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/python3 -""" -This is a simple script to query that contact person for specific package -""" - -import urllib -import urllib.request -import argparse -import yaml -import re - -# Useful default setting -headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW 64; rv:23.0) Gecko/20100101 Firefox/23.0'} -# known important information -sigs_url = "https://gitee.com/openeuler/community/raw/master/sig/sigs.yaml" -sigs_owner_url_template = "https://gitee.com/openeuler/community/raw/master/sig/{signame}/OWNERS" -specfile_url_template = "https://gitee.com/src-openeuler/{package}/raw/master/{specfile}" -specfile_exception_url = "https://gitee.com/shinwell_hu/openEuler-Advisor/raw/master/helper/specfile_exceptions.yaml" - - -def get_gitee(url): - req = urllib.request.Request(url=url, headers=headers) - u = urllib.request.urlopen(req) - return u.read().decode("utf-8") - - -def get_sigs(): - req = urllib.request.Request(url=sigs_url, headers=headers) - u = urllib.request.urlopen(req) - sigs = yaml.load(u.read().decode("utf-8"), Loader=yaml.Loader) - return sigs - - -def get_spec(pkg, specfile): - url = specfile_url_template.format(package=pkg, specfile=specfile) - req = urllib.request.Request(url=url, headers=headers) - u = urllib.request.urlopen(req) - return u.read().decode("utf-8") - - -def get_spec_exception(): - req = urllib.request.Request(url=specfile_exception_url, headers=headers) - u = urllib.request.urlopen(req) - exps = yaml.load(u.read().decode("utf-8"), Loader=yaml.Loader) - return exps - - -def get_manager_sig(pkg): - sis_load = get_sigs() - for sig in sis_load["sigs"]: - for repo in sig["repositories"]: - if repo == "src-openeuler/"+pkg: - return sig["name"] - - -def get_sig_owners(sig_name): - url = sigs_owner_url_template.format(signame=sig_name) - r = get_gitee(url) - owners = yaml.load(r, Loader=yaml.Loader) - return owners["maintainers"] - - -if __name__ == "__main__": - - parser = argparse.ArgumentParser() - parser.add_argument("pkg", type=str, help="The Package to be Queried") - args = parser.parse_args() - - s = get_manager_sig(args.pkg) - o = get_sig_owners(s) - print("SIG Owner:") - for owner in o: - print("\t"+owner) - - exp = get_spec_exception() - if args.pkg in exp: - dir_name = exp[args.pkg]["dir"] - file_name = exp[args.pkg]["file"] - specurl = specfile_url_template.format(package=args.pkg, specfile=dir_name + "/" + file_name) - else: - specurl = specfile_url_template.format(package=args.pkg, specfile=args.pkg+".spec") - - spec = get_gitee(specurl) - - in_changelog = False - emails = set() - for line in spec.splitlines(): - if line.startswith("%changelog"): - in_changelog = True - if line.startswith("*") and in_changelog: - m = re.match(r".*\d\d\d\d (.*) .*", line) - if m is None: - emails.add(line) - else: - n = m[1].split("<") - if len(n) == 1: - emails.add(n[0]) - else: - emails.add(n[0].strip() + " <" + n[1].strip()) - - print("Package Contributor:") - for email in emails: - print("\t"+email) -- Gitee From dc102a5c09be29ed07732b99b76affb62f33d0c7 Mon Sep 17 00:00:00 2001 From: Shinwell Hu Date: Mon, 15 Jun 2020 03:08:46 +0000 Subject: [PATCH 5/9] move legacy tools into seperate directory --- {advisors/packager => legacy}/python-packager.py | 0 {advisors => legacy}/who_maintain.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {advisors/packager => legacy}/python-packager.py (100%) rename {advisors => legacy}/who_maintain.py (100%) diff --git a/advisors/packager/python-packager.py b/legacy/python-packager.py similarity index 100% rename from advisors/packager/python-packager.py rename to legacy/python-packager.py diff --git a/advisors/who_maintain.py b/legacy/who_maintain.py similarity index 100% rename from advisors/who_maintain.py rename to legacy/who_maintain.py -- Gitee From e43e7be26f4d214ac00656de2fbd4855b384050a Mon Sep 17 00:00:00 2001 From: Shinwell Hu Date: Mon, 15 Jun 2020 09:06:56 +0000 Subject: [PATCH 6/9] remove global variable --- advisors/create_repo_with_srpm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/advisors/create_repo_with_srpm b/advisors/create_repo_with_srpm index 5e980d12..1eccf872 100755 --- a/advisors/create_repo_with_srpm +++ b/advisors/create_repo_with_srpm @@ -9,9 +9,8 @@ import sys from os import path import subprocess -nr = {} - def get_info(pkg): + nr = {} proc = subprocess.Popen(["rpm", "-qpi", pkg], stdout=subprocess.PIPE) while (True): line = proc.stdout.readline() @@ -36,7 +35,7 @@ def get_info(pkg): proc.stdout.close() proc.wait() - return len(nr) + return nr if __name__ == "__main__": par = argparse.ArgumentParser() @@ -47,10 +46,11 @@ if __name__ == "__main__": args = par.parse_args() + nr = {} if (path.exists(args.pkg) and path.isfile(args.pkg)): - ret = get_info(args.pkg) - if (ret < 3): - print("Somthing is wrong\n") + nr = get_info(args.pkg) + if (len(nr) < 3): + print("Failed to parse the output of rpm -qpi {pkg}".format(pkg=args.pkg)) sys.exit(1) else: print("%s does not exist\n" & args.pkg) @@ -96,10 +96,10 @@ if __name__ == "__main__": if valid_sig: f = open(args.repo, "w") - yaml.dump(repo, f) + yaml.dump(repo, f, sort_keys=False) f.close() f = open(args.sigs, "w") - yaml.dump(sigs, f) + yaml.dump(sigs, f, sort_keys=False) f.close() else: print("SIG name is not valid") -- Gitee From e6ff733fe8865de5e197318e724cdcfe19772d90 Mon Sep 17 00:00:00 2001 From: Shinwell Hu Date: Tue, 16 Jun 2020 07:08:50 +0000 Subject: [PATCH 7/9] rewrite check_missing_specs in python3 --- advisors/check_missing_specs.py | 71 +++++++++++++++++++++++++++++++++ advisors/check_missing_specs.rb | 48 ---------------------- 2 files changed, 71 insertions(+), 48 deletions(-) create mode 100755 advisors/check_missing_specs.py delete mode 100755 advisors/check_missing_specs.rb diff --git a/advisors/check_missing_specs.py b/advisors/check_missing_specs.py new file mode 100755 index 00000000..90e9885a --- /dev/null +++ b/advisors/check_missing_specs.py @@ -0,0 +1,71 @@ +#!/usr/bin/python3 + +import argparse +import gitee +import urllib.error +from datetime import datetime + +new_issue_body = """Dear {repo} maintainer: +亲爱的 {repo} 维护者: + +We found there is no spec file in this repository's master branch yet. +我们发现这个代码仓 master branch 中没有 spec 文件。 + +Missing spec file implies that this components will not be integtaed into latest openEuler release, and your hardworking cannot help others. +缺少 spec 文件意味着这个项目还不能被集成到 openEuler 项目中,而您的贡献还不能帮助到社区中的其他人。 + +We courage you submit your spec file into this repository as soon as possible. +我们鼓励您尽快提交 spec 文件到这个代码仓中. + +This is a automatic advise from openEuler-Advisor. If you think the advise is not correct, please fill an issue at https://gitee.com/openeuler/openEuler-Advisor to help us improve. +这是一条由 openEuler-Advisor 自动生成的建议。如果您认为这个建议不对,请访问 https://gitee.com/openeuler/openEuler-Advisor 来帮助我们改进。 + +Yours openEuler Advisor. +""" + +new_comment = """Dear {repo} maintainer: + +We found this issue has been open for {days} days. + +If you have any problems to implement it, please let the community known. + +We'll try to help. + +This is a automatic advise from openEuler-Advisor. If you think the advise is not correct, please fill an issue at https://gitee.com/openeuler/openEuler-Advisor to help us imporove. + +Yours openEuler Advisor. +""" + +if __name__ == "__main__": + pars = argparse.ArgumentParser() + pars.add_argument("repo", type=str, help="Repo to be checked") + pars.add_argument("-p", "--push", help="Push the advise to gitee.com/src-openeuler", action="store_true") + + args = pars.parse_args() + + my_gitee = gitee.Gitee() + try: + spec_string = my_gitee.get_spec(args.repo) + except urllib.error.HTTPError: + spec_string = "" + + if spec_string == "": + print("no spec file found for {repo} project".format(repo=args.repo)) + if args.push: + issues = my_gitee.get_issues(args.repo) + for issue in issues: + if issue["title"] == "Submit spec file into this repository": + ages = datetime.now() - my_gitee.get_gitee_datetime(issue["created_at"]) + print("Advise has been issues %d days ago"%ages.days) + my_gitee.post_issue_comment(args.repo, issue["number"], + new_comment.format(repo=args.repo, days=ages.days)) + break + else: + my_gitee.post_issue(args.repo, + "Submit spec file into this repository", + new_issue_body.format(repo=args.repo)) + else: + print("Keep this between us.") + else: + print("Everything's fine") + diff --git a/advisors/check_missing_specs.rb b/advisors/check_missing_specs.rb deleted file mode 100755 index d8ca43d8..00000000 --- a/advisors/check_missing_specs.rb +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/ruby - -require 'yaml' -require 'set' -require 'optparse' - -require './helper/download_spec' -require './gitee/advisor' - -options = {} -OptionParser.new do |opts| - opts.banner = "Usage: check_missing_spec.rb [options]" - opts.on("-p", "--push", "Push the advise to gitee.com/src-openeuler") do |v| - options[:push] = v - end - opts.on("-r", "--repo REPO_NAME", "Repo to check upstream info") do |n| - puts "Checking #{n}" - options[:repo] = n - end - opts.on("-h", "--help", "Prints this help") do - puts opts - exit - end -end.parse! - -if not options[:repo] then - puts "Missing repo name\n" - exit 1 -end - -specfile = download_spec(options[:repo]) - -if specfile == "" then - puts "no spec file found for #{options[:repo]} project\n" - if options[:push] then - puts "Push this advise to gitee\n" - ad = Advisor.new - ad.new_issue("src-openeuler", options[:repo], - "Submit spec file into this repository", - "Dear #{options[:repo]} maintainer:\n亲爱的 #{options[:repo]} 维护者:\n\n We found there is no spec file in this repository yet.\n我们发现这个代码仓中没有 spec 文件。\n\n Missing spec file implies that this components will not be integtaed into openEuler release, and your hardworking cannot help others.\n缺少 spec 文件意味着这个项目还不能被集成到 openEuler 项目中,而您的贡献还不能帮助到社区中的其他人。\n\n We courage you submit your spec file into this repository as soon as possible.\n我们鼓励您尽快提交 spec 文件到这个代码仓中\n\n This is a automatic advise from openEuler-Advisor. If you think the advise is not correct, please fill an issue at https\:\/\/gitee.com\/openeuler\/openEuler-Advisor to help us improve.\n这是一条由 openEuler-Advisor 自动生成的建议。如果您认为这个建议不对,请访问 https\:\/\/gitee.com\/openeuler\/openEuler-Advisor 来帮助我们改进。\n\n Yours openEuler Advisor.") - else - puts "Keep it between us\n" - end -else - puts "Everything's fine\n" -end - -File.delete(specfile) if specfile != "" -- Gitee From d6f9e94683cfe7ccb5e9bd365adc69326e7f5e32 Mon Sep 17 00:00:00 2001 From: Shinwell Hu Date: Tue, 16 Jun 2020 07:30:54 +0000 Subject: [PATCH 8/9] fix lint --- advisors/check_missing_specs.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/advisors/check_missing_specs.py b/advisors/check_missing_specs.py index 90e9885a..42202a02 100755 --- a/advisors/check_missing_specs.py +++ b/advisors/check_missing_specs.py @@ -1,4 +1,8 @@ #!/usr/bin/python3 +""" +This is a simple script to check if SPEC already been submit into repository. +If not, it can be used to push an issue to remind the developer. +""" import argparse import gitee @@ -56,9 +60,13 @@ if __name__ == "__main__": for issue in issues: if issue["title"] == "Submit spec file into this repository": ages = datetime.now() - my_gitee.get_gitee_datetime(issue["created_at"]) - print("Advise has been issues %d days ago"%ages.days) - my_gitee.post_issue_comment(args.repo, issue["number"], - new_comment.format(repo=args.repo, days=ages.days)) + if ages.days <= 10: + print("Advise has been issues only %d days ago" % ages.days) + print("Give developers more time to handle it.") + break + else: + my_gitee.post_issue_comment(args.repo, issue["number"], + new_comment.format(repo=args.repo, days=ages.days)) break else: my_gitee.post_issue(args.repo, -- Gitee From b20a499b29a27bc5b8bf8b121b2cff067549c165 Mon Sep 17 00:00:00 2001 From: Shinwell Hu Date: Wed, 17 Jun 2020 04:05:07 +0000 Subject: [PATCH 9/9] update gitee.py for compatibility issue --- advisors/gitee.py | 48 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/advisors/gitee.py b/advisors/gitee.py index 455fb052..5e24a7c5 100755 --- a/advisors/gitee.py +++ b/advisors/gitee.py @@ -13,6 +13,7 @@ import re import os.path import json import pprint +from datetime import datetime class Gitee(object): @@ -33,6 +34,7 @@ class Gitee(object): self.advisor_url_template = self.advisor_url + "upstream-info/{package}.yaml" #self.specfile_exception_url = "https://gitee.com/openeuler/openEuler-Advisor/raw/master/helper/specfile_exceptions.yaml" self.specfile_exception_url = self.advisor_url + "helper/specfile_exceptions.yaml" + self.time_format = "%Y-%m-%dT%H:%M:%S%z" def post_gitee(self, url, values, headers=None): """ @@ -96,8 +98,8 @@ Yours openEuler-Advisor. """ get and load gitee json response """ - #headers = self.headers.copy() - headers = {} + headers = self.headers.copy() + #headers = {} headers["Content-Type"] = "application/json;charset=UTF-8" resp = self.get_gitee(url, headers) return json.loads(resp) @@ -140,6 +142,48 @@ Yours openEuler-Advisor. return resp else: return False + + def get_issues(self, pkg, prj="src-openeuler"): + """ + List all open issues of pkg + """ + issues_url = "https://gitee.com/api/v5/repos/{prj}/{pkg}/issues?".format(prj=prj, pkg=pkg) + #parameters = "access_token={token}&state=open&sort=created&derection=desc&creator=" + self.token["user"] + parameters = "state=open&sort=created&direction=desc&page=1&per_page=20" + return self.get_gitee_json(issues_url + parameters) + + def get_issue_comments(self, pkg, number, prj="src-openeuler"): + """ + Get comments of specific issue + """ + issues_url = "https://gitee.com/api/v5/repos/{prj}/{pkg}/issues?".format(prj=prj, pkg=pkg) + parameters = "number={num}&page=1&per_page=20&order=asc" + return self.get_gitee_json(issues_url + parameters) + + def post_issue(self, pkg, title, body, prj="src-openeuler"): + """ + Post new issue + """ + issues_url = "https://gitee.com/api/v5/repos/{prj}/issues".format(prj=prj) + parameters = {} + parameters["access_token"] = self.token["access_token"] + parameters["repo"] = pkg + parameters["title"] = title + parameters["body"] = body + self.post_gitee(issues_url, parameters) + + def post_issue_comment(self, pkg, number, comment, prj="src-openeuler"): + issues_url = "https://gitee.com/api/v5/repos/{prj}/{pkg}/issues/{number}/comments".format( + prj=prj, pkg=pkg, number=number) + parameters = {} + parameters["access_token"] = self.token["access_token"] + parameters["body"] = comment + self.post_gitee(issues_url, parameters) + + def get_gitee_datetime(self, time_string): + result = datetime.strptime(time_string, self.time_format) + return result.replace(tzinfo=None) + if __name__ == "__main__": pass -- Gitee