79
81
for arch in ARCHES:
80
82
apt_pkg.Config.Set("APT::Architecture",arch)
81
cache = apt.Cache(apt.progress.OpTextProgress())
82
prog = apt.progress.TextFetchProgress()
83
cache = apt.Cache(apt.progress.OpProgress())
84
prog = apt.progress.FetchProgress()
84
cache.open(apt.progress.OpTextProgress())
86
cache.open(apt.progress.OpProgress())
85
87
map(lambda pkg: dist.pkgs_in_comp[comp].add(pkg.name), cache)
87
89
# check what is no longer in main
102
104
# remove items that are now in universe, but are replaced by something
103
105
# in main (pidgin, gaim) etc
104
print "Looking for replaces"
106
#print "Looking for replaces"
105
107
line = "deb http://archive.ubuntu.com/ubuntu %s %s\n" % (new.name, "main")
106
108
file("apt/sources.list","w").write(line)
107
109
dist.pkgs_in_comp[comp] = set()
108
110
for arch in ARCHES:
109
111
apt_pkg.Config.Set("APT::Architecture",arch)
110
cache = apt.Cache(apt.progress.OpTextProgress())
111
prog = apt.progress.TextFetchProgress()
112
cache = apt.Cache(apt.progress.OpProgress())
113
prog = apt.progress.FetchProgress()
112
114
cache.update(prog)
113
cache.open(apt.progress.OpTextProgress())
115
cache.open(apt.progress.OpProgress())
114
116
# go over the packages in "main" and check if they replaces something
115
117
# that we think is a demotion
116
118
for pkgname in new.pkgs_in_comp["main"]:
117
119
replaces = get_replace(cache, pkgname)
118
120
for r in replaces:
120
print "found '%s' that is demoted but replaced by '%s'" % (r, pkgname)
122
#print "found '%s' that is demoted but replaced by '%s'" % (r, pkgname)
121
123
demoted.remove(r)
123
outfile = "demoted.cfg"
124
print "writing the demotion info to '%s'" % outfile
125
#outfile = "demoted.cfg"
126
#print "writing the demotion info to '%s'" % outfile
126
out = open(outfile,"w")
127
out.write("# demoted packages\n")
128
out.write("\n".join(demoted))
128
#out = open(outfile,"w")
129
#out.write("# demoted packages\n")
130
#out.write("\n".join(demoted))
131
print "# demoted packages from %s to %s" % (sys.argv[1], sys.argv[2])
132
print "\n".join(demoted)