Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9508 - in main/branches/prefix: bin pym/portage pym/repoman
Date: Tue, 25 Mar 2008 20:33:46
Message-Id: E1JeFq3-0005dO-2d@stork.gentoo.org
1 Author: grobian
2 Date: 2008-03-25 20:33:41 +0000 (Tue, 25 Mar 2008)
3 New Revision: 9508
4
5 Modified:
6 main/branches/prefix/bin/ebuild.sh
7 main/branches/prefix/bin/repoman
8 main/branches/prefix/pym/portage/__init__.py
9 main/branches/prefix/pym/repoman/checks.py
10 Log:
11 Merged from trunk 9501:9507
12
13 | 9502 | Check is os.statvfs() is implemented before trying to us it. |
14 | zmedico | (branches/prefix r9500) |
15
16 | 9503 | Bug #214499 - When compiler flags are unset, many packages |
17 | zmedico | will substitute their own implicit flags. For uniformity, |
18 | | use an empty string as the default. |
19
20 | 9504 | Bug #211294 - Make repoman bail out if arch.list contains |
21 | zmedico | unrecognized lines since we don't want people to commit with |
22 | | old versions of portage that don't support the current |
23 | | arch.list format. |
24
25 | 9505 | Bug #212152 - Account pre-existing files when calculating |
26 | zmedico | whether there is enough space for a download. |
27
28 | 9506 | Fix typo. |
29 | zmedico | |
30
31 | 9507 | Bug #212621 - Make the EbuildQuote check do quoting |
32 | zmedico | validation for misc variables from games.eclass. |
33
34
35 Modified: main/branches/prefix/bin/ebuild.sh
36 ===================================================================
37 --- main/branches/prefix/bin/ebuild.sh 2008-03-25 04:04:44 UTC (rev 9507)
38 +++ main/branches/prefix/bin/ebuild.sh 2008-03-25 20:33:41 UTC (rev 9508)
39 @@ -273,6 +273,12 @@
40 export DIROPTIONS="-m0755"
41 export MOPREFIX=${PN}
42
43 +# When compiler flags are unset, many packages will substitute their own
44 +# implicit flags. For uniformity, use an empty string as the default.
45 +[ "${CFLAGS-unset}" == "unset" ] && export CFLAGS=""
46 +[ "${CXXFLAGS-unset}" == "unset" ] && export CXXFLAGS=""
47 +[ "${LDFLAGS-unset}" == "unset" ] && export LDFLAGS=""
48 +
49 check_KV() {
50 if [ -z "${KV}" ]; then
51 eerror ""
52
53 Modified: main/branches/prefix/bin/repoman
54 ===================================================================
55 --- main/branches/prefix/bin/repoman 2008-03-25 04:04:44 UTC (rev 9507)
56 +++ main/branches/prefix/bin/repoman 2008-03-25 20:33:41 UTC (rev 9508)
57 @@ -571,15 +571,24 @@
58 logging.debug("Found the following packages to scan:\n%s" % '\n'.join(scanlist))
59
60 profiles={}
61 +valid_profile_types = frozenset(["dev", "exp", "stable"])
62 descfile=portdir+"/profiles/profiles.desc"
63 if os.path.exists(descfile):
64 - for x in portage.grabfile(descfile):
65 + for i, x in enumerate(open(descfile, 'rb')):
66 if x[0]=="#":
67 continue
68 arch=x.split()
69 + if len(arch) == 0:
70 + continue
71 if len(arch)!=3:
72 - print "wrong format: \""+red(x)+"\" in "+descfile
73 - continue
74 + err("wrong format: \"" + bad(x.strip()) + "\" in " + \
75 + descfile + " line %d" % (i+1, ))
76 + elif arch[0] not in kwlist:
77 + err("invalid arch: \"" + bad(arch[0]) + "\" in " + \
78 + descfile + " line %d" % (i+1, ))
79 + elif arch[2] not in valid_profile_types:
80 + err("invalid profile type: \"" + bad(arch[2]) + "\" in " + \
81 + descfile + " line %d" % (i+1, ))
82 if not os.path.isdir(portdir+"/profiles/"+arch[1]):
83 print "Invalid "+arch[2]+" profile ("+arch[1]+") for arch "+arch[0]
84 continue
85
86 Modified: main/branches/prefix/pym/portage/__init__.py
87 ===================================================================
88 --- main/branches/prefix/pym/portage/__init__.py 2008-03-25 04:04:44 UTC (rev 9507)
89 +++ main/branches/prefix/pym/portage/__init__.py 2008-03-25 20:33:41 UTC (rev 9508)
90 @@ -3265,8 +3265,16 @@
91 # overestimate the filesize so we aren't bitten by FS overhead
92 if hasattr(os, "statvfs"):
93 vfs_stat = os.statvfs(mysettings["DISTDIR"])
94 + try:
95 + mysize = os.stat(myfile_path).st_size
96 + except OSError, e:
97 + if e.errno != errno.ENOENT:
98 + raise
99 + del e
100 + mysize = 0
101 if myfile in mydigests \
102 - and (mydigests[myfile]["size"] + vfs_stat.f_bsize) >= (vfs_stat.f_bsize * vfs_stat.f_bavail):
103 + and (mydigests[myfile]["size"] - mysize + vfs_stat.f_bsize) >= \
104 + (vfs_stat.f_bsize * vfs_stat.f_bavail):
105 writemsg("!!! Insufficient space to store %s in %s\n" % (myfile, mysettings["DISTDIR"]), noiselevel=-1)
106 has_space = False
107
108
109 Modified: main/branches/prefix/pym/repoman/checks.py
110 ===================================================================
111 --- main/branches/prefix/pym/repoman/checks.py 2008-03-25 04:04:44 UTC (rev 9507)
112 +++ main/branches/prefix/pym/repoman/checks.py 2008-03-25 20:33:41 UTC (rev 9508)
113 @@ -77,7 +77,14 @@
114
115 repoman_check_name = 'ebuild.minorsyn'
116 ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)|(^\s*(local|export)\s+)')
117 - var_names = r'(D|DISTDIR|FILESDIR|S|T|ROOT|WORKDIR)'
118 + var_names = ["D", "DISTDIR", "FILESDIR", "S", "T", "ROOT", "WORKDIR"]
119 +
120 + # variables for games.eclass
121 + var_names += ["Ddir", "dir", "GAMES_PREFIX_OPT", "GAMES_DATADIR",
122 + "GAMES_DATADIR_BASE", "GAMES_SYSCONFDIR", "GAMES_STATEDIR",
123 + "GAMES_LOGDIR", "GAMES_BINDIR"]
124 +
125 + var_names = "(%s)" % "|".join(var_names)
126 var_reference = re.compile(r'\$(\{'+var_names+'\}|' + \
127 var_names + '\W)')
128 missing_quotes = re.compile(r'(\s|^)[^"\'\s]*\$\{?' + var_names + \
129
130 --
131 gentoo-commits@l.g.o mailing list