提交 df1b3e08 编写于 作者: G gongzt

删除pyinstaller打包的形式,更改为以单文件为入口来执行命令行

上级 d472f62d
#!/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()
......@@ -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 = []
......
......@@ -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
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 <gongzhengtang@huawei.com> - 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 <wangyiru1@huawei.com> - 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
......
......@@ -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'])]
)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册