2

Debian Policy Manual 的第7.47.6.1节描述了将 Debian 软件包一分为二的正确方法。但是,我有一个更复杂的情况。

我目前有两个包,例如版本 1.2.3:

Package: foo-base

Package: foo-dbserver
Depends: foo-base (>= 1.2.3)

最初,这种关系是有道理的,但随着时间的推移,有些偶然,foo-base的元素已经开始依赖于foo-dbserver 的元素。更糟糕的是,现实情况是foo-base Pre- 的元素依赖于foo-dbserver 的元素。所以我现在想要的是将foo-base拆分为foo-essentialfoo-base,如下所示,对于 1.2.4 版本:

Package: foo-essential
Replaces: foo-base (<< 1.2.3)
Breaks: foo-base (<< 1.2.3)

Package: foo-dbserver
Depends: foo-essential (>= 1.2.4)

Package: foo-base
Pre-Depends: foo-dbserver (>= 1.2.4)

这三个软件包在新安装时安装得很好,但它们并没有完全升级:

dpkg: regarding foo-base_1.2.4_all.deb containing foo-base, pre-dependency problem:
 foo-base pre-depends on foo-dbserver (>= 1.2.4)
  foo-dbserver latest configured version is 1.2.3
dpkg: error processing foo-base_1.2.4_all.deb (--install):
 pre-dependency problem - not installing foo-base
dpkg: regarding foo-essential_1.2.4_all.deb containing foo-essential:
 foo-essential breaks foo-base (<< 1.2.3)
  foo-base (version 1.2.3) is present and installed.
dpkg: error processing foo-essential_1.2.4_all.deb (--install):
 installing foo-essential would break foo-base, and
 deconfiguration is not permitted (--auto-deconfigure might help)
(Reading database ... 39107 files and directories currently installed.)
Preparing to replace foo-dbserver 1.2.3 (using foo-dbserver_1.2.4_all.deb) ...
Unpacking replacement foo-dbserver ...
dpkg: dependency problems prevent configuration of foo-dbserver:
 foo-dbserver depends on foo-essential (>= 1.2.4); however:
  Package foo-essential is not installed.
dpkg: error processing foo-dbserver (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 foo-base_1.2.4_all.deb
 foo-essential_1.2.4_all.deb
 foo-dbserver

有没有办法正确表达这种关系,以便升级?将 foo-base 完全重命名为其他名称(并使用名称foo-essentialfoo-dbserverfoo-base2)是更好的解决方案吗?

4

1 回答 1

2

我找到的解决方案是将包拆分为另一个方向。也就是说,将原始包名保留为 Pre-Depended 的包名,并为执行 Pre-Depending 的包名使用新的包名。

Package: foo-base

Package: foo-dbserver
Depends: foo-essential (>= 1.2.4)

Package: foo-extra
Pre-Depends: foo-dbserver (>= 1.2.4)
Replaces: foo-base (<< 1.2.3)
Breaks: foo-base (<< 1.2.3)
于 2013-01-03T03:25:35.260 回答