diff --git a/packageship/packageship/pkgship b/packageship/packageship/pkgship new file mode 100644 index 0000000000000000000000000000000000000000..9a3fe909b82d9c298e6508b36e0c83f81f02f603 --- /dev/null +++ b/packageship/packageship/pkgship @@ -0,0 +1,16 @@ +#!/usr/bin/python3 +import sys +import signal +try: + def sig_handler(signum, frame): + print('Exit command mode') + sys.exit(0) + signal.signal(signal.SIGINT, sig_handler) +except: + pass + +from packageship.pkgship import main + + +if __name__ == '__main__': + main() diff --git a/packageship/packageship/pkgship.py b/packageship/packageship/pkgship.py index 8da7a46bdfee54d48851df7c4077faae156f9b5a..ea32b5276e37f7f2848ac4768668b000951c893e 100644 --- a/packageship/packageship/pkgship.py +++ b/packageship/packageship/pkgship.py @@ -144,9 +144,7 @@ class PkgshipCommand(BaseCommand): super(PkgshipCommand, self).__init__() self.statistics = dict() self.table = PkgshipCommand.create_table() - # Calculate the total width of the current terminal - # self.columns = int(os.popen('stty size', 'r').read().split()[1]) self.columns = 100 self.params = [] diff --git a/packageship/packageship/pkgshipd b/packageship/packageship/pkgshipd index a2e39a4f1fbbd883d272313905bbc94b47db0916..c6e742f0db3c86e1b0448b6e031cdab42163cc3b 100755 --- a/packageship/packageship/pkgshipd +++ b/packageship/packageship/pkgshipd @@ -45,6 +45,7 @@ buffer-size=$buffer_size pidfile=$OUT_PATH/manage.pid http-timeout=$http_timeout harakiri=$harakiri +enable-threads=true daemonize=$daemonize" > $OUT_PATH/manage.ini fi @@ -72,6 +73,7 @@ buffer-size=$buffer_size pidfile=$OUT_PATH/selfpkg.pid http-timeout=$http_timeout harakiri=$harakiri +enable-threads=true daemonize=$daemonize" > $OUT_PATH/selfpkg.ini fi @@ -107,8 +109,8 @@ function stop_service(){ if [ ! -n "$1" ] then - echo "Usages: sh pkgshipd.sh start|stop|restart [manage|selfpkg]" - exit 0 + echo "Usages: sh pkgshipd.sh start|stop|restart [manage|selfpkg]" + exit 0 fi if [ X$2 = X ];then @@ -154,6 +156,6 @@ elif [ $1 = restart ];then echo "===The run log is saved into: $daemonize===" else - echo "Usages: sh pkgshipd.sh start|stop|restart [manage|selfpkg]" + echo "Usages: sh pkgshipd.sh start|stop|restart [manage|selfpkg]" fi diff --git a/packageship/pkgship.spec b/packageship/pkgship.spec index f72bf57182e859a3396e873546363d50cacdc06c..2e147407b251fbae034d0fa58c9ca5f22d66e416 100644 --- a/packageship/pkgship.spec +++ b/packageship/pkgship.spec @@ -1,6 +1,6 @@ Name: pkgship -Version: 1.0.0 -Release: 7 +Version: 1.1.0 +Release: 2 Summary: Pkgship implements rpm package dependence ,maintainer, patch query and so no. License: Mulan 2.0 URL: https://gitee.com/openeuler/openEuler-Advisor @@ -10,9 +10,11 @@ BuildArch: noarch BuildRequires: python3-flask-restful python3-flask python3 python3-pyyaml python3-sqlalchemy BuildRequires: python3-prettytable python3-requests python3-flask-session python3-flask-script python3-marshmallow +BuildRequires: python3-Flask-APScheduler python3-pandas python3-retrying python3-xlrd python3-XlsxWriter Requires: python3-pip python3-flask-restful python3-flask python3 python3-pyyaml Requires: python3-sqlalchemy python3-prettytable python3-requests Requires: python3-pyinstaller python3-flask-session python3-flask-script python3-marshmallow python3-uWSGI +Requires: python3-pandas python3-dateutil python3-XlsxWriter python3-xlrd python3-Flask-APScheduler python3-retrying %description Pkgship implements rpm package dependence ,maintainer, patch query and so no. @@ -28,33 +30,17 @@ Pkgship implements rpm package dependence ,maintainer, patch query and so no. %check +# The apscheduler cannot catch the local time, so a time zone must be assigned before running the test case. +export TZ=Asia/Shanghai # change log_path to solve default log_path permission denied problem log_path=`pwd`/tmp/ sed -i "/\[LOG\]/a\log_path=$log_path" test/common_files/package.ini -%{__python3} -m unittest test/run_tests.py +%{__python3} -m unittest test/init_test.py +%{__python3} -m unittest test/read_test.py +%{__python3} -m unittest test/write_test.py rm -rf $log_path %post -#build cli bin -if [ -f "/usr/bin/pkgship" ]; then - rm -rf /usr/bin/pkgship -fi - - -cd %{python3_sitelib}/packageship/ -if [ -f "/usr/bin/pyinstaller" ]; then - /usr/bin/pyinstaller -F pkgship.py -elif [ -f "/usr/local/bin/pyinstaller" ]; then - /usr/local/bin/pyinstaller -F pkgship.py -else - echo "pkship install fail,there is no pyinstaller!" - exit -fi - -sed -i "s/hiddenimports\=\[\]/hiddenimports\=\['pkg_resources.py2_warn'\]/g" pkgship.spec -/usr/local/bin/pyinstaller pkgship.spec -cp dist/pkgship /usr/bin/ -rm -rf %{python3_sitelib}/packageship/build %{python3_sitelib}/packageship/dist %postun @@ -64,9 +50,18 @@ rm -rf %{python3_sitelib}/packageship/build %{python3_sitelib}/packageship/dist %{python3_sitelib}/* %config %{_sysconfdir}/pkgship/* %attr(0755,root,root) %{_bindir}/pkgshipd - +%attr(0755,root,root) %{_bindir}/pkgship %changelog +* Tue Sep 1 2020 Zhengtang Gong - 1.1.0-2 +- Delete the packaged form of pyinstaller and change the execution + of the command in the form of a single file as the input + +* Sat Aug 29 2020 Yiru Wang - 1.1.0-1 +- Add package management features: + RPM packages statically displayed in the version repository + RPM packages used time displayed for current version in the version repository + Issue management of packages in a version-management repository * Fri Aug 21 2020 Chengqiang Bao < baochengqiang1@huawei.com > - 1.0.0-7 - Fixed a problem with command line initialization of the Filepath parameter where relative paths are not supported and paths are too long diff --git a/packageship/setup.py b/packageship/setup.py index 08488d7d3a161ce0035034d74ffdffac6ce0f40e..346a0c62a8ccee68e48680cf0f8dbd78e18e96d4 100644 --- a/packageship/setup.py +++ b/packageship/setup.py @@ -5,8 +5,7 @@ file for software packaging """ from distutils.core import setup - -config_path = "/etc/pkgship/" # pylint: disable=invalid-name +_CONFIG_PATH = "/etc/pkgship/" setup( name='packageship', @@ -28,6 +27,7 @@ setup( 'packageship.application.apps.lifecycle.function.base', 'packageship.application.apps.lifecycle.function.download_yaml', 'packageship.application.apps.lifecycle.function.gitee', + 'packageship.application.apps.lifecycle.function.concurrent', 'packageship.application.apps.lifecycle.serialize', 'packageship.application.apps.lifecycle.url', 'packageship.application.apps.lifecycle.view', @@ -58,6 +58,6 @@ setup( long_description=open('README.md', encoding='utf-8').read(), author='gongzt', data_files=[ - (config_path, ['packageship/package.ini']), - ('/usr/bin', ['packageship/pkgshipd'])] + (_CONFIG_PATH, ['packageship/package.ini']), + ('/usr/bin', ['packageship/pkgshipd', 'packageship/pkgship'])] )