Merged from trunk 9501:9507
authorFabian Groffen <grobian@gentoo.org>
Tue, 25 Mar 2008 20:33:41 +0000 (20:33 -0000)
committerFabian Groffen <grobian@gentoo.org>
Tue, 25 Mar 2008 20:33:41 +0000 (20:33 -0000)
   | 9502    | Check is os.statvfs() is implemented before trying to us it. |
   | zmedico | (branches/prefix r9500)                                      |

   | 9503    | Bug #214499 - When compiler flags are unset, many packages   |
   | zmedico | will substitute their own implicit flags. For uniformity,    |
   |         | use an empty string as the default.                          |

   | 9504    | Bug #211294 - Make repoman bail out if arch.list contains    |
   | zmedico | unrecognized lines since we don't want people to commit with |
   |         | old versions of portage that don't support the current       |
   |         | arch.list format.                                            |

   | 9505    | Bug #212152 - Account pre-existing files when calculating    |
   | zmedico | whether there is enough space for a download.                |

   | 9506    | Fix typo.                                                    |
   | zmedico |                                                              |

   | 9507    | Bug #212621 - Make the EbuildQuote check do quoting          |
   | zmedico | validation for misc variables from games.eclass.             |

svn path=/main/branches/prefix/; revision=9508

bin/ebuild.sh
bin/repoman
pym/portage/__init__.py
pym/repoman/checks.py

index 471743ce0911ec5acb54cce3083e13808b37dfbe..5251f7951bbb7ebea2c6b50365bc655cbc21f2ba 100755 (executable)
@@ -273,6 +273,12 @@ export LIBOPTIONS="-m0644"
 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 ""
index da0cfc4f7ec4d715675be5bb6b483374c8a458bf..7ffabda08c5de9a0711e826de7cd3fd3145a89b0 100755 (executable)
@@ -571,15 +571,24 @@ scanlist.sort()
 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
index 7c4ca5fb16abce27c6c098a2ec71d06059009db5..3ebb253a9105ade130bea1a32be9b5587e55fb8c 100644 (file)
@@ -3265,8 +3265,16 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                        # 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
 
index ea76f6a019bd6bbeae5c7f46d4c75644abf13779..aa5bf18453cf568b7aba12663b8052f7ce1a6303 100644 (file)
@@ -77,7 +77,14 @@ class EbuildQuote(LineCheck):
 
        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 + \