日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python使用pkg包_Python deb-pkg-tools包_程序模块 - PyPI - Python中文网

發布時間:2025/3/12 python 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python使用pkg包_Python deb-pkg-tools包_程序模块 - PyPI - Python中文网 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

python包deb-pkg-tools是要構建和

檢查Debian binary packages和二進制包的存儲庫。它的

主要用例是自動化構建。

一些功能在命令行界面中公開(如下所述)

因為在shell腳本中使用非常方便,而其他功能

將用作python api。包當前在cpython上測試

2.6、2.7、3.4、3.5、3.6、3.7和Pypy(2.7)。

請注意,deb-pkg-tools對于debian二進制文件的

應該構建包,并將其中的一些觀點強加于用戶。

使用可選的函數參數和/或環境可以避免大多數情況

變量。如果你發現了一些不符合你喜歡的東西而你不能

解決這個問題,可以隨意要求額外的配置選項;我嘗試

對我的項目的可能用例保持開放的心態。

一方面,deb-pkg-tools包是基于我在

Debian包和存儲庫在過去幾年中

handdeb-pkg-tools本身還很年輕。同樣,大多數功能是

由自動化測試覆蓋;編寫時覆蓋率約為90%(有些

如果我們還想測試

非錯誤情況,這當然是主要焦點:—)

deb-pkg-tools包在PyPI上可用,這意味著安裝

應該簡單到:$ pip install deb-pkg-tools

實際上,安裝python包的方法有很多(例如,per

user site-packages directory,virtual environments),或者只是安裝

我不打算在這里討論,所以

如果這讓你感到害怕,那么在回到這些之前,先閱讀一下你的選項

說明;-)。

在hood下deb-pkg-tools使用Debian提供的幾個程序

有關詳細信息,請參見dependencies部分。要安裝這些程序:$ sudo apt-get install dpkg-dev fakeroot lintian

有兩種方法可以使用deb-pkg-tools包:作為命令行

程序和作為python api。有關python api的詳細信息,請參閱

在Read the Docs上提供的api文檔。命令行界面

如下所述。

用法:deb-pkg-tools [OPTIONS] ...

deb pkg tools python項目的包裝器,該項目實現了

檢查、構建和操作Debian二進制包檔案和相關的

像普通存儲庫這樣的實體。

支持的選項:OptionDescription^{tt9}$, ^{tt10}$Inspect the metadata in the Debian binary package archive given by ^{tt11}$

(similar to “dpkg ^{tt12}$”).

^{tt13}$, ^{tt14}$Copy the package archive(s) given as positional arguments (and all package

archives required by the given package archives) into the directory given

by ^{tt15}$.

^{tt16}$, ^{tt17}$Perform static analysis on a package archive and its dependencies in order

to recognize common errors as soon as possible.

^{tt18}$, ^{tt19}$Patch fields into the existing control file given by ^{tt11}$. To be used

together with the ^{tt21}$, ^{tt22}$ option.

^{tt21}$, ^{tt24}$A line to patch into the control file (syntax: “Name: Value”). To be used

together with the ^{tt18}$, ^{tt26}$ option.

^{tt27}$, ^{tt28}$Build a Debian binary package with “dpkg-deb ^{tt29}$” (and lots of

intermediate Python magic, refer to the API documentation of the project

for full details) based on the binary package template in the directory

given by ^{tt15}$. The resulting archive is located in the system wide

temporary directory (usually /tmp).

^{tt31}$, ^{tt32}$Create or update the trivial Debian binary package repository in the

directory given by ^{tt15}$.

^{tt34}$, ^{tt35}$Enable “apt-get” to install packages from the trivial repository (requires

root/sudo privilege) in the directory given by ^{tt15}$. Alternatively you can

use the ^{tt37}$, ^{tt38}$ option.

^{tt39}$, ^{tt40}$Cleans up after ^{tt41}$ (requires root/sudo privilege).

Alternatively you can use the ^{tt37}$, ^{tt38}$ option.

^{tt37}$, ^{tt45}$Create or update a trivial package repository, activate the repository, run

the positional arguments as an external command (usually “apt-get install”)

and finally deactivate the repository.

^{tt46}$, ^{tt47}$Force removal of stale entries from the persistent (on disk) package

metadata cache. Garbage collection is performed automatically by the

deb-pkg-tools command line interface when the last garbage collection

cycle was more than 24 hours ago, so you only need to do it manually

when you want to control when it happens (for example by a daily

cron job scheduled during idle hours :-).

^{tt48}$, ^{tt49}$Assume the answer to interactive questions is yes.

^{tt50}$, ^{tt51}$Make more noise! (useful during debugging)

^{tt52}$, ^{tt53}$Show this message and exit.

需要注意的一點是deb-pkg-tools--update-repocan的操作

受配置文件的影響。有關詳細信息,請參閱

關于deb_pkg_tools.repo.select_gpg_key()的文檔。

deb-pkg-tools需要以下外部程序(取決于

您當然要使用哪些功能:ProgramPackage^{tt56}$^{tt57}$

^{tt58}$^{tt59}$

^{tt60}$^{tt61}$

^{tt62}$^{tt63}$

^{tt64}$^{tt65}$

^{tt66}$^{tt61}$

^{tt68}$^{tt68}$

^{tt70}$^{tt71}$

^{tt72}$^{tt72}$

^{tt74}$^{tt74}$

這些程序/包中的大多數已經安裝在

基于Debian的系統,因此您只需要以下內容即可開始:$ sudo apt-get install dpkg-dev fakeroot lintian

如果環境變量不起作用,可以通過它們來調整一些東西

你的系統或平臺。例如,在mac os x上,cp命令沒有

有一個^ {tt77 } $參數,^ {tt78} $用戶和組可能不存在,但

盡管如此,在mac os上測試包構建仍然是有用的。

x.以下環境變量可用于調整這些因素:VariableDefaultDescription^{tt79}$^{tt80}$Normalize ownership of files

during packaging.

^{tt81}$^{tt78}$During package builds the

ownership of all directories and

files is reset to this user.

^{tt83}$^{tt78}$During package builds the

ownership of all directories and

files is reset to this group.

^{tt85}$^{tt80}$Reset sticky bit on directories

inside package templates before

building.

^{tt87}$^{tt80}$Run commands using either

fakeroot or sudo (depending on

which is available).

^{tt89}$^{tt80}$Enable the usage of ^{tt91}$

during operations that normally

require elevated privileges.

^{tt92}$^{tt80}$Allow the usage of hard links to

speed up file copies between

directories on the same file

system.

^{tt94}$^{tt95}$Force the system to generate

entropy based on disk I/O.

^{tt96}$^{tt97}$Shell to use for the

^{tt98}$

command.

布爾選項的環境變量支持字符串yes,

true、1、no、false和0(忽略大小寫)。

要禁用sudo的任何使用,可以使用以下命令:exportDPT_ALLOW_FAKEROOT_OR_SUDO=falseexportDPT_CHOWN_FILES=falseexportDPT_RESET_SETGID=falseexportDPT_SUDO=false

最新版本的deb-pkg-tools可在PyPI和GitHub上獲得。這個

文檔托管在Read the Docs。對于錯誤報告,請創建

關于GitHub的問題。如果你有問題、建議等,請隨時寄給我

位于peter@peterodding.com的電子郵件。

版權所有?2018彼得·奧丁。

歡迎加入QQ群-->: 979659372

推薦PyPI第三方庫

總結

以上是生活随笔為你收集整理的python使用pkg包_Python deb-pkg-tools包_程序模块 - PyPI - Python中文网的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。