Lines 901-913
Link Here
|
901 |
else: |
901 |
else: |
902 |
myeb = None |
902 |
myeb = None |
903 |
|
903 |
|
904 |
if "--upgradeonly" in myopts: |
904 |
if "--upgradeonly" in myopts: |
905 |
# Check that there isn't a newer version of this package already installed |
905 |
# Check that there isn't a newer version of this package already installed |
906 |
cand = None |
906 |
cand = None |
907 |
if myeb: |
907 |
if myeb: |
908 |
cand=self.is_newer_ver_installed(myroot,x,myeb) |
908 |
cand=self.is_newer_ver_installed(myroot,x,myeb) |
909 |
elif myeb_pkg: |
909 |
elif myeb_pkg: |
910 |
cand=self.is_newer_ver_installed(myroot,x,myeb_pkg) |
910 |
cand=self.is_newer_ver_installed(myroot,x,myeb_pkg) |
911 |
if cand: |
911 |
if cand: |
912 |
myeb=cand |
912 |
myeb=cand |
913 |
|
913 |
|
Lines 1116-1122
Link Here
|
1116 |
addl=" "+green("N")+" "+fetch+" " |
1116 |
addl=" "+green("N")+" "+fetch+" " |
1117 |
|
1117 |
|
1118 |
if "--changelog" in myopts: |
1118 |
if "--changelog" in myopts: |
1119 |
changelogs.extend(self.calc_changelog( |
1119 |
changelogs.extend(self.calc_changelog( |
1120 |
portage.portdb.findname(x[2]), |
1120 |
portage.portdb.findname(x[2]), |
1121 |
portage.db["/"]["vartree"].dep_bestmatch('/'.join(portage.catpkgsplit(x[2])[:2])), |
1121 |
portage.db["/"]["vartree"].dep_bestmatch('/'.join(portage.catpkgsplit(x[2])[:2])), |
1122 |
x[2] |
1122 |
x[2] |
Lines 1198-1254
Link Here
|
1198 |
print |
1198 |
print |
1199 |
del mysplit |
1199 |
del mysplit |
1200 |
|
1200 |
|
1201 |
if "--changelog" in myopts: |
1201 |
if "--changelog" in myopts: |
1202 |
print |
1202 |
print |
1203 |
for revision,text in changelogs: |
1203 |
for revision,text in changelogs: |
1204 |
print bold('*'+revision) |
1204 |
print bold('*'+revision) |
1205 |
sys.stdout.write(text) |
1205 |
sys.stdout.write(text) |
1206 |
|
1206 |
|
1207 |
def calc_changelog(self,ebuildpath,current,next): |
1207 |
def calc_changelog(self,ebuildpath,current,next): |
1208 |
current = '-'.join(portage.catpkgsplit(current)[1:]) |
1208 |
current = '-'.join(portage.catpkgsplit(current)[1:]) |
1209 |
if current.endswith('-r0'): current = current[:-3] |
1209 |
if current.endswith('-r0'): current = current[:-3] |
1210 |
next = '-'.join(portage.catpkgsplit(next)[1:]) |
1210 |
next = '-'.join(portage.catpkgsplit(next)[1:]) |
1211 |
if next.endswith('-r0'): next = next[:-3] |
1211 |
if next.endswith('-r0'): next = next[:-3] |
1212 |
changelogpath = os.path.join(os.path.split(ebuildpath)[0],'ChangeLog') |
1212 |
changelogpath = os.path.join(os.path.split(ebuildpath)[0],'ChangeLog') |
1213 |
try: |
1213 |
try: |
1214 |
changelog = open(changelogpath).read() |
1214 |
changelog = open(changelogpath).read() |
1215 |
except: |
1215 |
except: |
1216 |
return [] |
1216 |
return [] |
1217 |
divisions = self.find_changelog_tags(changelog) |
1217 |
divisions = self.find_changelog_tags(changelog) |
1218 |
#print 'XX from',current,'to',next |
1218 |
#print 'XX from',current,'to',next |
1219 |
#for div,text in divisions: print 'XX',div |
1219 |
#for div,text in divisions: print 'XX',div |
1220 |
# skip entries for all revisions above the one we are about to emerge |
1220 |
# skip entries for all revisions above the one we are about to emerge |
1221 |
for i in range(len(divisions)): |
1221 |
for i in range(len(divisions)): |
1222 |
if divisions[i][0]==next: |
1222 |
if divisions[i][0]==next: |
1223 |
divisions = divisions[i:] |
1223 |
divisions = divisions[i:] |
1224 |
break |
1224 |
break |
1225 |
# find out how many entries we are going to display |
1225 |
# find out how many entries we are going to display |
1226 |
for i in range(len(divisions)): |
1226 |
for i in range(len(divisions)): |
1227 |
if divisions[i][0]==current: |
1227 |
if divisions[i][0]==current: |
1228 |
divisions = divisions[:i] |
1228 |
divisions = divisions[:i] |
1229 |
break |
1229 |
break |
1230 |
else: |
1230 |
else: |
1231 |
# couldnt find the current revision in the list. display nothing |
1231 |
# couldnt find the current revision in the list. display nothing |
1232 |
return [] |
1232 |
return [] |
1233 |
return divisions |
1233 |
return divisions |
1234 |
|
1234 |
|
1235 |
def find_changelog_tags(self,changelog): |
1235 |
def find_changelog_tags(self,changelog): |
1236 |
divs = [] |
1236 |
divs = [] |
1237 |
release = None |
1237 |
release = None |
1238 |
while 1: |
1238 |
while 1: |
1239 |
match = re.search(r'^\*\ ?([-a-zA-Z0-9_.]*)(?:\ .*)?\n',changelog,re.M) |
1239 |
match = re.search(r'^\*\ ?([-a-zA-Z0-9_.]*)(?:\ .*)?\n',changelog,re.M) |
1240 |
if match is None: |
1240 |
if match is None: |
1241 |
if release is not None: |
1241 |
if release is not None: |
1242 |
divs.append((release,changelog)) |
1242 |
divs.append((release,changelog)) |
1243 |
return divs |
1243 |
return divs |
1244 |
if release is not None: |
1244 |
if release is not None: |
1245 |
divs.append((release,changelog[:match.start()])) |
1245 |
divs.append((release,changelog[:match.start()])) |
1246 |
changelog = changelog[match.end():] |
1246 |
changelog = changelog[match.end():] |
1247 |
release = match.group(1) |
1247 |
release = match.group(1) |
1248 |
if release.endswith('.ebuild'): |
1248 |
if release.endswith('.ebuild'): |
1249 |
release = release[:-7] |
1249 |
release = release[:-7] |
1250 |
if release.endswith('-r0'): |
1250 |
if release.endswith('-r0'): |
1251 |
release = release[:-3] |
1251 |
release = release[:-3] |
1252 |
|
1252 |
|
1253 |
def outdated(self): |
1253 |
def outdated(self): |
1254 |
return self.outdatedpackages |
1254 |
return self.outdatedpackages |