1 |
slords |
1.1 |
diff -up smeserver-support-2.2.0/root/etc/e-smith/db/yum_repositories/migrate/25CentOSExcludes.migrate_excludes smeserver-support-2.2.0/root/etc/e-smith/db/yum_repositories/migrate/25CentOSExcludes |
2 |
|
|
--- smeserver-support-2.2.0/root/etc/e-smith/db/yum_repositories/migrate/25CentOSExcludes.migrate_excludes 2010-05-17 13:36:02.000000000 -0600 |
3 |
|
|
+++ smeserver-support-2.2.0/root/etc/e-smith/db/yum_repositories/migrate/25CentOSExcludes 2010-05-17 13:35:50.000000000 -0600 |
4 |
|
|
@@ -0,0 +1,26 @@ |
5 |
|
|
+{ |
6 |
|
|
+ my @add = split(/[,; ]+/, 'CENTOS_EXCLUDES'); |
7 |
|
|
+ my %remove = map { $_ => 1 } split(/[,; ]+/, 'CENTOS_REMOVE'); |
8 |
|
|
+ |
9 |
|
|
+ for my $name ( qw(base updates) ) |
10 |
|
|
+ { |
11 |
|
|
+ my $repo = $DB->get($name) or next; |
12 |
|
|
+ |
13 |
|
|
+ my @exclude = split(/,/, $repo->prop('Exclude') || ''); |
14 |
|
|
+ push @exclude, @add; |
15 |
|
|
+ @exclude = grep(!defined $remove{$_} && !/^CENTOS_/, @exclude); |
16 |
|
|
+ |
17 |
|
|
+ # remove duplicates |
18 |
|
|
+ undef %saw; |
19 |
|
|
+ @exclude = grep(!$saw{$_}++, @exclude); |
20 |
|
|
+ |
21 |
|
|
+ if ($#exclude >= 0) |
22 |
|
|
+ { |
23 |
|
|
+ $repo->set_prop('Exclude', join(',', @exclude)); |
24 |
|
|
+ } |
25 |
|
|
+ else |
26 |
|
|
+ { |
27 |
|
|
+ $repo->delete('Exclude'); |
28 |
|
|
+ } |
29 |
|
|
+ } |
30 |
|
|
+} |