
DSCURL="$(wget -qO- "https://packages.debian.org/${SUITE}/${PKG}" \
| grep -o 'http.*\.dsc">\[' | cut -d'"' -f1)"
[ -z "$DSCURL" ] && die 2 "no .dsc"
dget ${ALLOW_UNAUTH} -x "$DSCURL" 2> "$TEMP"
我正在尋找從 jessie 獲取源代碼包的 Debain 方式,以便通過dget -x $DSCURL
.那是為了向後移植所以apt-get source
這不是一個解決方案,它會幹擾 apt 系統的喘息。我現在正在透過解析 Debian 網頁來做到這一點。我找不到合適的Debian API。
答案1
apt-get source -t jessie dpkg
是一種方式去:
引用線上說明頁面中的相關部分
Source packages are tracked separately from binary packages via
deb-src lines in the sources.list(5) file. This means that you will
need to add such a line for each repository you want to get sources
from; otherwise you will probably get either the wrong (too old/too
new) source versions or none at all.
並且:
-t, --target-release, --default-release
This option controls the default input to the policy engine; it
creates a default pin at priority 990 using the specified release
string. This overrides the general settings in
/etc/apt/preferences. Specifically pinned packages are not affected
by the value of this option. In short, this option lets you have
simple control over which distribution packages will be retrieved
from. Some common examples might be -t '2.1*', -t unstable or -t
sid. Configuration Item: APT::Default-Release; see also the
apt_preferences(5) manual page.
另一個選擇是使用debootstrap
並創建一個完整的 chroot。
不要忘記使用類似的東西pbuilder
擁有可靠的軟體包建置。