This post is for those who want to upgrade their debian to the shiny new release, but still wants to continue using KDE3 packages from lenny.
This could be done by keeping lenny as a low-priority apt source, and proper package pinning.
To keep system more consistent, I use the following rule: pin to lenny all packages from sources that build something depended on KDE libraries. This rule catches all of KDE3, and also everything that uses KDE3 libraries, but was not included into KDE3. Also, this keeps good practice of avoiding installation binary packages built from different versions of the same source package.
One exception is OpenOffice.org. Due to it’s KDE plugin, it is caught by the rule. But lenny has too old version of it. Better to take version from lenny-backports.
Below is my script that generates needed configuration. It parses /var/lib/apt/lists/*_lenny_*_Packages files; to have these, lenny should be mentioned by name (not by oldstable alias) in /etc/apt/sources.list. Packages found are pinned with priority of 900 (this value may need to be adjusted). Output of the script could be put directly into a file in /etc/apt/preferences.d/ directory before upgrading system to squeeze.
#!/bin/bash
# Find out sources that build packages depending on kdelibs4c2a, and pin
# to lenny any package that comes from any of those sources.
# Exception is openoffice.org - pin it to lenny-backports instead
cat /var/lib/apt/lists/*_lenny_*_Packages | awk '
BEGIN {
found["kdelibs"] = 1
}
/^Package: / {p=$2; s=$2}
/^Source: / {s=$2}
/^Depends:.*\<kdelibs4c2a\>/ {found[s]=1}
/^$/ {allp[p]=1; p2s[p]=s}
END {
delete found["openoffice.org"]
for (p in allp) {
if (p2s[p] in found) {
print("Package: " p)
print("Pin: release n=lenny")
print("Pin-Priority: 900")
print("")
}
}
}
'
cat /var/lib/apt/lists/*_lenny-backports_*Packages | awk '
/^Package: / {p=$2; s=$2}
/^Source: / {s=$2}
/^$/ && s=="openoffice.org" {
print("Package: " p)
print("Pin: release n=lenny-backports")
print("Pin-Priority: 900")
print("")
}
'
English