--- rpms/smeserver-extrarepositories/contribs9/smeserver-extrarepositories.spec 2019/01/04 17:23:28 1.23 +++ rpms/smeserver-extrarepositories/contribs9/smeserver-extrarepositories.spec 2019/01/05 03:54:38 1.24 @@ -1,6 +1,6 @@ %define name smeserver-extrarepositories %define version 0.1 -%define release 18 +%define release 19 Summary: easy configuration of extra yum repo Name: %{name} Version: %{version} @@ -18,6 +18,10 @@ AutoReqProv: no Provides configuration for external yum repository comaptible with Koozali SME Server. %changelog +* Fri Jan 04 2019 Jean-Philipe Pialasse 0.1-19.sme +- improve zmrepo migrate fragment to avoid action if not needed. +- migrate fragment for openfusion + * Fri Jan 04 2019 John Crisp 0.1-18.sme - remove perl-version from pkg lists @@ -921,9 +925,9 @@ cat << 'EOF' >$RPM_BUILD_ROOT/etc/e-smi { my $repo = $DB->get($name) or next; my $BaseURL = $repo->prop('BaseURL') || ''; - $BaseURL =~ s/zmrepo.mehvc.com/zmrepo.zoneminder.com/g; - $repo->set_prop('BaseURL', $BaseURL); - $repo->delete('Exclude'); + if ($BaseURL =~ s/zmrepo.mehvc.com/zmrepo.zoneminder.com/g) + {$repo->set_prop('BaseURL', $BaseURL);} + $repo->delete('Exclude') if $repo->prop('delete'); } } @@ -936,8 +940,57 @@ cat << 'EOF' >$RPM_BUILD_ROOT/etc/e-smi { my $repo = $DB->get($name) or next; my $BaseURL = $repo->prop('BaseURL') || ''; - $BaseURL =~ s/centos\$/centos\/\$/g; - $repo->set_prop('BaseURL', $BaseURL); + if ($BaseURL =~ s/centos\$/centos\/\$/g) + {$repo->set_prop('BaseURL', $BaseURL);} + } + +} + +EOF + +cat << 'EOF' >$RPM_BUILD_ROOT/etc/e-smith/db/yum_repositories/migrate/10openfusion +{ + my @addexclude = split(/,/,"perl-Devel-StackTrace,perl-ExtUtils-MakeMaker,perl-List-MoreUtils,perl-Exporter-Tiny,perl-ExtUtils-Install,perl-parent"); + my %removeexclude = map { $_ => 1 } split(/[,; ]+/, 'perl-version'); + my @addinclude = split(/,/,"perl-Algorithm-C3,perl-App-cpanminus,perl-B-Hooks-EndOfScope,perl-B-Hooks-OP-Check,perl-CPAN-Metanoarch,perl-Carp,perl-Class-C3,perl-Class-Load,perl-Class-Load-XS,perl-Class-Method-Modifiers,perl-Class-Singleton,perl-Class-XSAccessor,perl-Clone-PP,perl-Data-Dumper-Concise,perl-Data-IEEE754,perl-Data-OptList,perl-Data-Printer,perl-Data-Validate-IP,perl-DateTime,perl-DateTime-Locale,perl-DateTime-TimeZone,perl-Devel-GlobalDestruction,perl-Dist-CheckConflicts,perl-Eval-Closure,perl-Exporter-Tiny,perl-ExtUtils-CBuilder,perl-ExtUtils-Install,perl-ExtUtils-Manifest,perl-File-HomeDir,perl-File-Which,perl-GeoIP2,perl-Hash-FieldHash,perl-IPC-Cmd,perl-Lexical-SealRequireHints,perl-List-AllUtils,perl-Locale-Maketext-Simple,perl-MRO-Compat,perl-Math-Int128,perl-Math-Int64,perl-MaxMind-DB-Common,perl-MaxMind-DB-Reader,perl-Module-Build,perl-Module-CoreList,perl-Module-Implementation,perl-Module-Load,perl-Module-Load-Conditional,perl-Module-Runtime,perl-Moo,perl-MooX-StrictConstructor,perl-MooX-Types-MooseLike,perl-Moose,perl-Net-Works,perl-Package-DeprecationManager,perl-Package-Stash,perl-Package-Stash-XS,perl-Params-Check,perl-Params-Classify,perl-Params-Validate,perl-Perl-OSType,perl-Role-Tiny,perl-Scalar-List-Utils,perl-Socket,perl-Sort-Naturally,perl-Sub-Exporter,perl-Sub-Exporter-Progressive,perl-Sub-Identify,perl-Sub-Install,perl-Sub-Name,perl-Sub-Quote,perl-Task-Weaken,perl-Term-ANSIColor,perl-Test-Warnings,perl-Throwable,perl-Try-Tiny,perl-Variable-Magic,perl-bareword-filehandles,perl-indirect,perl-multidimensional,perl-namespace-autoclean,perl-namespace-clean,perl-strictures,perl-Devel-StackTrace,perl-ExtUtils-MakeMaker,perl-List-MoreUtils,perl-parent"); + my %removeinclude = map { $_ => 1 } split(/[,; ]+/, ''); + + for my $name ( qw(openfusion) ) + { + my $repo = $DB->get($name) or next; + + my @exclude = split(/,/, $repo->prop('Exclude') || ''); + push @exclude, @addexclude; + @exclude = grep(!defined $removeexclude{$_} , @exclude); + # remove duplicates + undef %saw; + @exclude = grep(!$saw{$_}++, @exclude); + if ($#exclude >= 0) + { + $repo->set_prop('Exclude', join(',', @exclude)); + } + else + { + $repo->delete('Exclude'); + } + + my @include = split(/,/, $repo->prop('IncludePkgs') || ''); + push @include, @addinclude; + @include = grep(!defined $removeinclude{$_} , @include); + # remove duplicates + undef %saw; + @include = grep(!$saw{$_}++, @include); + if ($#include >= 0) + { + $repo->set_prop('IncludePkgs', join(',', @include)); + } + else + { + $repo->delete('IncludePkgs'); + } + + + } }