|
|
|
@ -336,14 +336,20 @@ class DistributiveRepository:
|
|
|
|
|
return max(listimgs,key=keyfunc).group()
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
def getBestStage(self,march=None):
|
|
|
|
|
def getBestStage(self,march=None,hardened=None):
|
|
|
|
|
"""Get latest stage by march"""
|
|
|
|
|
if march:
|
|
|
|
|
convert = {'x86_64':'amd64'}
|
|
|
|
|
march = convert.get(march,march)
|
|
|
|
|
reStage = re.compile(r'^.*/stage3-%s-(\d+)\.tar\.bz2$'%march,re.S)
|
|
|
|
|
march = {'x86_64':'amd64'}.get(march,march)
|
|
|
|
|
else:
|
|
|
|
|
reStage = re.compile(r'^.*/stage3-[^-]+-(\d+)\.tar\.bz2$',re.S)
|
|
|
|
|
march = "[^-]+"
|
|
|
|
|
if hardened is None:
|
|
|
|
|
hardened = "(?:-hardened)?"
|
|
|
|
|
elif hardened == True:
|
|
|
|
|
hardened = "-hardened"
|
|
|
|
|
elif hardened == False:
|
|
|
|
|
hardened = ""
|
|
|
|
|
reStage = re.compile(r'^.*/stage3-%s%s-(\d+)\.tar\.bz2$'%
|
|
|
|
|
(march,hardened),re.S)
|
|
|
|
|
return self._findLatestFile(self.dirs,reStage,lambda x:x.groups()[0])
|
|
|
|
|
|
|
|
|
|
class Distributive(object, SignalInterrupt):
|
|
|
|
|