export DIROPTIONS="-m0755"
export MOPREFIX=${PN}
+# When compiler flags are unset, many packages will substitute their own
+# implicit flags. For uniformity, use an empty string as the default.
+[ "${CFLAGS-unset}" == "unset" ] && export CFLAGS=""
+[ "${CXXFLAGS-unset}" == "unset" ] && export CXXFLAGS=""
+[ "${LDFLAGS-unset}" == "unset" ] && export LDFLAGS=""
+
check_KV() {
if [ -z "${KV}" ]; then
eerror ""
logging.debug("Found the following packages to scan:\n%s" % '\n'.join(scanlist))
profiles={}
+valid_profile_types = frozenset(["dev", "exp", "stable"])
descfile=portdir+"/profiles/profiles.desc"
if os.path.exists(descfile):
- for x in portage.grabfile(descfile):
+ for i, x in enumerate(open(descfile, 'rb')):
if x[0]=="#":
continue
arch=x.split()
- if len(arch)!=3:
- print "wrong format: \""+red(x)+"\" in "+descfile
+ if len(arch) == 0:
continue
+ if len(arch)!=3:
+ err("wrong format: \"" + bad(x.strip()) + "\" in " + \
+ descfile + " line %d" % (i+1, ))
+ elif arch[0] not in kwlist:
+ err("invalid arch: \"" + bad(arch[0]) + "\" in " + \
+ descfile + " line %d" % (i+1, ))
+ elif arch[2] not in valid_profile_types:
+ err("invalid profile type: \"" + bad(arch[2]) + "\" in " + \
+ descfile + " line %d" % (i+1, ))
if not os.path.isdir(portdir+"/profiles/"+arch[1]):
print "Invalid "+arch[2]+" profile ("+arch[1]+") for arch "+arch[0]
continue
# overestimate the filesize so we aren't bitten by FS overhead
if hasattr(os, "statvfs"):
vfs_stat = os.statvfs(mysettings["DISTDIR"])
+ try:
+ mysize = os.stat(myfile_path).st_size
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+ mysize = 0
if myfile in mydigests \
- and (mydigests[myfile]["size"] + vfs_stat.f_bsize) >= (vfs_stat.f_bsize * vfs_stat.f_bavail):
+ and (mydigests[myfile]["size"] - mysize + vfs_stat.f_bsize) >= \
+ (vfs_stat.f_bsize * vfs_stat.f_bavail):
writemsg("!!! Insufficient space to store %s in %s\n" % (myfile, mysettings["DISTDIR"]), noiselevel=-1)
has_space = False
repoman_check_name = 'ebuild.minorsyn'
ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)|(^\s*(local|export)\s+)')
- var_names = r'(D|DISTDIR|FILESDIR|S|T|ROOT|WORKDIR)'
+ var_names = ["D", "DISTDIR", "FILESDIR", "S", "T", "ROOT", "WORKDIR"]
+
+ # variables for games.eclass
+ var_names += ["Ddir", "dir", "GAMES_PREFIX_OPT", "GAMES_DATADIR",
+ "GAMES_DATADIR_BASE", "GAMES_SYSCONFDIR", "GAMES_STATEDIR",
+ "GAMES_LOGDIR", "GAMES_BINDIR"]
+
+ var_names = "(%s)" % "|".join(var_names)
var_reference = re.compile(r'\$(\{'+var_names+'\}|' + \
var_names + '\W)')
missing_quotes = re.compile(r'(\s|^)[^"\'\s]*\$\{?' + var_names + \