2013-01-01 70 views
1

Debian政策手冊中的7.47.6.1部分描述了將Debian軟件包分爲兩部分的正確方法。但是,我有一個更復雜的情況。如何拆分現有的Debian軟件包,使其中一個新軟件包預先依賴於另一個軟件包?

我現在有兩個包,在,比方說,版本1.2.3:

Package: foo-base 

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

最初,這relationsihp是有道理的,但隨着時間的推移,和有點意外的富基元素有來取決於foo-dbserver的元素。更糟的是,現實情況是foo-base需要先取得元素foo-dbserver。所以我現在想要的是富基,分成富必要富基如下的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-essential,foo-dbserver,foo-base2)是一個更好的解決方案嗎?

回答

1

我發現的解決方案是將軟件包拆分爲另一個方向。也就是說,要將原始包名稱保留爲預先依賴的名稱,併爲執行預先取捨的人員使用新包名稱。

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) 
相關問題