Lines 34-39
Link Here
|
34 |
import portage.const |
34 |
import portage.const |
35 |
import portage.dep |
35 |
import portage.dep |
36 |
import portage.exception |
36 |
import portage.exception |
|
|
37 |
import portage.versions |
37 |
import cvstree |
38 |
import cvstree |
38 |
import time |
39 |
import time |
39 |
import codecs |
40 |
import codecs |
Lines 225-254
Link Here
|
225 |
qawarnings.append(x) |
226 |
qawarnings.append(x) |
226 |
|
227 |
|
227 |
|
228 |
|
228 |
ven_cat = r'[\w0-9-]+' # Category |
|
|
229 |
ven_nam = r'([+a-z0-9-]+(?:[+_a-z0-9-]*[+a-z0-9-]+)*)' # Name |
230 |
ven_ver = r'((?:\d+\.)*\d+[a-z]?)' # Version |
231 |
ven_suf = r'(_(alpha\d*|beta\d*|pre\d*|rc\d*|p\d+))?' # Suffix |
232 |
ven_rev = r'(-r\d+)?' # Revision |
233 |
|
234 |
ven_string=ven_cat+'/'+ven_nam+'-'+ven_ver+ven_suf+ven_rev |
235 |
valid_ebuild_name_re=re.compile(ven_string+'$', re.I) |
236 |
valid_ebuild_filename_re=re.compile(ven_string+'\.ebuild$', re.I) |
237 |
|
238 |
verbose=0 |
229 |
verbose=0 |
239 |
quiet=0 |
230 |
quiet=0 |
240 |
|
231 |
|
241 |
def valid_ebuild_name(name): |
232 |
def valid_ebuild_name(pkg, name): |
242 |
"""(name) --- Checks to ensure that the package name meets portage specs. |
233 |
"""(package, name) --- Checks to ensure that the package name meets |
243 |
Return 1 if valid, 0 if not.""" |
234 |
portage specs. |
244 |
# Handle either a path to the ebuild, or cat/pkg-ver string |
235 |
Return a bool, True if valid. |
245 |
if (len(name) > 7) and (name[-7:] == ".ebuild"): |
236 |
""" |
246 |
if valid_ebuild_filename_re.match(name): |
237 |
if name.endswith(".ebuild"): |
247 |
return 1 |
238 |
name = name[:-7] |
248 |
else: |
239 |
# be anal, and verify the ebuild name is the same |
249 |
if valid_ebuild_name_re.match(name): |
240 |
l = len(pkg) |
250 |
return 1 |
241 |
if not name.startswith(pkg +"-"): |
251 |
return 0 |
242 |
return False |
|
|
243 |
return portage.versions.ververify(name[l + 1:]) |
252 |
|
244 |
|
253 |
|
245 |
|
254 |
def show_version(): |
246 |
def show_version(): |
Lines 981-987
Link Here
|
981 |
stats["digest.missing"]=stats["digest.missing"]+1 |
973 |
stats["digest.missing"]=stats["digest.missing"]+1 |
982 |
fails["digest.missing"].append(x+"/files/digest-"+y) |
974 |
fails["digest.missing"].append(x+"/files/digest-"+y) |
983 |
myesplit=portage.pkgsplit(y) |
975 |
myesplit=portage.pkgsplit(y) |
984 |
if myesplit is None or not valid_ebuild_name(x.split("/")[0]+"/"+y): |
976 |
if myesplit is None or not valid_ebuild_name(x.split("/")[-1], y): |
985 |
stats["ebuild.invalidname"]=stats["ebuild.invalidname"]+1 |
977 |
stats["ebuild.invalidname"]=stats["ebuild.invalidname"]+1 |
986 |
fails["ebuild.invalidname"].append(x+"/"+y+".ebuild") |
978 |
fails["ebuild.invalidname"].append(x+"/"+y+".ebuild") |
987 |
continue |
979 |
continue |