pkgship 2.1.0 移植指南(openEuler 20.03 LTS SP1)

pkgship 2.1.0 移植指南(openEuler 20.03 LTS SP1) Lixiaofeng 2023-11-26 11:19:00 299

简介

pkgship是一款管理OS软件包依赖关系,提供依赖和被依赖关系完整图谱的查询工具,pkgship提供软件包依赖查询、生命周期管理、补丁查询等功能。

选用版本:2.1.0

检查当前系统版本信息

cat /etc/os-release

兼容性检查

使用x2openEuler对工具目录中的pkgship-2.1.0 RPM包进行分析

x2openEuler scan pkgship-2.1.0-7.oe1.noarch.rpm

根据依赖报告可知,移植到openEuler 20.03-LTS-sp1需要解决不同python版本的依赖相关问题。

源码包安装

安装pkgship

[root@master ~]# yum install -y libffi-devel


[root@master ~]# vim requirements.txt

prettytable==0.7.2
Flask_RESTful==0.3.8
Flask_Session==0.3.1
Flask_Script==2.0.6
Flask_Limiter==1.4
Flask==1.1.2
marshmallow==3.5.1
PyYAML==5.3.1
gevent==20.12.1
requests==2.21.0
uwsgi==2.0.18
elasticsearch==7.10.1
redis==3.5.3
retrying==1.3.3

[root@master ~]# pip3 install -r requirements.txt
  • 配置yum源
[root@master ~]# cd /etc/yum.repos.d/
[root@master yum.repos.d]# vim openEuler.repo
[openeuler]
name=openEuler-21.03
baseurl=http://119.3.219.20:82/openEuler:/21.03/standard_aarch64/
enabled=1
gpgcheck=0


[fedora]
name=fedora
baseurl=https://mirrors.huaweicloud.com/fedora/releases/30/Everything/aarch64/os/
enabled=0
gpgcheck=0

[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
  • 获取源码包

从 https://gitee.com/src-openeuler/pkgship?_from=gitee_search 获取pkgship-2.1.0.tar.gz源码包。

  • 解压源码包
tar -xzvf pkgship-2.1.0.tar.gz
  • 修改部分源码文件

进入解压后的源码目录,修改源码路径下

./packageship/application/query/pkg.py
./packageship/application/query/depend.py

这两个文件中第19行的monkey.patch_all()为monkey.patch_all(thread=False, ssl=False)

进入源码目录的packageship目录下创建一个version.yaml文件,文件内容为

Version: 2.1.0
Release: 7.oe1

避免安装时因为缺少文件报如下错误

installing package data to build/bdist.linux-x86_64/egg
running install_data
creating /etc/pkgship
copying packageship/package.ini -> /etc/pkgship/
copying conf.yaml -> /etc/pkgship/
copying packageship/auto_install_pkgship_requires.sh -> /etc/pkgship/
copying packageship/uwsgi_logrotate.sh -> /etc/pkgship/
copying packageship/pkgshipd -> /usr/bin
copying packageship/pkgship -> /usr/bin
copying packageship/pkgship.service -> /lib/systemd/system/
copying packageship/application/common/rsp/mapping.xml -> build/bdist.linux-x86_64/egg/packageship/application/common/rsp
error: can't copy 'packageship/version.yaml': doesn't exist or not a regular file
  • 安装pkgship

进入pkgship主目录,开始使用setup.py脚本安装pkgship、

[root@localhost ~]# python3 --version
Python 3.7.9
[root@localhost ~]# python3 setup.py install
  • 成功安装
Processing packageship-2.1.0-py3.7.egg
creating /usr/local/lib/python3.7/site-packages/packageship-2.1.0-py3.7.egg
Extracting packageship-2.1.0-py3.7.egg to /usr/local/lib/python3.7/site-packages
Adding packageship 2.1.0 to easy-install.pth file

Installed /usr/local/lib/python3.7/site-packages/packageship-2.1.0-py3.7.egg
Processing dependencies for packageship==2.1.0
Finished processing dependencies for packageship==2.1.0

[root@localhost pkgship-2.1.0]# pip3 list | grep packageship
packageship                   2.1.0
[root@localhost pkgship-2.1.0]# pkgship
usage: pkgship [-h] [-v] [-remote]
               {init,list,builddep,installdep,selfdepend,bedepend,pkginfo,dbs}
               ...

package related dependency management

positional arguments:
  {init,list,builddep,installdep,selfdepend,bedepend,pkginfo,dbs}
                        package related dependency management
    init                initialization of the database
    list                get all package data
    builddep            query the compilation dependencies of the specified
                        package
    installdep          query the installation dependencies of the specified
                        package
    selfdepend          query the self-compiled dependencies of the specified
                        package
    bedepend            dependency query for the specified package
    pkginfo             query the information of a single package
    dbs                 Get all data bases

optional arguments:
  -h, --help            show this help message and exit
  -v                    Get version information
  -remote               The address of the remote service


声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包 点赞 收藏 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
Lixiaofeng
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区