1 |
commit: 55e07ef11873c874a3ccc4a9182889bc59f31475 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 27 22:42:38 2012 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 27 22:44:58 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/crossdev.git;a=commit;h=55e07ef1 |
7 |
|
8 |
crossdev: auto detect & enable thin-manifests |
9 |
|
10 |
If one of our source repos is using thin-manifests, automatically enable |
11 |
it in the crossdev one as well. |
12 |
|
13 |
URL: https://bugs.gentoo.org/404029 |
14 |
Reported-by: Jess Haas <gentoo <AT> jesshaas.com> |
15 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
16 |
|
17 |
--- |
18 |
crossdev | 24 +++++++++++++++++++++++- |
19 |
1 files changed, 23 insertions(+), 1 deletions(-) |
20 |
|
21 |
diff --git a/crossdev b/crossdev |
22 |
index faa48ed..45debb9 100755 |
23 |
--- a/crossdev |
24 |
+++ b/crossdev |
25 |
@@ -783,7 +783,7 @@ set_metadata() { |
26 |
local autogen_tag="# Autogenerated and managed by crossdev" |
27 |
local meta=${CROSSDEV_OVERLAY}/metadata |
28 |
local layout=${meta}/layout.conf |
29 |
- local d name masters |
30 |
+ local d name masters thin_manifests="false" |
31 |
|
32 |
mkdir -p "${meta}" |
33 |
if [[ -e ${layout} ]] ; then |
34 |
@@ -806,9 +806,30 @@ set_metadata() { |
35 |
fi |
36 |
[[ -z ${name} ]] && continue |
37 |
|
38 |
+ # If this repo has an eclass dir, mark it as a master |
39 |
if [[ -d ${d}/eclass ]] ; then |
40 |
has ${name} ${masters} || masters+=" ${name}" |
41 |
fi |
42 |
+ |
43 |
+ # If one of the overlays uses thin manifests, then turn it on |
44 |
+ if [[ -z ${this_manifests} ]] && has ${name} ${masters} && \ |
45 |
+ sed \ |
46 |
+ -e 's:#.*::' \ |
47 |
+ -e 's:^[[:space:]]*::' \ |
48 |
+ -e 's:[[:space:]]*$::' \ |
49 |
+ -e 's:[[:space:]]*=[[:space:]]*:=:' \ |
50 |
+ "${d}/metadata/layout.conf" 2>/dev/null | \ |
51 |
+ gawk -F= '{ |
52 |
+ if ($1 == "use-manifests") um = $2 |
53 |
+ if ($1 == "thin-manifests") tm = $2 |
54 |
+ } |
55 |
+ END { |
56 |
+ exit !(um != "false" && tm == "true") |
57 |
+ }' |
58 |
+ then |
59 |
+ einfo "enabling thin-manifests due to ${d}" |
60 |
+ this_manifests="use-manifests = true\nthin-manifests = true" |
61 |
+ fi |
62 |
done |
63 |
|
64 |
# write out that layout.conf! |
65 |
@@ -816,6 +837,7 @@ set_metadata() { |
66 |
${autogen_tag} |
67 |
# Delete the above line if you want to manage this file yourself |
68 |
masters =${masters} |
69 |
+ $(printf '%b' "${this_manifests}") |
70 |
EOF |
71 |
} |