diff --git a/sig/test/src-oepkgs/b/bash-completion-extras.yaml b/sig/test/src-oepkgs/b/bash-completion-extras.yaml new file mode 100644 index 0000000000000000000000000000000000000000..94e5f009266bcaedade71d3f7c83015bd46c7cc9 --- /dev/null +++ b/sig/test/src-oepkgs/b/bash-completion-extras.yaml @@ -0,0 +1,13 @@ +name: bash-completion-extras +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/bash-completion-extras +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/e/elementary-theme.yaml b/sig/test/src-oepkgs/e/elementary-theme.yaml new file mode 100644 index 0000000000000000000000000000000000000000..33a168725acbe6cf9e4b974ae76d36da999a2ff3 --- /dev/null +++ b/sig/test/src-oepkgs/e/elementary-theme.yaml @@ -0,0 +1,13 @@ +name: elementary-theme +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/elementary-theme +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/l/lcov.yaml b/sig/test/src-oepkgs/l/lcov.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6dbd35a94e08061cc4b8b19f6b351edd8bfde724 --- /dev/null +++ b/sig/test/src-oepkgs/l/lcov.yaml @@ -0,0 +1,13 @@ +name: lcov +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/lcov +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/l/lxqt-desktop.yaml b/sig/test/src-oepkgs/l/lxqt-desktop.yaml new file mode 100644 index 0000000000000000000000000000000000000000..005e71fa60413e8c11a75ed0a90e6c240197b42c --- /dev/null +++ b/sig/test/src-oepkgs/l/lxqt-desktop.yaml @@ -0,0 +1,13 @@ +name: lxqt-desktop +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/lxqt-desktop +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/n/nuget.yaml b/sig/test/src-oepkgs/n/nuget.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fd59a445fb04bba19e9d1f8f17453c9a97a0a705 --- /dev/null +++ b/sig/test/src-oepkgs/n/nuget.yaml @@ -0,0 +1,13 @@ +name: nuget +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/nuget +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/o/openssl.yaml b/sig/test/src-oepkgs/o/openssl.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4732c4cb4433d740fa9072cbf4a77580dbee4c34 --- /dev/null +++ b/sig/test/src-oepkgs/o/openssl.yaml @@ -0,0 +1,13 @@ +name: openssl +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/openssl +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/p/pantheon-session-settings.yaml b/sig/test/src-oepkgs/p/pantheon-session-settings.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3bf3885a19b05531674a684957e2d3e322c783ad --- /dev/null +++ b/sig/test/src-oepkgs/p/pantheon-session-settings.yaml @@ -0,0 +1,13 @@ +name: pantheon-session-settings +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/pantheon-session-settings +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/p/perl-AnyEvent-I3.yaml b/sig/test/src-oepkgs/p/perl-AnyEvent-I3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..419348eeed12fc4b3cf26a1300ba5a4ba923447f --- /dev/null +++ b/sig/test/src-oepkgs/p/perl-AnyEvent-I3.yaml @@ -0,0 +1,13 @@ +name: perl-AnyEvent-I3 +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/perl-AnyEvent-I3 +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/r/raven-release.yaml b/sig/test/src-oepkgs/r/raven-release.yaml new file mode 100644 index 0000000000000000000000000000000000000000..630911028f2a76e06b53c1c1def22b8ae7684ef6 --- /dev/null +++ b/sig/test/src-oepkgs/r/raven-release.yaml @@ -0,0 +1,13 @@ +name: raven-release +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/raven-release +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/test/src-oepkgs/z/zabbix.yaml b/sig/test/src-oepkgs/z/zabbix.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cedb156f3b882aafe95e89afa2edc1d8c43425f5 --- /dev/null +++ b/sig/test/src-oepkgs/z/zabbix.yaml @@ -0,0 +1,13 @@ +name: zabbix +description: "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation" +upstream: https://gitee.com/src-oepkgs/zabbix +branches: +- name: master + type: protected +- name: openEuler-20.03-LTS-SP3 + type: protected + create_from: master +- name: openEuler-22.03-LTS + type: protected + create_from: master +type: public diff --git a/sig/virtual/test.sh b/sig/virtual/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..2f7ac99140ae6f978d5fbd7bcf17eb06203bea5d --- /dev/null +++ b/sig/virtual/test.sh @@ -0,0 +1 @@ +curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/zhang-yn/oepkgs-management/contents/sig%2Fvirtual%2Ftest.yaml' -d '{"access_token":"503d50ea9ce9226bc3647f29e2836a49","content":b'bmFtZTogezB9DQpkZXNjcmlwdGlvbjogIlFFTVUgaXMgYSBnZW5lcmljIGFuZCBvcGVuIHNvdXJjZSBwcm9jZXNzb3IgZW11bGF0b3Igd2hpY2ggYWNoaWV2ZXMgYSBnb29kIGVtdWxhdGlvbiBzcGVlZCBieSB1c2luZyBkeW5hbWljIHRyYW5zbGF0aW9uIg0KdXBzdHJlYW06IGh0dHBzOi8vZ2l0ZWUuY29tL3NyYy1vZXBrZ3MvezB9DQpicmFuY2hlczoNCi0gbmFtZTogbWFzdGVyDQogIHR5cGU6IHByb3RlY3RlZA0KLSBuYW1lOiBvcGVuRXVsZXItMjAuMDMtTFRTLVNQMw0KICB0eXBlOiBwcm90ZWN0ZWQNCiAgY3JlYXRlX2Zyb206IG1hc3Rlcg0KLSBuYW1lOiBvcGVuRXVsZXItMjIuMDMtTFRTDQogIHR5cGU6IHByb3RlY3RlZA0KICBjcmVhdGVfZnJvbTogbWFzdGVyDQp0eXBlOiBwdWJsaWM=',"message":"test"}' \ No newline at end of file diff --git a/test.py b/test.py new file mode 100644 index 0000000000000000000000000000000000000000..8c3c63fafad0bf51637c4c9245c9e7ac4a39340a --- /dev/null +++ b/test.py @@ -0,0 +1,82 @@ +import base64 + +# # a = os.path.split("/srv/rpm/testing/openeuler-22.03.LTS") +# a = os.walk("/srv/rpm/testing/openeuler-22.03.LTS") +# print(a) + +import os +import sys + +import yaml + +allFileNum = 0 +allFileList = [] # 存放 当前路径 以及当前路径的子路径 下的所有文件 + +# allFilePathNum = 0 +# allFilePathList = [] + + +def getAllFilesInPath(path): + global allFileNum + curPathDirList = [] # 当前路径下的所有文件夹 + files = os.listdir(path) # 返回当前路径下的所有文件和文件夹 + for f in files: + if os.path.isdir(path + "/" + f): + if f[0] == ".": + pass # 排除隐藏文件夹 + else: + curPathDirList.append(f) # 添加非隐藏文件夹 + if os.path.isfile(path + "/" + f): + # absPath = os.path.abspath(f) + if f[-8:] == ".src.rpm": + allFileList.append(path + "/" + f) # 添加文件 + allFileNum = allFileNum + 1 # 总文件数+1 + # allFilePathList.append(path + "/" + f) + # allFilePathNum = allFilePathNum + 1 + # comparePackageName(f) + for dl in curPathDirList: + getAllFilesInPath(path + "/" + dl) # 递归获取当前目录下的文件夹内的文件 + + +# def comparePackageName(f): +# absPath = os.path.abspath(f) +# print(absPath) + +def base64_encode(path, module_name, sig_name): + with open(r"{}".format(path), 'r', encoding='utf-8') as f: + config = yaml.load(f.read(), Loader=yaml.FullLoader) + encode_str = base64.b64encode(config.format(module_name, sig_name)) + if not sig_name: + os.system("curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/zhang-yn/oepkgs-management/contents/sig%2F{}%2Fsrc-oepkgs%2F{}%2F{}.yaml' -d '{{\"access_token\":\"abe38dd66124adad56137df3943c8dc5\",\"content\":{},\"message\":\"test\"}}'".format("others", module_name[0], module_name, encode_str)) + else: + os.system("curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/zhang-yn/oepkgs-management/contents/sig%2F{}%2F{}.yaml' -d '{{\"access_token\":\"abe38dd66124adad56137df3943c8dc5\",\"content\":{},\"message\":\"test\"}}'".format(sig_name, "sig-info", encode_str)) + + +if __name__ == '__main__': + getAllFilesInPath("/srv/rpm/testing/openeuler-22.03.LTS") + print("当前路径下的总文件数 =", allFileNum) + print(allFileList) + for rpm_path in allFileList: + rpm_file = rpm_path.split("/")[-1] + module_name = "-".join(rpm_file.split("-")[:-2]) + base64_encode("../", module_name, None) + base64_encode("../", module_name, "others") + # with open(r"../qemu.yaml", 'r', encoding='utf-8') as f: + # config = yaml.load(f.read(), Loader=yaml.FullLoader) + # # config.format(module_name) + # with open(r"../{}.yaml".format(module_name), 'r', encoding='utf-8') as f1: + # yaml.dump(config.format(module_name), f1) + # with open(r"../sig-info.yaml", 'r', encoding='utf-8') as sig_f: + # sig_config = yaml.load(sig_f.read(), Loader=yaml.FullLoader) + # # sig_config.format(module_name, "others") + # with open(r"../sig-info.yaml", 'r', encoding='utf-8') as f2: + # yaml.dump(sig_config.format(module_name), f2) + # 创建pr + os.system("curl - X POST - -header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/oepkgs/oepkgs-management/pulls' - d '{{\"access_token\":\"abe38dd66124adad56137df3943c8dc5\",\"title\":\"自动化创建库\",\"head\":\"zhang-yn:master\",\"base\":\"master\"}}'") + for rpm_path in allFileList: + rpm_file = rpm_path.split("/")[-1] + module_name = "-".join(rpm_file.split("-")[:-2]) + os.system("curl -X POST --header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/src-oepkgs/{}/forks' -d '{{\"access_token\":\"abe38dd66124adad56137df3943c8dc5\"}}'".format("module_name")) + os.system("rpm2cpio rpm_path | cpio -div") + os.system("git clone 'https://gitee.com/zhang-yn/{0}.git';cd {0};cp -rf *.spec ./;cp -rf *.tar.gz ./;git add .;git commit -m '合入';git push;cd -".format(module_name)) + os.system("curl - X POST - -header 'Content-Type: application/json;charset=UTF-8' 'https://gitee.com/api/v5/repos/oepkgs/oepkgs-management/pulls' - d '{{\"access_token\":\"abe38dd66124adad56137df3943c8dc5\",\"title\":\"自动化创建库\",\"head\":\"zhang-yn:master\",\"base\":\"master\"}}'")