Accepting request 78305 from openSUSE:Tools

- more work on disabled subpackages, port from internal
  prepare_spec

- try to keep summary and group for cases like openldap2
  (bnc#624980)

OBS-URL: https://build.opensuse.org/request/show/78305
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/obs-service-format_spec_file?expand=0&rev=9
This commit is contained in:
Sascha Peilicke 2011-08-09 14:35:01 +00:00 committed by Git OBS Bridge
commit f933923c54
2 changed files with 33 additions and 17 deletions

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon Aug 8 14:05:45 UTC 2011 - ro@suse.com
- more work on disabled subpackages, port from internal
prepare_spec
-------------------------------------------------------------------
Mon Aug 1 17:29:28 CEST 2011 - ro@suse.de
- try to keep summary and group for cases like openldap2
(bnc#624980)
-------------------------------------------------------------------
Mon Jul 4 11:42:26 CEST 2011 - ro@suse.de

View File

@ -345,8 +345,10 @@ sub read_and_parse_old_spec {
warn "after: $_\n";
}
($current_package, $current_lang) = set_current_pkg ( $_ );
$disabled_packs->{$current_package} = 1 if $ifhandler->{"disabled"};
warn "$current_package is disabled\n" if $ifhandler->{"disabled"} && $debug;
if ($ifhandler->{"disabled"}) {
$disabled_packs->{$current_package} = 1;
warn "$current_package is disabled\n" if $debug;
}
next;
}
if ( /^%description\b/i ) {
@ -391,14 +393,16 @@ sub read_and_parse_old_spec {
next;
}
if ($current_section eq "header") {
my $c_pack = $current_package;
$c_pack .= "_disabled" if $ifhandler->{"disabled"};
if ( /^Summary\b\s*:\s*(.*)/i ) {
$replace_hash{"XXXSUMMARY $current_package"} = sprintf("%-16s%s","Summary:", $1);
push @oldspec, "XXXSUMMARY $current_package";
$replace_hash{"XXXSUMMARY $c_pack"} = sprintf("%-16s%s","Summary:", $1);
push @oldspec, "XXXSUMMARY $c_pack";
next;
}
if ( /^Group\b\s*:\s*(.*)/i ) {
$replace_hash{"XXXGROUP $current_package"} = sprintf("%-16s%s", "Group:", $1);
push @oldspec, "XXXGROUP $current_package";
$replace_hash{"XXXGROUP $c_pack"} = sprintf("%-16s%s", "Group:", $1);
push @oldspec, "XXXGROUP $c_pack";
next;
}
if ( /^Vendor:/ || /^Distribution:/ || /^Packager:/ ) {
@ -422,8 +426,8 @@ sub read_and_parse_old_spec {
$_ =~ s/^[^:]+:/BuildArch:/;
}
if ( /^Release\s*:\s*(.*)/i ) {
$pkg_release{$current_package} = $_;
$replace_hash{"XXXRELEASE $current_package"} = sprintf("%-16s%s","Release:", $1);
$pkg_release{$c_pack} = $_;
$replace_hash{"XXXRELEASE $c_pack"} = sprintf("%-16s%s","Release:", $1);
next;
}
if ( /^BuildRoot\s*:/i ) {
@ -431,13 +435,13 @@ sub read_and_parse_old_spec {
next;
}
if ( /^Copyright\s*:\s*(.*)/i || /^License\s*:\s*(.*)/i ) {
$replace_hash{"XXXLICENSE $current_package"} = sprintf("%-16s%s","License:", $1);
push @oldspec, "XXXLICENSE $current_package";
$replace_hash{"XXXLICENSE $c_pack"} = sprintf("%-16s%s","License:", $1);
push @oldspec, "XXXLICENSE $c_pack";
next;
}
if ( /^Url\s*:\s*(.*)/i ) {
$replace_hash{"XXXURL $current_package"} = sprintf("%-16s%s","Url:", $1);
push @oldspec, "XXXURL $current_package";
$replace_hash{"XXXURL $c_pack"} = sprintf("%-16s%s","Url:", $1);
push @oldspec, "XXXURL $c_pack";
next;
}
if ( m/$global_tags_re\s*(.*)/oi ) {
@ -448,11 +452,11 @@ sub read_and_parse_old_spec {
}
if ( /^Version:/ ) {
warn "found Version, section = $current_section\n" if $debug;
$version{$current_package} = $_;
$version{$current_package} =~ s/^Version:\s*(.*)\s*/$1/;
$replace_hash{"XXXVERSION $current_package"} = sprintf("%-16s%s","Version:",$version{$current_package});
push @oldspec, $replace_hash{"XXXVERSION $current_package"};
push @oldspec, "XXXRELEASE $current_package";
$version{$c_pack} = $_;
$version{$c_pack} =~ s/^Version:\s*(.*)\s*/$1/;
$replace_hash{"XXXVERSION $c_pack"} = sprintf("%-16s%s","Version:",$version{$c_pack});
push @oldspec, $replace_hash{"XXXVERSION $c_pack"};
push @oldspec, "XXXRELEASE $c_pack";
next;
}
}