1 |
commit: 3e6a2e36af413a4dc1469a4042c8ce1aae95dfc9 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 1 17:53:32 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 1 17:53:32 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=3e6a2e36 |
7 |
|
8 |
*: use new PF in places were it was simulated |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
libq/atom.c | 5 +---- |
13 |
libq/tree.c | 10 ++++------ |
14 |
qgrep.c | 7 +++---- |
15 |
qlist.c | 22 ++++++++++------------ |
16 |
qlop.c | 14 +++++--------- |
17 |
qpkg.c | 13 ++++--------- |
18 |
6 files changed, 27 insertions(+), 44 deletions(-) |
19 |
|
20 |
diff --git a/libq/atom.c b/libq/atom.c |
21 |
index 6f70847..946e821 100644 |
22 |
--- a/libq/atom.c |
23 |
+++ b/libq/atom.c |
24 |
@@ -794,10 +794,7 @@ atom_format_r( |
25 |
append_buf(buf, buflen, "%s%s%s", BLUE, atom->PN, NORM); |
26 |
if (atom->PV) |
27 |
append_buf(buf, buflen, "%s-%s%s", |
28 |
- CYAN, atom->PV, NORM); |
29 |
- if (atom->PR_int) |
30 |
- append_buf(buf, buflen,"%s-r%d%s", |
31 |
- CYAN, atom->PR_int, NORM); |
32 |
+ CYAN, atom->PVR, NORM); |
33 |
} else if (!strncmp("PR", fmt, len)) { |
34 |
if (showit || atom->PR_int) |
35 |
append_buf(buf, buflen, "%sr%d%s", |
36 |
|
37 |
diff --git a/libq/tree.c b/libq/tree.c |
38 |
index bac9d00..377af83 100644 |
39 |
--- a/libq/tree.c |
40 |
+++ b/libq/tree.c |
41 |
@@ -1,5 +1,5 @@ |
42 |
/* |
43 |
- * Copyright 2005-2019 Gentoo Foundation |
44 |
+ * Copyright 2005-2020 Gentoo Foundation |
45 |
* Distributed under the terms of the GNU General Public License v2 |
46 |
* |
47 |
* Copyright 2005-2008 Ned Ludd - <solar@g.o> |
48 |
@@ -1196,8 +1196,8 @@ tree_foreach_packages(tree_ctx *ctx, tree_pkg_cb callback, void *priv) |
49 |
tree_close_cat(cat); |
50 |
pkg->cat_ctx = cat = tree_open_cat(ctx, atom->CATEGORY); |
51 |
} |
52 |
- pkgnamelen = snprintf(pkgname, sizeof(pkgname), "%s-%s.tbz2", |
53 |
- atom->PN, atom->PR_int > 0 ? atom->PVR : atom->PV); |
54 |
+ pkgnamelen = snprintf(pkgname, sizeof(pkgname), |
55 |
+ "%s.tbz2", atom->PF); |
56 |
pkgname[pkgnamelen - (sizeof(".tbz2") - 1)] = '\0'; |
57 |
pkg->name = pkgname; |
58 |
pkg->slot = meta->Q_SLOT == NULL ? (char *)"0" : meta->Q_SLOT; |
59 |
@@ -1389,9 +1389,7 @@ static int tree_get_atoms_cb(tree_pkg_ctx *pkg_ctx, void *priv) |
60 |
char abuf[BUFSIZ]; |
61 |
|
62 |
if (state->fullcpv) { |
63 |
- snprintf(abuf, sizeof(abuf), "%s/%s-%s", |
64 |
- atom->CATEGORY, atom->PN, |
65 |
- atom->PR_int > 0 ? atom->PVR : atom->PV); |
66 |
+ snprintf(abuf, sizeof(abuf), "%s/%s", atom->CATEGORY, atom->PF); |
67 |
state->cpf = add_set(abuf, state->cpf); |
68 |
} else { |
69 |
snprintf(abuf, sizeof(abuf), "%s/%s", atom->CATEGORY, atom->PN); |
70 |
|
71 |
diff --git a/qgrep.c b/qgrep.c |
72 |
index 2a64d1b..4d8c27f 100644 |
73 |
--- a/qgrep.c |
74 |
+++ b/qgrep.c |
75 |
@@ -1,5 +1,5 @@ |
76 |
/* |
77 |
- * Copyright 2005-2019 Gentoo Foundation |
78 |
+ * Copyright 2005-2020 Gentoo Foundation |
79 |
* Distributed under the terms of the GNU General Public License v2 |
80 |
* |
81 |
* Copyright 2005 Petteri Räty - <betelgeuse@g.o> |
82 |
@@ -416,9 +416,8 @@ qgrep_cache_cb(tree_pkg_ctx *pkg_ctx, void *priv) |
83 |
} |
84 |
|
85 |
/* cat/pkg/pkg-ver.ebuild */ |
86 |
- snprintf(buf, sizeof(buf), "%s/%s/%s-%s.ebuild", |
87 |
- patom->CATEGORY, patom->PN, patom->PN, |
88 |
- patom->PR_int > 0 ? patom->PVR : patom->PV); |
89 |
+ snprintf(buf, sizeof(buf), "%s/%s/%s.ebuild", |
90 |
+ patom->CATEGORY, patom->PN, patom->PF); |
91 |
|
92 |
label = NULL; |
93 |
if (data->show_name) { |
94 |
|
95 |
diff --git a/qlist.c b/qlist.c |
96 |
index 1d4862f..f77eaea 100644 |
97 |
--- a/qlist.c |
98 |
+++ b/qlist.c |
99 |
@@ -1,5 +1,5 @@ |
100 |
/* |
101 |
- * Copyright 2005-2019 Gentoo Foundation |
102 |
+ * Copyright 2005-2020 Gentoo Foundation |
103 |
* Distributed under the terms of the GNU General Public License v2 |
104 |
* |
105 |
* Copyright 2005 Martin Schlemmer - <azarah@g.o> |
106 |
@@ -262,10 +262,9 @@ qlist_match( |
107 |
if (exact) { |
108 |
int i; |
109 |
|
110 |
- snprintf(buf, sizeof(buf), "%s/%s-%s%s%s%s%s%s%s", |
111 |
+ snprintf(buf, sizeof(buf), "%s/%s%s%s%s%s%s%s", |
112 |
atom->CATEGORY, |
113 |
- atom->PN, |
114 |
- atom->PVR, |
115 |
+ atom->PF, |
116 |
atom->SLOT != NULL ? ":" : "", |
117 |
atom->SLOT != NULL ? atom->SLOT : "", |
118 |
atom->SUBSLOT != NULL ? "/" : "", |
119 |
@@ -273,10 +272,10 @@ qlist_match( |
120 |
atom->REPO != NULL ? "::" : "", |
121 |
atom->REPO != NULL ? atom->REPO : ""); |
122 |
|
123 |
- /* exact match: CAT/PN-PVR[:SLOT][::REPO] */ |
124 |
+ /* exact match: CAT/PF[:SLOT][::REPO] */ |
125 |
if (strcmp(name, buf) == 0) |
126 |
return true; |
127 |
- /* exact match: PN-PVR[:SLOT][::REPO] */ |
128 |
+ /* exact match: PF[:SLOT][::REPO] */ |
129 |
if (strcmp(name, strstr(buf, "/") + 1) == 0) |
130 |
return true; |
131 |
|
132 |
@@ -294,15 +293,14 @@ qlist_match( |
133 |
if (strcmp(name, strstr(buf, "/") + 1) == 0) |
134 |
return true; |
135 |
} else { |
136 |
- /* partial leading match: CAT/PN-PVR */ |
137 |
- snprintf(buf, sizeof(buf), "%s/%s-%s", |
138 |
- atom->CATEGORY, atom->PN, atom->PVR); |
139 |
+ /* partial leading match: CAT/PF */ |
140 |
+ snprintf(buf, sizeof(buf), "%s/%s", |
141 |
+ atom->CATEGORY, atom->PF); |
142 |
if (strncmp(name, buf, pf_len) == 0 || |
143 |
rematch(name, buf, REG_EXTENDED) == 0) |
144 |
return true; |
145 |
- /* partial leading match: PN-PVR */ |
146 |
- snprintf(buf, sizeof(buf), "%s-%s", atom->PN, atom->PVR); |
147 |
- if (strncmp(name, buf, pf_len) == 0 || |
148 |
+ /* partial leading match: PF */ |
149 |
+ if (strncmp(name, atom->PF, pf_len) == 0 || |
150 |
rematch(name, buf, REG_EXTENDED) == 0) |
151 |
return true; |
152 |
} |
153 |
|
154 |
diff --git a/qlop.c b/qlop.c |
155 |
index 3120d85..9fa1387 100644 |
156 |
--- a/qlop.c |
157 |
+++ b/qlop.c |
158 |
@@ -1,5 +1,5 @@ |
159 |
/* |
160 |
- * Copyright 2005-2019 Gentoo Foundation |
161 |
+ * Copyright 2005-2020 Gentoo Foundation |
162 |
* Distributed under the terms of the GNU General Public License v2 |
163 |
* |
164 |
* Copyright 2005-2010 Ned Ludd - <solar@g.o> |
165 |
@@ -654,10 +654,8 @@ static int do_emerge_log( |
166 |
snprintf(afmt, sizeof(afmt), "%s/%s", |
167 |
pkgw->atom->CATEGORY, pkgw->atom->PN); |
168 |
} else { |
169 |
- snprintf(afmt, sizeof(afmt), "%s/%s-%s", |
170 |
- pkgw->atom->CATEGORY, pkgw->atom->PN, |
171 |
- pkgw->atom->PR_int > 0 ? |
172 |
- pkgw->atom->PVR : pkgw->atom->PV); |
173 |
+ snprintf(afmt, sizeof(afmt), "%s/%s", |
174 |
+ pkgw->atom->CATEGORY, pkgw->atom->PF); |
175 |
} |
176 |
|
177 |
pkg = add_set_value(afmt, pkgw, merge_averages); |
178 |
@@ -798,10 +796,8 @@ static int do_emerge_log( |
179 |
snprintf(afmt, sizeof(afmt), "%s/%s", |
180 |
pkgw->atom->CATEGORY, pkgw->atom->PN); |
181 |
} else { |
182 |
- snprintf(afmt, sizeof(afmt), "%s/%s-%s", |
183 |
- pkgw->atom->CATEGORY, pkgw->atom->PN, |
184 |
- pkgw->atom->PR_int > 0 ? |
185 |
- pkgw->atom->PVR : pkgw->atom->PV); |
186 |
+ snprintf(afmt, sizeof(afmt), "%s/%s", |
187 |
+ pkgw->atom->CATEGORY, pkgw->atom->PF); |
188 |
} |
189 |
|
190 |
pkg = add_set_value(afmt, pkgw, unmerge_averages); |
191 |
|
192 |
diff --git a/qpkg.c b/qpkg.c |
193 |
index f5e8168..9d2d82a 100644 |
194 |
--- a/qpkg.c |
195 |
+++ b/qpkg.c |
196 |
@@ -1,5 +1,5 @@ |
197 |
/* |
198 |
- * Copyright 2005-2019 Gentoo Foundation |
199 |
+ * Copyright 2005-2020 Gentoo Foundation |
200 |
* Distributed under the terms of the GNU General Public License v2 |
201 |
* |
202 |
* Copyright 2005-2010 Ned Ludd - <solar@g.o> |
203 |
@@ -54,11 +54,6 @@ extern char pretend; |
204 |
static char *qpkg_bindir = NULL; |
205 |
static int eclean = 0; |
206 |
|
207 |
-static char * |
208 |
-atom_to_pvr(depend_atom *atom) { |
209 |
- return (atom->PR_int == 0 ? atom->P : atom->PVR ); |
210 |
-} |
211 |
- |
212 |
/* checks to make sure this is a .tbz2 file. used by scandir() */ |
213 |
static int |
214 |
filter_tbz2(const struct dirent *dentry) |
215 |
@@ -228,7 +223,7 @@ qpkg_make(depend_atom *atom) |
216 |
buf = xmalloc(buflen); |
217 |
|
218 |
snprintf(buf, buflen, "%s/%s/%s/CONTENTS", |
219 |
- portvdb, atom->CATEGORY, atom_to_pvr(atom)); |
220 |
+ portvdb, atom->CATEGORY, atom->PF); |
221 |
if ((fp = fopen(buf, "r")) == NULL) { |
222 |
free(buf); |
223 |
return -1; |
224 |
@@ -293,7 +288,7 @@ qpkg_make(depend_atom *atom) |
225 |
xpaksize = st.st_size; |
226 |
|
227 |
snprintf(buf, buflen, "%s/%s/%s", |
228 |
- portvdb, atom->CATEGORY, atom_to_pvr(atom)); |
229 |
+ portvdb, atom->CATEGORY, atom->PF); |
230 |
xpak_argv[0] = buf; |
231 |
xpak_argv[1] = NULL; |
232 |
xpak_create(AT_FDCWD, tbz2, 1, xpak_argv, 1, verbose); |
233 |
@@ -316,7 +311,7 @@ qpkg_make(depend_atom *atom) |
234 |
mkdir_p(buf, 0755); |
235 |
|
236 |
snprintf(buf, buflen, "%s/%s/%s.tbz2", |
237 |
- qpkg_bindir, atom->CATEGORY, atom_to_pvr(atom)); |
238 |
+ qpkg_bindir, atom->CATEGORY, atom->PF); |
239 |
if (rename(tbz2, buf)) { |
240 |
warnp("could not move '%s' to '%s'", tbz2, buf); |
241 |
free(buf); |