Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11610 - in main/trunk: bin man
Date: Thu, 02 Oct 2008 06:35:12
Message-Id: E1KlHmI-0008SD-1k@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-10-02 06:35:04 +0000 (Thu, 02 Oct 2008)
3 New Revision: 11610
4
5 Modified:
6 main/trunk/bin/repoman
7 main/trunk/man/repoman.1
8 Log:
9 Implement a new "changelog.ebuildadded" check which causes repoman to bail
10 out if an ebuild has been added and the ChangeLog has not been modified. This
11 was requested by Robin H Johnson <robbat2@g.o> since it is a requirement for
12 the packages.gentoo.org ChangeLog code.
13
14
15 Modified: main/trunk/bin/repoman
16 ===================================================================
17 --- main/trunk/bin/repoman 2008-10-02 05:11:17 UTC (rev 11609)
18 +++ main/trunk/bin/repoman 2008-10-02 06:35:04 UTC (rev 11610)
19 @@ -22,7 +22,7 @@
20 import time
21 import platform
22
23 -from itertools import izip
24 +from itertools import chain, izip
25 from stat import S_ISDIR, ST_CTIME
26
27 try:
28 @@ -251,6 +251,7 @@
29 "desktop.invalid":"desktop-file-validate reports errors in a *.desktop file",
30 "ebuild.invalidname":"Ebuild files with a non-parseable or syntactically incorrect name (or using 2.1 versioning extensions)",
31 "ebuild.namenomatch":"Ebuild files that do not have the same name as their parent directory",
32 + "changelog.ebuildadded":"An ebuild was added but the ChangeLog was not modified",
33 "changelog.missing":"Missing ChangeLog files",
34 "ebuild.notadded":"Ebuilds that exist but have not been added to cvs",
35 "ebuild.patches":"PATCHES variable should be a bash array to ensure white space safety",
36 @@ -744,11 +745,21 @@
37 print green("\nRepoMan scours the neighborhood...")
38
39 new_ebuilds = set()
40 +modified_changelogs = set()
41 if vcs == "cvs":
42 mycvstree = cvstree.getentries("./", recursive=1)
43 + mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
44 mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
45 +
46 +if vcs == "svn":
47 + svnstatus = os.popen("svn status").readlines()
48 + mychanged = [ "./" + elem.rstrip()[7:] for elem in svnstatus if elem and elem[:1] in "MR" ]
49 + mynew = [ "./" + elem.rstrip()[7:] for elem in svnstatus if elem.startswith("A") ]
50 +
51 +if vcs:
52 new_ebuilds.update(x for x in mynew if x.endswith(".ebuild"))
53 - del mycvstree, mynew
54 + modified_changelogs.update(x for x in chain(mychanged, mynew) \
55 + if os.path.basename(x) == "ChangeLog")
56
57 have_masked = False
58 dofail = 0
59 @@ -1027,11 +1038,29 @@
60
61 del metadata_bad
62
63 + changelog_path = "ChangeLog"
64 + if repolevel < 3:
65 + changelog_path = os.path.join(pkgdir, changelog_path)
66 + if repolevel < 2:
67 + changelog_path = os.path.join(catdir, changelog_path)
68 + changelog_path = os.path.join(".", changelog_path)
69 + changelog_modified = changelog_path in modified_changelogs
70 +
71 allmasked = True
72
73 for y in ebuildlist:
74 relative_path = os.path.join(x, y + ".ebuild")
75 full_path = os.path.join(repodir, relative_path)
76 + ebuild_path = y + ".ebuild"
77 + if repolevel < 3:
78 + ebuild_path = os.path.join(pkgdir, ebuild_path)
79 + if repolevel < 2:
80 + ebuild_path = os.path.join(catdir, ebuild_path)
81 + ebuild_path = os.path.join(".", ebuild_path)
82 + if not changelog_modified and ebuild_path in new_ebuilds:
83 + stats['changelog.ebuildadded'] += 1
84 + fails['changelog.ebuildadded'].append(relative_path)
85 +
86 if stat.S_IMODE(os.stat(full_path).st_mode) & 0111:
87 stats["file.executable"] += 1
88 fails["file.executable"].append(x+"/"+y+".ebuild")
89 @@ -1120,12 +1149,6 @@
90 not keyword.startswith("-"):
91 stable_keywords.append(keyword)
92 if stable_keywords:
93 - ebuild_path = y + ".ebuild"
94 - if repolevel < 3:
95 - ebuild_path = os.path.join(pkgdir, ebuild_path)
96 - if repolevel < 2:
97 - ebuild_path = os.path.join(catdir, ebuild_path)
98 - ebuild_path = os.path.join(".", ebuild_path)
99 if ebuild_path in new_ebuilds:
100 stable_keywords.sort()
101 stats["KEYWORDS.stable"] += 1
102 @@ -1675,9 +1698,10 @@
103 sys.exit(1)
104
105 if vcs == "cvs":
106 - mycvstree=portage.cvstree.getentries("./",recursive=1)
107 - mychanged=portage.cvstree.findchanged(mycvstree,recursive=1,basedir="./")
108 - mynew=portage.cvstree.findnew(mycvstree,recursive=1,basedir="./")
109 + if myautoadd:
110 + mycvstree = cvstree.getentries("./", recursive=1)
111 + mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
112 + mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
113 myremoved=portage.cvstree.findremoved(mycvstree,recursive=1,basedir="./")
114 bin_blob_pattern = re.compile("^-kb$")
115 no_expansion = set(portage.cvstree.findoption(mycvstree, bin_blob_pattern,
116 @@ -1685,10 +1709,11 @@
117
118
119 if vcs == "svn":
120 - svnstatus = os.popen("svn status").readlines()
121 - mychanged = [ elem.rstrip()[7:] for elem in svnstatus if elem and elem[:1] in "MR" ]
122 - mynew = [ elem.rstrip()[7:] for elem in svnstatus if elem.startswith("A") ]
123 - myremoved = [ elem.rstrip()[7:] for elem in svnstatus if elem.startswith("D") ]
124 + if myautoadd:
125 + svnstatus = os.popen("svn status").readlines()
126 + mychanged = [ "./" + elem.rstrip()[7:] for elem in svnstatus if elem and elem[:1] in "MR" ]
127 + mynew = [ "./" + elem.rstrip()[7:] for elem in svnstatus if elem.startswith("A") ]
128 + myremoved = [ "./" + elem.rstrip()[7:] for elem in svnstatus if elem.startswith("D") ]
129 # in contrast to CVS, SVN expands nothing by default.
130 # bin_blobs historically
131 # were just there to see what files need to be checked for
132 @@ -1700,7 +1725,7 @@
133 # For files with multiple props set, props are delimited by newlines,
134 # so exclude lines that don't contain " - " since each of those lines
135 # only a contain props for a file listed on a previous line.
136 - expansion = set(prop.split(" - ")[0] \
137 + expansion = set("./" + prop.split(" - ")[0] \
138 for prop in props if " - " in prop)
139
140 if vcs:
141
142 Modified: main/trunk/man/repoman.1
143 ===================================================================
144 --- main/trunk/man/repoman.1 2008-10-02 05:11:17 UTC (rev 11609)
145 +++ main/trunk/man/repoman.1 2008-10-02 06:35:04 UTC (rev 11610)
146 @@ -183,6 +183,9 @@
147 .B SRC_URI.mirror
148 A uri listed in profiles/thirdpartymirrors is found in SRC_URI
149 .TP
150 +.B changelog.ebuildadded
151 +An ebuild was added but the ChangeLog was not modified
152 +.TP
153 .B changelog.missing
154 Missing ChangeLog files
155 .TP