从 Debian 下载时有没有办法查询源文件的大小?

从 Debian 下载时有没有办法查询源文件的大小?

当我们跑步时aptapt-get或者我们总是知道它的孩子aptitude需要多少空间(当然除外)。//home/$username

现在,当我们(在用户空间中)执行操作时,apt-get source在下载源文件之前无法知道源文件的大小,以免遇到任何最后一刻的意外。

我想分享一个真实的例子来描述这个问题。

二进制未知地平线未压缩时大约为 305 MB -

[$] aptitude show unknown-horizons

Package: unknown-horizons                
Version: 2014.1+git160920-1
State: installed
Automatically installed: no
Priority: optional
Section: games
Maintainer: Debian Games Team <[email protected]>
Architecture: all
Uncompressed Size: 305 M
Depends: ttf-unifont, python, python-enet, python-fife (>= 0.3.5+git160920), python-yaml, python:any (< 2.8), python:any (>= 2.7.5-5~)
Description: 2D realtime strategy simulation
 Unknown Horizons is a 2D realtime strategy simulation with an emphasis on economy and city building. Expand your small settlement to a strong
 and wealthy colony, collect taxes and supply your inhabitants with valuable goods. Increase your power with a well balanced economy and with
 strategic trade and diplomacy.
Homepage: http://www.unknown-horizons.org

现在,如果我要下载源代码,它要么会下载整个 305 MB 或更多的未压缩包,要么只是下载/debian几乎没有 MB 或更多的目录。有没有办法做到这一点 ?

我猜它要么需要像apt-file这样的元数据 -

$ sudo apt-file update 

答案1

您可以使用以下命令找出源 tarball 的大小apt-cache showsrc

$ apt-cache showsrc unknown-horizons
Package: unknown-horizons
Binary: unknown-horizons
Version: 2014.1+git160920-1
Maintainer: Debian Games Team <[email protected]>
Uploaders: Christoph Egger <[email protected]>
Build-Depends: debhelper (>= 10), dh-python, docbook-xml, docbook-xsl, imagemagick, intltool, python, xsltproc
Architecture: all
Standards-Version: 3.9.8
Format: 3.0 (quilt)
Files:
 152652f8ecb6961a5f02d3cab67b8cfa 2290 unknown-horizons_2014.1+git160920-1.dsc
 bec6e49f621f3f961454cf41c7e13346 197217496 unknown-horizons_2014.1+git160920.orig.tar.xz
 dccaafd51d0fbe3aaebe874715bc1d93 12512 unknown-horizons_2014.1+git160920-1.debian.tar.xz
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-games/unknown-horizons.git
Vcs-Git: https://anonscm.debian.org/git/pkg-games/unknown-horizons.git
Checksums-Sha256:
 af9fc7592567b75fa84189ca4e823df103e74fcb51e3fe34ea1162a53d08434d 2290 unknown-horizons_2014.1+git160920-1.dsc
 9342154d2ede6e152175c1c69d84f3a51ba2704a77a286103590da40f0d02482 197217496 unknown-horizons_2014.1+git160920.orig.tar.xz
 c6db7500f4dfe4a544ae660f92dd9acdc8248ecdc798a45d4bce0be6992d8a6f 12512 unknown-horizons_2014.1+git160920-1.debian.tar.xz
Homepage: http://www.unknown-horizons.org
Package-List: 
 unknown-horizons deb games optional arch=all
Directory: pool/main/u/unknown-horizons
Priority: source
Section: games

请注意这些Files:条目:.origtarball(包含上游源代码)的大小为 188MiB,.debiantarball 的大小为 12KiB。这并没有告诉您提取 tarball 需要多少空间,但它给出了一些指示。

debian通过仅下载tarball 来仅下载目录.debian,无论是从源码包页面,或使用apt-get source --diff-only.

相关内容