1 |
Add an egencache --update-pkg-desc-index example for users |
2 |
of app-portage/esearch to migrate to. |
3 |
|
4 |
Bug: https://bugs.gentoo.org/735626 |
5 |
Signed-off-by: Zac Medico <zmedico@g.o> |
6 |
--- |
7 |
cnf/repo.postsync.d/example | 15 ++++++++++++++- |
8 |
1 file changed, 14 insertions(+), 1 deletion(-) |
9 |
|
10 |
diff --git a/cnf/repo.postsync.d/example b/cnf/repo.postsync.d/example |
11 |
index 533bf719c..6c349ab3c 100644 |
12 |
--- a/cnf/repo.postsync.d/example |
13 |
+++ b/cnf/repo.postsync.d/example |
14 |
@@ -1,4 +1,4 @@ |
15 |
-#!/bin/sh |
16 |
+#!/bin/bash |
17 |
# Example /etc/portage/repo.postsync.d script. Make it executable (chmod +x) for |
18 |
# Portage to process it. |
19 |
# |
20 |
@@ -45,6 +45,19 @@ if [ -n "${repository_name}" ]; then |
21 |
ret=1 |
22 |
fi |
23 |
fi |
24 |
+ |
25 |
+ # Regenerate the metadata/pkg_desc_index file if needed. It's not |
26 |
+ # needed for https://gitweb.gentoo.org/repo/sync/gentoo.git which |
27 |
+ # provides a freshly generated copy. |
28 |
+ if [[ ! -e ${repository_path}/metadata/pkg_desc_index || ( |
29 |
+ -d ${repository_path}/metadata/md5-cache && |
30 |
+ -n "$(find "${repository_path}/metadata/md5-cache" -type f -newer "${repository_path}/metadata/pkg_desc_index" -print -quit)" ) ]]; then |
31 |
+ if ! egencache --update-pkg-desc-index --repo="${repository_name}" |
32 |
+ then |
33 |
+ echo "!!! egencache failed!" |
34 |
+ ret=1 |
35 |
+ fi |
36 |
+ fi |
37 |
fi |
38 |
|
39 |
# Return explicit status. |
40 |
-- |
41 |
2.25.3 |