Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/
Date: Mon, 21 Sep 2015 23:51:53
Message-Id: 1442878967.3f47be32adcee89a34234d594b04e81089ea85ce.dolsen@gentoo
1 commit: 3f47be32adcee89a34234d594b04e81089ea85ce
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 19 04:25:34 2015 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 21 23:42:47 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3f47be32
7
8 repoman/actions.py: Split out thick_manifest()
9
10 pym/repoman/actions.py | 101 +++++++++++++++++++++++++------------------------
11 1 file changed, 52 insertions(+), 49 deletions(-)
12
13 diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
14 index af50c1b..974de62 100644
15 --- a/pym/repoman/actions.py
16 +++ b/pym/repoman/actions.py
17 @@ -146,55 +146,7 @@ class Actions(object):
18 # committed in one big commit at the end.
19 print()
20 elif not self.repo_settings.repo_config.thin_manifest:
21 - if self.vcs_settings.vcs == 'cvs':
22 - headerstring = "'\$(Header|Id).*\$'"
23 - elif self.vcs_settings.vcs == "svn":
24 - svn_keywords = dict((k.lower(), k) for k in [
25 - "Rev",
26 - "Revision",
27 - "LastChangedRevision",
28 - "Date",
29 - "LastChangedDate",
30 - "Author",
31 - "LastChangedBy",
32 - "URL",
33 - "HeadURL",
34 - "Id",
35 - "Header",
36 - ])
37 -
38 - for myfile in myupdates:
39 -
40 - # for CVS, no_expansion contains files that are excluded from expansion
41 - if self.vcs_settings.vcs == "cvs":
42 - if myfile in no_expansion:
43 - continue
44 -
45 - # for SVN, expansion contains files that are included in expansion
46 - elif self.vcs_settings.vcs == "svn":
47 - if myfile not in expansion:
48 - continue
49 -
50 - # Subversion keywords are case-insensitive
51 - # in svn:keywords properties,
52 - # but case-sensitive in contents of files.
53 - enabled_keywords = []
54 - for k in expansion[myfile]:
55 - keyword = svn_keywords.get(k.lower())
56 - if keyword is not None:
57 - enabled_keywords.append(keyword)
58 -
59 - headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
60 -
61 - myout = repoman_getstatusoutput(
62 - "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
63 - if myout[0] == 0:
64 - myheaders.append(myfile)
65 -
66 - print("%s have headers that will change." % green(str(len(myheaders))))
67 - print(
68 - "* Files with headers will"
69 - " cause the manifests to be changed and committed separately.")
70 + self.thick_manifest(myupdates, myheaders, no_expansion, expansion)
71
72 logging.info("myupdates: %s", myupdates)
73 logging.info("myheaders: %s", myheaders)
74 @@ -814,3 +766,54 @@ class Actions(object):
75 except OSError:
76 pass
77
78 +
79 + def thick_manifest(self, myupdates, myheaders, no_expansion, expansion):
80 + if self.vcs_settings.vcs == 'cvs':
81 + headerstring = "'\$(Header|Id).*\$'"
82 + elif self.vcs_settings.vcs == "svn":
83 + svn_keywords = dict((k.lower(), k) for k in [
84 + "Rev",
85 + "Revision",
86 + "LastChangedRevision",
87 + "Date",
88 + "LastChangedDate",
89 + "Author",
90 + "LastChangedBy",
91 + "URL",
92 + "HeadURL",
93 + "Id",
94 + "Header",
95 + ])
96 +
97 + for myfile in myupdates:
98 +
99 + # for CVS, no_expansion contains files that are excluded from expansion
100 + if self.vcs_settings.vcs == "cvs":
101 + if myfile in no_expansion:
102 + continue
103 +
104 + # for SVN, expansion contains files that are included in expansion
105 + elif self.vcs_settings.vcs == "svn":
106 + if myfile not in expansion:
107 + continue
108 +
109 + # Subversion keywords are case-insensitive
110 + # in svn:keywords properties,
111 + # but case-sensitive in contents of files.
112 + enabled_keywords = []
113 + for k in expansion[myfile]:
114 + keyword = svn_keywords.get(k.lower())
115 + if keyword is not None:
116 + enabled_keywords.append(keyword)
117 +
118 + headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
119 +
120 + myout = repoman_getstatusoutput(
121 + "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
122 + if myout[0] == 0:
123 + myheaders.append(myfile)
124 +
125 + print("%s have headers that will change." % green(str(len(myheaders))))
126 + print(
127 + "* Files with headers will"
128 + " cause the manifests to be changed and committed separately.")