diff -Nru obs-build-20180302/build obs-build-20180831/build --- obs-build-20180302/build 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build 2018-09-19 07:07:55.000000000 +0000 @@ -172,8 +172,6 @@ --no-checks Do not run checks (postbuild and %check) - --lint Run rpmlint after build. - --logfile logfile Capture build output to logfile. Defaults to .build.log in the build root for non-VM builds. @@ -332,7 +330,8 @@ --vm-disk-size SIZEINMB --vm-swap-size SIZEINMB --vm-disk-filesystem TYPE - Defaults for automatic setup of VM root/swap files + Defaults for automatic setup of VM root/swap files. + May get overruled by build config vmfstype build flag. --vm-memory SIZEINMB Set amount of RAM for VMs @@ -851,6 +850,7 @@ shift ;; -lint) + # OBSOLETE: just keeping it for compability DO_LINT=true ;; -baselibs) @@ -1308,6 +1308,10 @@ imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $RECIPEFILE imagetype) test "$imagetype" = product || BUILD_USER=root fi + # same with docker and fissile builds + if test "$BUILDTYPE" = docker -o "$BUILDTYPE" = fissile -o "$BUILDTYPE" = podman ; then + BUILD_USER=root + fi # fixup passwd/group if test $BUILD_USER = abuild ; then @@ -1458,7 +1462,7 @@ fi RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm" 2>/dev/null || true` -DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f -name "*.deb" 2>/dev/null || true` +DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f "(" -name "*.deb" -o -name "*.ddeb" -o -name "*.udeb" ")" 2>/dev/null || true` if test -n "$RPMS" -a -n "$BUILD_USER_ABUILD_USED" ; then recipe_check_file_owners diff -Nru obs-build-20180302/Build/Appimage.pm obs-build-20180831/Build/Appimage.pm --- obs-build-20180302/Build/Appimage.pm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/Build/Appimage.pm 2018-09-19 07:07:55.000000000 +0000 @@ -44,14 +44,21 @@ push @packdeps, $pkg; } } - if ($yml->{'build'}) { - for my $pkg (@{$yml->{'build'}->{'packages'} || {}}) { + if ($yml->{'build'} && $yml->{'build'}->{'packages'}) { + for my $pkg (@{$yml->{'build'}->{'packages'}}) { push @packdeps, $pkg; } } - $ret->{'deps'} = \@packdeps; + my @sources; + if ($yml->{'build'} && $yml->{'build'}->{'files'}) { + for my $source (@{$yml->{'build'}->{'files'}}) { + push @sources, $source; + } + } + $ret->{'sources'} = \@sources; + return $ret; } diff -Nru obs-build-20180302/Build/Deb.pm obs-build-20180831/Build/Deb.pm --- obs-build-20180302/Build/Deb.pm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/Build/Deb.pm 2018-09-19 07:07:55.000000000 +0000 @@ -186,11 +186,12 @@ local (*TMP, *TMP2); open(TMP, "+>", undef) or die("could not open tmpfile\n"); syswrite TMP, $data; - sysseek(TMP, 0, 0); my $pid = open(TMP2, "-|"); die("fork: $!\n") unless defined $pid; if (!$pid) { open(STDIN, "<&TMP"); + seek(STDIN, 0, 0); # these two lines are a workaround for a perl bug mixing up FD + sysseek(STDIN, 0, 0); exec($tool); die("$tool: $!\n"); } diff -Nru obs-build-20180302/Build/Docker.pm obs-build-20180831/Build/Docker.pm --- obs-build-20180302/Build/Docker.pm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/Build/Docker.pm 2018-09-19 07:07:55.000000000 +0000 @@ -39,7 +39,7 @@ if ($q ne "'" && $str =~ /\$/) { $str =~ s/\$([a-zA-Z0-9_]+|\{([^\}]+)\})/join(' ', @{$vars->{$2 || $1} || []})/ge; } - $str =~ s/([ \t\"\'\$])/sprintf("%%%02X", ord($1))/ge; + $str =~ s/([ \t\"\'\$\(\)])/sprintf("%%%02X", ord($1))/ge; return $str; } @@ -77,14 +77,20 @@ shift @args if $args[0] =~ /^--(?:from|repo|type)$/ || $args[0] =~ /^-[tr]$/; shift @args; } - push @{$ret->{'deps'}}, grep {/^[a-zA-Z_0-9]/} @args; + my @deps = grep {/^[a-zA-Z_0-9]/} @args; + s/^([^<=>]+)([<=>]+)/$1 $2 / for @deps; + push @{$ret->{'deps'}}, @deps; } elsif ($args[0] eq 'ar' || $args[0] eq 'addrepo') { shift @args; while (@args && $args[0] =~ /^-/) { shift @args if $args[0] =~ /^--(?:repo|type)$/ || $args[0] =~ /^-[rt]$/; shift @args; } - addrepo($ret, $args[0]) if @args; + if (@args) { + my $path = $args[0]; + $path =~ s/\/[^\/]*\.repo$//; + addrepo($ret, $path); + } } } @@ -180,7 +186,7 @@ } } elsif ($cmd eq 'RUN') { $line =~ s/#.*//; # get rid of comments - for my $l (split(/(?:\||\|\||\&|\&\&|;)/, $line)) { + for my $l (split(/(?:\||\|\||\&|\&\&|;|\)|\()/, $line)) { $l =~ s/^\s+//; $l =~ s/\s+$//; @args = split(/[ \t]+/, $l); @@ -230,11 +236,13 @@ push @repos, "{ \"url\": \"$annorepo->{'url'}\" }"; } } + my $buildtime = time(); print "{\n"; print " \"tags\": [ ".join(', ', @tags)." ]"; print ",\n \"repos\": [ ".join(', ', @repos)." ]" if @repos; print ",\n \"file\": \"$image\"" if defined $image; print ",\n \"disturl\": \"$disturl\"" if defined $disturl; + print ",\n \"buildtime\": $buildtime"; print "\n}\n"; } diff -Nru obs-build-20180302/Build/Kiwi.pm obs-build-20180831/Build/Kiwi.pm --- obs-build-20180302/Build/Kiwi.pm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/Build/Kiwi.pm 2018-09-19 07:07:55.000000000 +0000 @@ -32,17 +32,18 @@ return grep(delete($h{$_}), @_); } -sub findFallBackArchs { - my ($fallbackArchXML, $arch) = @_; - my @fa; - - for my $a (@{$fallbackArchXML->{'arch'}||[]}) { - if ( $a->{'id'} eq $arch && $a->{'fallback'} ) { - @fa = unify( $a->{'fallback'}, findFallBackArchs($fallbackArchXML, $a->{'fallback'})); - } +sub expandFallBackArchs { + my ($fallbackArchXML, @archs) = @_; + my %fallbacks; + for (@{$fallbackArchXML->{'arch'} || []}) { + $fallbacks{$_->{'id'}} = $_->{'fallback'} if $_->{id} && $_->{'fallback'}; + } + my @out; + while (@archs) { + push @out, shift @archs; + push @archs, delete $fallbacks{$out[-1]} if $fallbacks{$out[-1]}; } - - return @fa + return unify(@out); } # sles10 perl does not have the version.pm @@ -50,15 +51,166 @@ sub versionstring { my ($str) = @_; my $result = 0; - $result = $result * 100 + $_ for split (/\./, $str); + $result = $result * 100 + $_ for split (/\./, $str, 2); return $result; } +my $schemaversion56 = versionstring('5.6'); + +sub kiwiparse_product { + my ($kiwi, $xml, $arch, $buildflavor) = @_; + + my $ret = {}; + my @repos; + my %repoprio; # XXX: unused + my @packages; + my @requiredarch; + my @badarch; + my $obsexclusivearch; + my $obsexcludearch; + $obsexclusivearch = $1 if $xml =~ /^\s*\s*$/im; + $obsexcludearch = $1 if $xml =~ /^\s*\s*$/im; + + $ret->{'name'} = $kiwi->{'name'} if $kiwi->{'name'}; + $ret->{'filename'} = $kiwi->{'name'} if $kiwi->{'name'}; + my $description = (($kiwi->{'description'} || [])->[0]) || {}; + if (!$ret->{'name'} && $description->{'specification'}) { + $ret->{'name'} = $description->{'specification'}->[0]->{'_content'}; + } + + # parse the preferences section + my $preferences = $kiwi->{'preferences'} || []; + die("products must have exactly one preferences element\n") unless @$preferences == 1; + # take default version setting + if ($preferences->[0]->{'version'}) { + $ret->{'version'} = $preferences->[0]->{'version'}->[0]->{'_content'}; + } + die("products must have exactly one type element in the preferences\n") unless @{$preferences->[0]->{'type'} || []} == 1; + my $preftype = $preferences->[0]->{'type'}->[0]; + if (defined $preftype->{'image'}) { + # for kiwi 4.1 and 5.x + die("products must use type 'product'\n") unless $preftype->{'image'} eq 'product'; + } else { + # for kiwi 3.8 and before + die("products must use type 'product'\n") unless $preftype->{'_content'} eq 'product'; + } + push @packages, "kiwi-filesystem:$preftype->{'filesystem'}" if $preftype->{'filesystem'}; + die("boot type not supported in products\n") if defined $preftype->{'boot'}; + + my $instsource = ($kiwi->{'instsource'} || [])->[0]; + die("products must have an instsource element\n") unless $instsource; + + # get repositories + for my $repository (sort {$a->{priority} <=> $b->{priority}} @{$instsource->{'instrepo'} || []}) { + my $kiwisource = ($repository->{'source'} || [])->[0]; + if ($kiwisource->{'path'} eq 'obsrepositories:/') { + # special case, OBS will expand it. + push @repos, '_obsrepositories'; + next; + } + if ($kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/) { + push @repos, "$1/$2"; + } else { + my $prp; + $prp = $urlmapper->($kiwisource->{'path'}) if $urlmapper; + die("instsource repo url not using obs:/ scheme: $kiwisource->{'path'}\n") unless $prp; + push @repos, $prp; + } + } + + $ret->{'sourcemedium'} = -1; + $ret->{'debugmedium'} = -1; + if ($instsource->{'productoptions'}) { + my $productoptions = $instsource->{'productoptions'}->[0] || {}; + for my $po (@{$productoptions->{'productvar'} || []}) { + $ret->{'drop_repository'} = $po->{'_content'} if $po->{'name'} eq 'DROP_REPOSITORY'; + $ret->{'version'} = $po->{'_content'} if $po->{'name'} eq 'VERSION'; + } + for my $po (@{$productoptions->{'productoption'} || []}) { + $ret->{'sourcemedium'} = $po->{'_content'} if $po->{'name'} eq 'SOURCEMEDIUM'; + $ret->{'debugmedium'} = $po->{'_content'} if $po->{'name'} eq 'DEBUGMEDIUM'; + } + } + if ($instsource->{'architectures'}) { + my $architectures = $instsource->{'architectures'}->[0] || {}; + for my $ra (@{$architectures->{'requiredarch'} || []}) { + push @requiredarch, $ra->{'ref'} if defined $ra->{'ref'}; + } + } + + # Find packages and possible additional required architectures + my @additionalarchs; + my @pkgs; + push @pkgs, @{$instsource->{'metadata'}->[0]->{'repopackage'} || []} if $instsource->{'metadata'}; + push @pkgs, @{$instsource->{'repopackages'}->[0]->{'repopackage'} || []} if $instsource->{'repopackages'}; + @pkgs = unify(@pkgs); + for my $package (@pkgs) { + # filter packages, which are not targeted for the wanted plattform + if ($package->{'arch'}) { + my $valid; + for my $ma (@requiredarch) { + for my $pa (split(',', $package->{'arch'})) { + $valid = 1 if $ma eq $pa; + } + } + next unless $valid; + } + + # not nice, but optimizes our build dependencies + # FIXME: design a real blacklist option in kiwi + if ($package->{'onlyarch'} && $package->{'onlyarch'} eq 'skipit') { + push @packages, "-$package->{'name'}"; + next; + } + push @packages, "-$package->{'replaces'}" if $package->{'replaces'}; + + # we need this package + push @packages, $package->{'name'}; + + # find the maximal superset of possible required architectures + push @additionalarchs, split(',', $package->{'addarch'}) if $package->{'addarch'}; + push @additionalarchs, split(',', $package->{'onlyarch'}) if $package->{'onlyarch'}; + } + @requiredarch = unify(@requiredarch, @additionalarchs); + + #### FIXME: kiwi files have no informations where to get -32bit packages from + push @requiredarch, "i586" if grep {/^ia64/} @requiredarch; + push @requiredarch, "i586" if grep {/^x86_64/} @requiredarch; + push @requiredarch, "ppc" if grep {/^ppc64/} @requiredarch; + push @requiredarch, "s390" if grep {/^s390x/} @requiredarch; + + @requiredarch = expandFallBackArchs($instsource->{'architectures'}->[0], @requiredarch); + + push @packages, "kiwi-packagemanager:instsource"; + + push @requiredarch, split(' ', $obsexclusivearch) if $obsexclusivearch; + push @badarch , split(' ', $obsexcludearch) if $obsexcludearch; + + $ret->{'exclarch'} = [ unify(@requiredarch) ] if @requiredarch; + $ret->{'badarch'} = [ unify(@badarch) ] if @badarch; + $ret->{'deps'} = [ unify(@packages) ]; + $ret->{'path'} = [ unify(@repos) ]; + $ret->{'imagetype'} = [ 'product' ]; + for (@{$ret->{'path'} || []}) { + my @s = split('/', $_, 2); + $_ = {'project' => $s[0], 'repository' => $s[1]}; + $_->{'priority'} = $repoprio{"$s[0]/$s[1]"} if $repoextras && defined $repoprio{"$s[0]/$s[1]"}; + } + return $ret; +} + sub kiwiparse { - my ($xml, $arch, $count) = @_; + my ($xml, $arch, $buildflavor, $count) = @_; $count ||= 0; die("kiwi config inclusion depth limit reached\n") if $count++ > 10; + my $kiwi = Build::SimpleXML::parse($xml); + die("not a kiwi config\n") unless $kiwi && $kiwi->{'image'}; + $kiwi = $kiwi->{'image'}->[0]; + + # check if this is a product, we currently test for the 'instsource' element + return kiwiparse_product($kiwi, $xml, $arch, $buildflavor) if $kiwi->{'instsource'}; + my $ret = {}; my @types; my @repos; @@ -67,28 +219,57 @@ my @containerrepos; my @packages; my @extrasources; - my @requiredarch; - my @badarch; - my $schemaversion = 0; - my $schemaversion56 = versionstring('5.6'); my $obsexclusivearch; my $obsexcludearch; my $obsprofiles; $obsexclusivearch = $1 if $xml =~ /^\s*\s*$/im; $obsexcludearch = $1 if $xml =~ /^\s*\s*$/im; $obsprofiles = $1 if $xml =~ /^\s*\s*$/im; - my @obsprofiles; - @obsprofiles = split(' ', $obsprofiles) if $obsprofiles; - my $kiwi = Build::SimpleXML::parse($xml); - die("not a kiwi config\n") unless $kiwi && $kiwi->{'image'}; - $kiwi = $kiwi->{'image'}->[0]; - $schemaversion = versionstring($kiwi->{'schemaversion'}) if $kiwi->{'schemaversion'}; + if ($obsprofiles) { + $obsprofiles = [ grep {defined($_)} map {$_ eq '@BUILD_FLAVOR@' ? $buildflavor : $_} split(' ', $obsprofiles) ]; + } + my $schemaversion = $kiwi->{'schemaversion'} ? versionstring($kiwi->{'schemaversion'}) : 0; $ret->{'name'} = $kiwi->{'name'} if $kiwi->{'name'}; $ret->{'filename'} = $kiwi->{'name'} if $kiwi->{'name'}; my $description = (($kiwi->{'description'} || [])->[0]) || {}; if (!$ret->{'name'} && $description->{'specification'}) { $ret->{'name'} = $description->{'specification'}->[0]->{'_content'}; } + + # usedprofiles also include direct wanted profile targets and indirect required profiles + my %usedprofiles; + # obsprofiles arch filtering + if ($obsprofiles && $arch && $kiwi->{'profiles'} && $kiwi->{'profiles'}->[0]->{'profile'}) { + my %obsprofiles = map {$_ => 1} @$obsprofiles; + for my $prof (@{$kiwi->{'profiles'}[0]->{'profile'}}) { + next unless $prof->{'name'} && exists $obsprofiles{$prof->{'name'}}; + my $valid; + if ($prof->{'arch'}) { + my $ma = $arch; + $ma =~ s/i[456]86/i386/; + for my $pa (split(",", $prof->{'arch'})) { + $pa =~ s/i[456]86/i386/; + $valid = 1 if $ma eq $pa; + } + } else { + $valid = 1; + } + if ($valid) { + $obsprofiles{$prof->{'name'}} = 2; + } elsif ($obsprofiles{$prof->{'name'}} == 1) { + $obsprofiles{$prof->{'name'}} = 0; + } + } + $obsprofiles = [ grep {$obsprofiles{$_}} @$obsprofiles ]; + for my $prof (@{$kiwi->{'profiles'}[0]->{'profile'}}) { + next unless $obsprofiles{$prof->{'name'}}; + $usedprofiles{$prof->{'name'}} = 1; + for my $req (@{$prof->{'requires'}}) { + $usedprofiles{$req->{'profile'}} = 1; + } + } + } + # take default version setting my $preferences = ($kiwi->{'preferences'} || []); if ($preferences->[0]->{'version'}) { @@ -96,6 +277,9 @@ } my $containerconfig; for my $pref (@{$preferences || []}) { + if ($obsprofiles && $pref->{'profiles'}) { + next unless grep {$usedprofiles{$_}} split(",", $pref->{'profiles'}); + } for my $type (@{$pref->{'type'} || []}) { next unless @{$pref->{'type'}} == 1 || !$type->{'optional'}; if (defined $type->{'image'}) { @@ -113,25 +297,28 @@ if ($type->{'derived_from'}) { my $derived = $type->{'derived_from'}; my ($name, $prp); - if ($derived =~ /^obs:\/{1,3}([^\/]+)\/([^\/]+)\/(.*)(?:#([^\#\/]+))$/) { - $name = defined($4) ? "$3:$4" : "$3"; + if ($derived =~ /^obs:\/{1,3}([^\/]+)\/([^\/]+)\/(.*?)(?:#([^\#\/]+))?$/) { + $name = defined($4) ? "$3:$4" : "$3:latest"; $prp = "$1/$2"; - } elsif ($derived =~ /^obsrepositories:\/{1,3}([^\/].*)(?:#([^\#\/]+))$/) { - $name = defined($2) ? "$1:$2" : "$1"; - } elsif ($derived !~ /^file:/ && $derived =~ /^(.*)\/([^\/]+)(?:#([^\#\/]+))$/) { + } elsif ($derived =~ /^obsrepositories:\/{1,3}([^\/].*?)(?:#([^\#\/]+))?$/) { + $name = defined($2) ? "$1:$2" : "$1:latest"; + } elsif ($derived =~ /^file:/) { + next; # just ignore and hope + } elsif ($derived =~ /^(.*)\/([^\/]+?)(?:#([^\#\/]+))?$/) { my $url = $1; - $name = defined($3) ? "$2:$3" : "$2"; + $name = defined($3) ? "$2:$3" : "$2:latest"; $prp = $urlmapper->($url) if $urlmapper; # try again with one element moved from url to name - if (!$prp && $derived =~ /^(.*)\/([^\/]+\/[^\/]+)(?:#([^\#\/]+))$/) { + if (!$prp && $derived =~ /^(.*)\/([^\/]+\/[^\/]+?)(?:#([^\#\/]+))?$/) { $url = $1; - $name = defined($3) ? "$2:$3" : "$2"; + $name = defined($3) ? "$2:$3" : "$2:latest"; $prp = $urlmapper->($url) if $urlmapper; } - die("derived_from url not using obs:/ scheme: $derived\n") unless $prp; + undef $name unless $prp; } - push @packages, "container:$name" if defined $name; - push @containerrepos, $prp if $prp; + die("derived_from url not using obs:/ scheme: $derived\n") unless defined $name; + push @packages, "container:$name"; + push @containerrepos, $prp if $prp; } push @packages, "kiwi-filesystem:$type->{'filesystem'}" if $type->{'filesystem'}; @@ -141,7 +328,7 @@ my ($bootxml, $xsrc) = $bootcallback->($1, $2); next unless $bootxml; push @extrasources, $xsrc if $xsrc; - my $bret = kiwiparse($bootxml, $arch, $count); + my $bret = kiwiparse($bootxml, $arch, $buildflavor, $count); push @bootrepos, map {"$_->{'project'}/$_->{'repository'}"} @{$bret->{'path'} || []}; push @packages, @{$bret->{'deps'} || []}; push @extrasources, @{$bret->{'extrasource'} || []}; @@ -153,44 +340,7 @@ } } - my $instsource = ($kiwi->{'instsource'} || [])->[0]; - if ($instsource) { - for my $repository(sort {$a->{priority} <=> $b->{priority}} @{$instsource->{'instrepo'} || []}) { - my $kiwisource = ($repository->{'source'} || [])->[0]; - if ($kiwisource->{'path'} eq 'obsrepositories:/') { - # special case, OBS will expand it. - push @repos, '_obsrepositories'; - next; - } - if ($kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/) { - push @repos, "$1/$2"; - } else { - my $prp; - $prp = $urlmapper->($kiwisource->{'path'}) if $urlmapper; - die("instsource repo url not using obs:/ scheme: $kiwisource->{'path'}\n") unless $prp; - push @repos, $prp; - } - } - $ret->{'sourcemedium'} = -1; - $ret->{'debugmedium'} = -1; - if ($instsource->{'productoptions'}) { - my $productoptions = $instsource->{'productoptions'}->[0] || {}; - for my $po (@{$productoptions->{'productvar'} || []}) { - $ret->{'drop_repository'} = $po->{'_content'} if $po->{'name'} eq 'DROP_REPOSITORY'; - $ret->{'version'} = $po->{'_content'} if $po->{'name'} eq 'VERSION'; - } - for my $po (@{$productoptions->{'productoption'} || []}) { - $ret->{'sourcemedium'} = $po->{'_content'} if $po->{'name'} eq 'SOURCEMEDIUM'; - $ret->{'debugmedium'} = $po->{'_content'} if $po->{'name'} eq 'DEBUGMEDIUM'; - } - } - if ($instsource->{'architectures'}) { - my $a = $instsource->{'architectures'}->[0] || {}; - for my $ra (@{$a->{'requiredarch'} || []}) { - push @requiredarch, $ra->{'ref'} if defined $ra->{'ref'}; - } - } - } + die("image contains 'product' type\n") if grep {$_ eq 'product'} @types; my $packman = $preferences->[0]->{'packagemanager'}->[0]->{'_content'} || ''; @@ -231,12 +381,19 @@ $repoprio{$prp} = $repository->{'sortprio'} if defined $repository->{'priority'}; } - # Find packages and possible additional required architectures - my @additionalarchs; + # Find packages for the image my @pkgs; my $patterntype; for my $packages (@{$kiwi->{'packages'}}) { next if $packages->{'type'} && $packages->{'type'} ne 'image' && $packages->{'type'} ne 'bootstrap'; + # we could skip the sections also when no profile is used, + # but don't to stay backward compatible + if ($obsprofiles && $packages->{'profiles'}) { + my @section_profiles = split(",", $packages->{'profiles'}); + + next unless grep {$usedprofiles{$_}} @section_profiles; + } + $patterntype ||= $packages->{'patternType'}; push @pkgs, @{$packages->{'package'}} if $packages->{'package'}; for my $pattern (@{$kiwi->{'namedCollection'} || []}) { @@ -253,78 +410,30 @@ } } $patterntype ||= 'onlyRequired'; - if ($instsource) { - push @pkgs, @{$instsource->{'metadata'}->[0]->{'repopackage'} || []} if $instsource->{'metadata'}; - push @pkgs, @{$instsource->{'repopackages'}->[0]->{'repopackage'} || []} if $instsource->{'repopackages'}; - } @pkgs = unify(@pkgs); for my $package (@pkgs) { - # filter packages, which are not targeted for the wanted plattform + # filter packages which are not targeted for the wanted plattform if ($package->{'arch'}) { my $valid; - if (@requiredarch) { - # this is a product - for my $ma (@requiredarch) { - for my $pa (split(",", $package->{'arch'})) { - $valid = 1 if $ma eq $pa; - } - } - } else { - # live appliance - my $ma = $arch; - $ma =~ s/i[456]86/i386/; - for my $pa (split(",", $package->{'arch'})) { - $pa =~ s/i[456]86/i386/; - $valid = 1 if $ma eq $pa; - } + my $ma = $arch; + $ma =~ s/i[456]86/i386/; + for my $pa (split(",", $package->{'arch'})) { + $pa =~ s/i[456]86/i386/; + $valid = 1 if $ma eq $pa; } next unless $valid; } - - # not nice, but optimizes our build dependencies - # FIXME: design a real blacklist option in kiwi - if ($package->{'onlyarch'} && $package->{'onlyarch'} eq "skipit") { - push @packages, "-".$package->{'name'}; - next; - } # handle replaces as buildignore - if ($package->{'replaces'}) { - push @packages, "-".$package->{'replaces'}; - } + push @packages, "-$package->{'replaces'}" if $package->{'replaces'}; # we need this package push @packages, $package->{'name'}; - - # find the maximal superset of possible required architectures - push @additionalarchs, split(',', $package->{'addarch'}) if $package->{'addarch'}; - push @additionalarchs, split(',', $package->{'onlyarch'}) if $package->{'onlyarch'}; - } - @requiredarch = unify(@requiredarch, @additionalarchs); - - #### FIXME: kiwi files have no informations where to get -32bit packages from - push @requiredarch, "i586" if grep {/^ia64/} @requiredarch; - push @requiredarch, "i586" if grep {/^x86_64/} @requiredarch; - push @requiredarch, "ppc" if grep {/^ppc64/} @requiredarch; - push @requiredarch, "s390" if grep {/^s390x/} @requiredarch; - - my @fallbackarchs; - for my $arch (@requiredarch) { - push @fallbackarchs, findFallBackArchs($instsource->{'architectures'}[0], $arch) if $instsource->{'architectures'}[0]; - } - @requiredarch = unify(@requiredarch, @fallbackarchs); - - if (!$instsource) { - push @packages, "kiwi-packagemanager:$packman"; - push @packages, "--dorecommends--", "--dosupplements--" if $patterntype && $patterntype eq 'plusRecommended'; - } else { - push @packages, "kiwi-packagemanager:instsource"; } + push @packages, "kiwi-packagemanager:$packman"; + push @packages, "--dorecommends--", "--dosupplements--" if $patterntype && $patterntype eq 'plusRecommended'; - push @requiredarch, split(' ', $obsexclusivearch) if $obsexclusivearch; - push @badarch , split(' ', $obsexcludearch) if $obsexcludearch; - - $ret->{'exclarch'} = [ unify(@requiredarch) ] if @requiredarch; - $ret->{'badarch'} = [ unify(@badarch) ] if @badarch; + $ret->{'exclarch'} = [ unify(split(' ', $obsexclusivearch)) ] if $obsexclusivearch; + $ret->{'badarch'} = [ unify(split(' ', $obsexcludearch)) ] if $obsexcludearch; $ret->{'deps'} = [ unify(@packages) ]; $ret->{'path'} = [ unify(@repos, @bootrepos) ]; $ret->{'containerpath'} = [ unify(@containerrepos) ] if @containerrepos; @@ -340,7 +449,7 @@ $_ = {'project' => $s[0], 'repository' => $s[1]}; } $ret->{'imagerepos'} = \@imagerepos if @imagerepos; - if (!$instsource && $containerconfig) { + if ($containerconfig) { my $containername = $containerconfig->{'name'}; my $containertags = $containerconfig->{'tag'}; $containertags = [ $containertags ] if defined($containertags) && !ref($containertags); @@ -353,7 +462,13 @@ $containertags = [ "$containername:latest" ] if defined($containername) && !$containertags; $ret->{'container_tags'} = $containertags if $containertags; } - $ret->{'profiles'} = [ unify(@obsprofiles) ] if @obsprofiles; + if ($obsprofiles) { + if (@$obsprofiles) { + $ret->{'profiles'} = [ unify(@$obsprofiles) ]; + } else { + $ret->{'exclarch'} = []; # all profiles excluded + } + } return $ret; } @@ -367,34 +482,42 @@ close F; $cf ||= {}; my $d; - eval { - $d = kiwiparse($xml, ($cf->{'arch'} || '')); - }; + eval { $d = kiwiparse($xml, ($cf->{'arch'} || ''), $cf->{'buildflavor'}, 0) }; if ($@) { my $err = $@; - $err =~ s/^\n$//s; + chomp $err; return {'error' => $err}; } return $d; } sub show { - my ($fn, $field, $arch) = @ARGV; + my ($fn, $field, $arch, $buildflavor) = @ARGV; local $urlmapper = sub { return $_[0] }; my $cf = {'arch' => $arch}; + $cf->{'buildflavor'} = $buildflavor if defined $buildflavor; my $d = parse($cf, $fn); die("$d->{'error'}\n") if $d->{'error'}; + if ($field eq 'profiles' && $d->{'exclarch'} && !@{$d->{'exclarch'}}) { + print "__excluded\n"; + return; + } my $x = $d->{$field}; $x = [ $x ] unless ref $x; print "@$x\n"; } sub showcontainerinfo { - my $disturl; + my ($disturl, $arch, $buildflavor); (undef, $disturl) = splice(@ARGV, 0, 2) if @ARGV > 2 && $ARGV[0] eq '--disturl'; + (undef, $arch) = splice(@ARGV, 0, 2) if @ARGV > 2 && $ARGV[0] eq '--arch'; + (undef, $buildflavor) = splice(@ARGV, 0, 2) if @ARGV > 2 && $ARGV[0] eq '--buildflavor'; my ($fn, $image) = @ARGV; local $urlmapper = sub { return $_[0] }; - my $d = parse({}, $fn); + my $cf = {}; + $cf->{'arch'} = $arch if defined $arch; + $cf->{'buildflavor'} = $buildflavor if defined $buildflavor; + my $d = parse($cf, $fn); die("$d->{'error'}\n") if $d->{'error'}; $image =~ s/.*\/// if defined $image; my $release; @@ -408,6 +531,7 @@ push @repos, "{ \"url\": \"$repo->{'url'}\" }"; } } + my $buildtime = time(); print "{\n"; print " \"name\": \"$d->{'name'}\""; print ",\n \"version\": \"$d->{'version'}\"" if defined $d->{'version'}; @@ -416,6 +540,7 @@ print ",\n \"repos\": [ ".join(', ', @repos)." ]" if @repos; print ",\n \"file\": \"$image\"" if defined $image; print ",\n \"disturl\": \"$disturl\"" if defined $disturl; + print ",\n \"buildtime\": $buildtime"; print "\n}\n"; } @@ -425,7 +550,6 @@ return {}; } - sub queryhdrmd5 { my ($bin) = @_; die("Build::Kiwi::queryhdrmd5 unimplemented.\n"); diff -Nru obs-build-20180302/Build/Rpm.pm obs-build-20180831/Build/Rpm.pm --- obs-build-20180302/Build/Rpm.pm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/Build/Rpm.pm 2018-09-19 07:07:55.000000000 +0000 @@ -218,7 +218,7 @@ $ret->{'error'} = "open $specfile: $!"; return $ret; } - my @macros = @{$config->{'macros'}}; + my @macros = @{$config->{'macros'} || []}; my $skip = 0; my $main_preamble = 1; my $preamble = 1; @@ -580,6 +580,7 @@ next; } elsif ($preamble && $line =~ /^(Source\d*|Patch\d*|Url|Icon)\s*:\s*(\S+)/i) { my ($tag, $val) = (lc($1), $2); + $macros{$tag} = $val if $tag eq 'url'; # associate url and icon tags with the corresponding subpackage $tag .= scalar @subpacks if ($tag eq 'url' || $tag eq 'icon') && @subpacks; if ($tag =~ /icon/) { @@ -592,6 +593,8 @@ my $num = defined($2) ? $2 : ($1 eq 'source' ? 0 : -1); $macros{uc($1) . "URL$num"} = $val if $num >= 0; } + } elsif (!$preamble && ($line =~ /^(Source\d*|Patch\d*|Url|Icon|BuildRequires|BuildPrereq|BuildConflicts|\#\!BuildIgnore)\s*:\s*(\S.*)$/i)) { + print STDERR "Warning: spec file parser ".($lineno ? " line $lineno" : '').": Ignoring $1 used beyond the preamble.\n" if $config->{'warnings'}; } if ($line =~ /^\s*%package\s+(-n\s+)?(\S+)/) { @@ -1189,16 +1192,14 @@ my ($d) = @_; my $n = ''; my $bl = 0; - while ($d =~ /^([^ ,\)]+)/) { + while ($d =~ /^([^ ,\(\)]*)/) { $n .= $1; - $d = substr($d, length($n)); - if ($d =~ /^\(/) { - $n .= '('; - $bl++; - $d = substr($d, 1); - } elsif ($d =~ /\)/) { - last if $bl-- <= 0; - } + $d = substr($d, length($1)); + last unless $d =~ /^([\(\)])/; + $bl += $1 eq '(' ? 1 : -1; + last if $bl < 0; + $n .= $1; + $d = substr($d, 1); } return $n; } @@ -1272,7 +1273,7 @@ my $r1 = testcaseformat_rec($r->[1], 1); if (($op == 3 || $op == 4) && @$r == 4) { $r1 = "$r1 $top " . testcaseformat_rec($r->[2], 1); - $top = 'ELSE'; + $top = ''; } my $addparens2 = 1; $addparens2 = 0 if $r->[2]->[0] == $op && ($op == 1 || $op == 2 || $op == 6); diff -Nru obs-build-20180302/build-pkg-arch obs-build-20180831/build-pkg-arch --- obs-build-20180302/build-pkg-arch 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-pkg-arch 2018-09-19 07:07:55.000000000 +0000 @@ -50,7 +50,7 @@ # https://bbs.archlinux.org/viewtopic.php?id=129661 (cd $BUILD_ROOT/etc && sed -i "s/^CheckSpace/#CheckSpace/g" pacman.conf) # -d -d disables deps checking - ( cd $BUILD_ROOT && chroot $BUILD_ROOT pacman -U --force -d -d --noconfirm .init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \ + ( cd $BUILD_ROOT && chroot $BUILD_ROOT pacman -U --overwrite '*' -d -d --noconfirm .init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \ perl -ne '$|=1;/^(warning: could not get filesystem information for |loading packages|looking for inter-conflicts|looking for conflicting packages|Targets |Total Installed Size: |Net Upgrade Size: |Proceed with installation|checking package integrity|loading package files|checking for file conflicts|checking keyring|Packages \(\d+\)|:: Proceed with installation|:: Processing package changes|checking available disk space|installing |upgrading |warning:.*is up to date -- reinstalling|Optional dependencies for| )/||/^$/||print' } diff -Nru obs-build-20180302/build-pkg-deb obs-build-20180831/build-pkg-deb --- obs-build-20180302/build-pkg-deb 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-pkg-deb 2018-09-19 07:07:55.000000000 +0000 @@ -48,7 +48,6 @@ :>> $BUILD_ROOT/var/lib/dpkg/available :>> $BUILD_ROOT/var/log/dpkg.log :>> $BUILD_ROOT/etc/ld.so.conf - :>> $BUILD_ROOT/etc/default/rcS } pkg_initdb_deb() { diff -Nru obs-build-20180302/Build.pm obs-build-20180831/Build.pm --- obs-build-20180302/Build.pm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/Build.pm 2018-09-19 07:07:55.000000000 +0000 @@ -504,6 +504,9 @@ 'system-packages:docker' => [ 'docker', ], + 'system-packages:podman' => [ + 'podman', 'buildah' + ], 'system-packages:fissile' => [ 'docker', # TODO: Add fissile here as soon as it is packaged ], @@ -612,12 +615,13 @@ @sysdeps = @{$config->{'substitute'}->{'system-packages:kiwi-image'} || []}; @sysdeps = @{$config->{'substitute'}->{'kiwi-setup:image'} || []} unless @sysdeps; @sysdeps = @{$subst_defaults{'system-packages:kiwi-image'} || []} unless @sysdeps; - push @sysdeps, @$extradeps if $extradeps; } elsif ($buildtype eq 'kiwi-product') { @sysdeps = @{$config->{'substitute'}->{'system-packages:kiwi-product'} || []}; @sysdeps = @{$config->{'substitute'}->{'kiwi-setup:product'} || []} unless @sysdeps; @sysdeps = @{$subst_defaults{'system-packages:kiwi-product'} || []} unless @sysdeps; - push @sysdeps, @$extradeps if $extradeps; + } elsif ($engine eq 'podman' && $buildtype eq 'docker') { + @sysdeps = @{$config->{'substitute'}->{'system-packages:podman'} || []} unless @sysdeps; + @sysdeps = @{$subst_defaults{'system-packages:podman'} || []} unless @sysdeps; } elsif ($buildtype eq 'docker') { @sysdeps = @{$config->{'substitute'}->{'system-packages:docker'} || []} unless @sysdeps; @sysdeps = @{$subst_defaults{'system-packages:docker'} || []} unless @sysdeps; @@ -628,7 +632,8 @@ @sysdeps = @{$config->{'substitute'}->{'system-packages:deltarpm'} || []}; @sysdeps = @{$subst_defaults{'system-packages:deltarpm'} || []} unless @sysdeps; } - return () unless @sysdeps; + return () unless @sysdeps; # no extra build environment used + push @sysdeps, @$extradeps if $extradeps; if ($config->{'expandflags:preinstallexpand'} && !$config->{'preinstallisexpanded'}) { my $err = expandpreinstalls($config); return (undef, $err) if $err; diff -Nru obs-build-20180302/build-recipe obs-build-20180831/build-recipe --- obs-build-20180302/build-recipe 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-recipe 2018-09-19 07:07:55.000000000 +0000 @@ -25,7 +25,7 @@ BUILDTYPE= KIWI_PARAMETERS= -for i in spec dsc kiwi arch collax preinstallimage simpleimage mock livebuild snapcraft debootstrap debbuild appimage docker fissile; do +for i in spec dsc kiwi arch collax preinstallimage simpleimage mock livebuild snapcraft debootstrap debbuild appimage docker podman fissile; do . "$BUILD_DIR/build-recipe-$i" done @@ -107,6 +107,9 @@ if test "$BUILDENGINE" = debbuild -a "$BUILDTYPE" = spec ; then BUILDTYPE=debbuild fi + if test "$BUILDENGINE" = podman -a "$BUILDTYPE" = docker ; then + BUILDTYPE=podman + fi } # expands all directories into files @@ -161,6 +164,13 @@ *.dsc) CFFORMAT=debian ;; *) CFFORMAT=rpm ;; esac + # add --emailonly option for sles builds + if test "$CFFORMAT" = rpm ; then + case `queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" eval '%{?is_opensuse}/%{?!fullname_in_changelog:%{?suse_version}}'` in + *[1-9]*/*) ;; + */*[1-9]*) CFFORMAT="$CFFORMAT --emailonly" ;; + esac + fi echo "running changelog2spec --target $CFFORMAT --file $1" if ! $BUILD_DIR/changelog2spec --target $CFFORMAT --file "$1" > $BUILD_ROOT/.build-changelog ; then rm -f $BUILD_ROOT/.build-changelog @@ -175,6 +185,7 @@ test "$BUILDTYPE" = appimage && return 0 test "$BUILDTYPE" = docker && return 0 test "$BUILDTYPE" = fissile && return 0 + test "$BUILDTYPE" = podman && return 0 egrep '^#[[:blank:]]*needsbinariesforbuild[[:blank:]]*$' >/dev/null <"$1" && return 0 return 1 } diff -Nru obs-build-20180302/build-recipe-debootstrap obs-build-20180831/build-recipe-debootstrap --- obs-build-20180302/build-recipe-debootstrap 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-recipe-debootstrap 2018-09-19 07:07:55.000000000 +0000 @@ -58,6 +58,7 @@ # adapt passwd if test $BUILD_USER = abuild ; then echo "abuild:x:${ABUILD_UID}:${ABUILD_GID}:Autobuild:/home/abuild:/bin/bash" >>$BUILD_ROOT/$myroot/etc/passwd + echo 'abuild:*:::::::' >>$BUILD_ROOT/$myroot/etc/shadow echo 'abuild:*::' >>$BUILD_ROOT/$myroot/etc/gshadow echo "abuild:x:${ABUILD_GID}:" >>$BUILD_ROOT/$myroot/etc/group mkdir -p $BUILD_ROOT/$myroot/home/abuild @@ -77,6 +78,10 @@ chroot $BUILD_ROOT/$myroot apt-cache gencaches + if ! test -e $BUILD_ROOT/$myroot/etc/hosts ; then + cp $BUILD_ROOT/etc/hosts $BUILD_ROOT/$myroot/etc/hosts + fi + # move topdir over mv "$BUILD_ROOT/$TOPDIR" "$BUILD_ROOT/$myroot/${TOPDIR%/*}" diff -Nru obs-build-20180302/build-recipe-docker obs-build-20180831/build-recipe-docker --- obs-build-20180302/build-recipe-docker 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-recipe-docker 2018-09-19 07:07:55.000000000 +0000 @@ -58,10 +58,18 @@ base_image_path=$(find containers -regextype egrep -regex ".*\.(tgz|tar|tar\.xz|tar\.gz)$" -print -quit) test -f "$base_image_path" || cleanup_and_exit 1 "base image not found" - if ! $BUILD_DIR/startdockerd --root "$BUILD_ROOT" --webserver "$TOPDIR/SOURCES/repos" ; then - cleanup_and_exit 1 + if test "$BUILDENGINE" = "podman"; then + DOCKER_TOOL="podman" + if ! $BUILD_DIR/startdockerd --root "$BUILD_ROOT" --webserver-only "$TOPDIR/SOURCES/repos" ; then + cleanup_and_exit 1 + fi + else + DOCKER_TOOL="docker" + if ! $BUILD_DIR/startdockerd --root "$BUILD_ROOT" --webserver "$TOPDIR/SOURCES/repos" ; then + cleanup_and_exit 1 + fi + DOCKERD_STARTED=true fi - DOCKERD_STARTED=true cp $BUILD_DIR/obs-docker-support "$BUILD_ROOT/$TOPDIR/SOURCES/.obs-docker-support" chmod 755 "$BUILD_ROOT/$TOPDIR/SOURCES/.obs-docker-support" @@ -78,11 +86,11 @@ # "docker import" it. if tar -tf $base_image_path | grep "^manifest.json" -q; then echo "Layered image found" - chroot $BUILD_ROOT docker load --input $TOPDIR/SOURCES/$base_image_path + chroot $BUILD_ROOT $DOCKER_TOOL load --input $TOPDIR/SOURCES/$base_image_path else echo "Filesystem image found" desired_tag=$(grep "^\s*FROM" "$RECIPEFILE" | cut -d" " -f2) - chroot $BUILD_ROOT docker import $TOPDIR/SOURCES/$base_image_path "$desired_tag" + chroot $BUILD_ROOT $DOCKER_TOOL import $TOPDIR/SOURCES/$base_image_path "$desired_tag" fi # Prepare the package repository @@ -118,13 +126,20 @@ done # patch in obs-docker-support helper - sed -i '/^[ ]*[fF][rR][oO][mM]/a COPY .obs-docker-support /usr/local/sbin/obs-docker-support\nRUN obs-docker-support --install' $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE + sed -i '/^[ ]*[fF][rR][oO][mM]/a COPY .obs-docker-support /usr/local/sbin/obs-docker-support\nRUN obs-docker-support --install' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" echo >> $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE - echo 'RUN obs-docker-support --uninstall' >> $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE + if test -n "$(sed -ne '/^[ ]*[uU][sS][eE][rR][ ]/p' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE")" ; then + sed -i '1,/^[ ]*[uU][sS][eE][rR][ ]/{ +/^[ ]*[uU][sS][eE][rR][ ]/i RUN obs-docker-support --uninstall +}' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" + else + echo 'RUN obs-docker-support --uninstall' >> "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" + fi + test -n "$DISTURL" && echo "LABEL org.openbuildservice.disturl=$DISTURL" >> "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" # now do the build echo "Building image $ALLTAGS" - if ! chroot $BUILD_ROOT docker build --network=host "${tagargs[@]}" -f "$TOPDIR/SOURCES/$RECIPEFILE" $TOPDIR/SOURCES/ ; then + if ! chroot $BUILD_ROOT $DOCKER_TOOL build --network=host "${tagargs[@]}" -f "$TOPDIR/SOURCES/$RECIPEFILE" $TOPDIR/SOURCES/ ; then cleanup_and_exit 1 "Docker build command failed" fi @@ -133,7 +148,7 @@ mkdir -p $BUILD_ROOT$TOPDIR/DOCKER FILENAME="$FIRSTTAG" FILENAME="${FILENAME//[\/:]/-}" - if ! chroot $BUILD_ROOT docker save --output "$TOPDIR/DOCKER/$FILENAME.tar" "$FIRSTTAG" ; then + if ! chroot $BUILD_ROOT $DOCKER_TOOL save --output "$TOPDIR/DOCKER/$FILENAME.tar" "$FIRSTTAG" ; then cleanup_and_exit 1 "Docker save command failed" fi diff -Nru obs-build-20180302/build-recipe-kiwi obs-build-20180831/build-recipe-kiwi --- obs-build-20180302/build-recipe-kiwi 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-recipe-kiwi 2018-09-19 07:07:55.000000000 +0000 @@ -373,7 +373,6 @@ # XXX: again? chroot "$BUILD_ROOT" chown -R abuild.abuild "$TOPDIR" chroot "$BUILD_ROOT" rm -rf "$TOPDIR/KIWIROOT" -set -x if test -x "$BUILD_ROOT/usr/bin/product-builder"; then # current implementation of product generation chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/bin/product-builder --root $TOPDIR/KIWIROOT $VERBOSE_OPTION --logfile terminal --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true @@ -392,7 +391,6 @@ chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/sbin/kiwi --root $TOPDIR/KIWIROOT $VERBOSE_OPTION --logfile terminal -p $TOPDIR/SOURCES --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true fi fi -set +x # move created product to destination # NOTE: older kiwi versions exit also in error case with 0 @@ -486,7 +484,7 @@ } # translate kiwi8 parameters to kiwi9 -translate_kiwi_parameters() { +kiwi_translate_parameters() { local i lasti local add_repo_url=() add_repo_type=() add_repo_alias=() add_repo_priority=() local set_repo_url set_repo_type set_repo_alias set_repo_priority @@ -525,6 +523,14 @@ --set-repopriority=*|--set-repoprio=*) set_repo_priority="${i#*=}" ;; --main:*) KIWI_MAIN_PARAMETERS="$KIWI_MAIN_PARAMETERS --${i#--main:}" ;; --bundle:*) KIWI_BUNDLE_PARAMETERS="$KIWI_BUNDLE_PARAMETERS --${i#--bundle:}" ;; + --set-container-derived-from=dir://./containers/*.tar) + # old kiwi 9 versions cannot handle uncompressed containers + if test -f "$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}" ; then + gzip -f -1 < "$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}" > "$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}.gz" || cleanup_and_exit 1 "container compression" + i="$i.gz" + fi + KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS $i" + ;; # everything else just gues through to kiwi build *) KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS $i" ;; esac @@ -543,6 +549,10 @@ fi } +kiwi_query_recipe() { + perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" "$1" "${BUILD_ARCH%%:*}" "$BUILD_FLAVOR" +} + build_kiwi_appliance() { if test -z "$RUNNING_IN_VM" ; then # NOTE: this must be done with the outer system, because it loads @@ -552,20 +562,19 @@ /etc/init.d/boot.device-mapper start fi local kiwi_profile - kiwi_profile=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" profiles) + kiwi_profile=$(kiwi_query_recipe profiles) if test -z "$kiwi_profile"; then kiwi_profile=$(queryconfig \ --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" \ --archpath "$BUILD_ARCH" buildflags kiwiprofile ) fi - # special build flavor hack - if test "$kiwi_profile" = '@BUILD_FLAVOR@' ; then - kiwi_profile="$BUILD_FLAVOR" - fi if test -z "$kiwi_profile"; then kiwi_profile=__not__set fi + if test "$kiwi_profile" = __excluded ; then + cleanup_and_exit 1 "none of the selected profiles can be built on this architecture" + fi local kiwi_path=/usr/bin/kiwi kiwi_legacy=false if ! test -L "$BUILD_ROOT/usr/bin/kiwi" ; then @@ -574,7 +583,7 @@ fi if test "$kiwi_legacy" != true ; then - translate_kiwi_parameters + kiwi_translate_parameters fi local run_bundle=true @@ -596,12 +605,40 @@ fi } +postprocess_kiwi_containers() { + local r + + # uncompress containers, the compression is useless and just slows down further processing + for r in $BUILD_ROOT/$TOPDIR/KIWI/*.tar.xz ; do + test -e "$r" || continue + r="${r%.xz}" + xzdec <"$r.xz" >"$r" || cleanup_and_exit 1 "xzdec failed" + if test -e "$r.xz.sha256" ; then + # also generate sha256sum + (cd "$BUILD_ROOT/$TOPDIR/KIWI" && sha256sum "${r##*/}") > "$r.sha256" + fi + rm -f "$r.xz" "$r.xz.sha256" + done + + # create container info + local disturlarg=() + test -n "$DISTURL" && disturlarg=("--disturl" "$DISTURL") + for r in $BUILD_ROOT/$TOPDIR/KIWI/*.tar ; do + test -e "$r" && perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::showcontainerinfo -- "${disturlarg[@]}" --arch "${BUILD_ARCH%%:*}" --buildflavor "$BUILD_FLAVOR" $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE "$r" > "${r%.tar}.containerinfo" + test -s "${r%.tar}.containerinfo" || rm -f "${r%.tar}.containerinfo" + done +} + recipe_build_kiwi() { - imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE imagetype) - imagename=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE filename) - imageversion=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE version) - drop_repo=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE drop_repository) + imagetype=$(kiwi_query_recipe imagetype) + imagename=$(kiwi_query_recipe filename) + imageversion=$(kiwi_query_recipe version) + drop_repo=$(kiwi_query_recipe drop_repository) + if test -z "$imagetype" ; then + cleanup_and_exit 1 "no imagetype set for this architecture/profile" + fi + # prepare rpms as source and createrepo on the repositories ln -sf $TOPDIR/SOURCES/repos $BUILD_ROOT/repos test -d $BUILD_ROOT/$TOPDIR/SOURCES/containers && ln -sf $TOPDIR/SOURCES/containers $BUILD_ROOT/containers @@ -676,18 +713,18 @@ # Hook for running post kiwi build scripts like QA scripts if installed if test -x $BUILD_ROOT/usr/lib/build/kiwi_post_run ; then - if ! chroot $BUILD_ROOT su -c /usr/lib/build/kiwi_post_run; then - echo "/usr/lib/build/kiwi_post_run script failed!" - cleanup_and_exit 1 - fi + if ! chroot $BUILD_ROOT su -c /usr/lib/build/kiwi_post_run ; then + cleanup_and_exit 1 "/usr/lib/build/kiwi_post_run script failed!" + fi fi - if test "$imagetype" = docker ; then - # get container info - disturlarg=() - test -n "$DISTURL" && disturlarg=("--disturl" "$DISTURL") - for r in $BUILD_ROOT/$TOPDIR/KIWI/*.tar.xz ; do - test -e "$r" && perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::showcontainerinfo -- "${disturlarg[@]}" $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE "$r" > "${r%.tar.xz}.containerinfo" + # postprocess docker images (but not for legacy kiwi) + if test -L "$BUILD_ROOT/usr/bin/kiwi" ; then + for imgtype in $imagetype ; do + if test "$imgtype" = docker ; then + postprocess_kiwi_containers + break + fi done fi } diff -Nru obs-build-20180302/build-recipe-livebuild obs-build-20180831/build-recipe-livebuild --- obs-build-20180302/build-recipe-livebuild 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-recipe-livebuild 2018-09-19 07:07:55.000000000 +0000 @@ -223,6 +223,9 @@ *.iso) build_results="${build_results}\n${i%%.iso}" ;; + *ONIE.bin) + build_results="${build_results}\n${i%%ONIE.bin}" + ;; *.img) build_results="${build_results}\n${i%%.img}" ;; @@ -242,15 +245,25 @@ cleanup_and_exit 1 "No live-build result found" fi - # move created products (and their metadata files) to destination + # move created products (and their metadata files) to destination and + # create sha256 hashsums local buildnum="${RELEASE:+-Build${RELEASE}}" for prefix in $(echo -e ${build_results} | sort | uniq) ; do for f in ${prefix}.* ; do mv ${f} \ $BUILD_ROOT/$TOPDIR/OTHER/${prefix##*/}${buildnum}${f#${prefix}} + # change directory to avoid having full path in hashsum file + pushd $BUILD_ROOT/$TOPDIR/OTHER >/dev/null + /usr/bin/sha256sum "${prefix##*/}${buildnum}${f#${prefix}}" > \ + "${prefix##*/}${buildnum}${f#${prefix}}".sha256 + popd >/dev/null BUILD_SUCCEEDED=true done done + + # copy recipe source tarball so that it can be published + cp "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" \ + "$BUILD_ROOT/$TOPDIR/OTHER/${RECIPEFILE%.livebuild}${buildnum}".livebuild.tar } recipe_resultdirs_livebuild() { diff -Nru obs-build-20180302/build-recipe-podman obs-build-20180831/build-recipe-podman --- obs-build-20180302/build-recipe-podman 1970-01-01 00:00:00.000000000 +0000 +++ obs-build-20180831/build-recipe-podman 2018-09-19 07:07:55.000000000 +0000 @@ -0,0 +1,51 @@ +# +# podman specific functions, wrapper around build_recipe_docker +# +################################################################ +# +# Copyright (c) 2015 SUSE Linux GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program (see the file COPYING); if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# +################################################################ + +recipe_setup_podman() { + recipe_setup_docker "$@" +} + +recipe_prepare_podman() { + recipe_prepare_docker "$@" +} + +recipe_build_podman() { + # podman refuses : in directories + find containers -type d -a -name '*:*' | while read i; do + mv "$i" "${i//:/_}" + done + # and filenames + find containers -type f -a -name '*:*' | while read i; do + mv "$i" "${i//:/_}" + done + recipe_build_docker "$@" +} + +recipe_resultdirs_podman() { + recipe_resultdirs_docker "$@" +} + +recipe_cleanup_podman() { + recipe_cleanup_docker "$@" +} + diff -Nru obs-build-20180302/build-recipe-preinstallimage obs-build-20180831/build-recipe-preinstallimage --- obs-build-20180302/build-recipe-preinstallimage 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-recipe-preinstallimage 2018-09-19 07:07:55.000000000 +0000 @@ -42,8 +42,9 @@ for DIR in .* * ; do case "$DIR" in .|..) continue ;; - .build.kernel*) ;; # to be packaged - .build.initrd*) ;; # to be packaged + .build.kernel.*) ;; # to be packaged + .build.hostarch.*) ;; # to be packaged + .build.initrd.*) ;; # to be packaged .build*) continue ;; .preinstallimage*) continue ;; .srcfiles*) continue ;; diff -Nru obs-build-20180302/build-vm obs-build-20180831/build-vm --- obs-build-20180302/build-vm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-vm 2018-09-19 07:07:55.000000000 +0000 @@ -33,6 +33,10 @@ vm_img_mkfs_reiserfs='mkreiserfs -q -f' vm_img_mkfs_btrfs='mkfs.btrfs' vm_img_mkfs_xfs='mkfs.xfs -f' +# ignore not backward compatible ext fs options like metadata_csum +# Only protecting nonroot from root inside guest -> but anyone can be root inside guest +# so disabling spectre/meltdown mitigations doesn't hurt security and gains performance +vm_linux_kernel_parameter="ext4.allow_unsupported=1 kpti=off pti=off spectre_v2=off" # guest visible devices VM_ROOTDEV=/dev/hda1 @@ -355,7 +359,7 @@ vm_wipe_$VM_TYPE "$@" if test -n "$VM_ROOT" -a "$VM_ROOT_TYPE" = file ; then - rm -f "$VM_ROOT" "${VM_ROOT}.monitor" + rm -f "$VM_ROOT" fi if test -n "$VM_SWAP" -a "$VM_SWAP_TYPE" = file ; then rm -f "$VM_SWAP" @@ -429,7 +433,7 @@ WATCHDOG_TIMEOUT=300 BUILD_OPTIONS_PARSED= while sleep 5 ; do - WATCH=`grep -a "### VM INTERACTION" "$LOGFILE" | tail -n 1` + WATCH=$(grep -a "### VM INTERACTION" "$LOGFILE" | tr '\0' a | tail -n 1) case $WATCH in *VM\ INTERACTION\ START*) test -n "$WATCHDOG_START" || WATCHDOG_START=`date +%s` ;; *VM\ INTERACTION\ END*) WATCHDOG_START= ;; @@ -599,13 +603,21 @@ date -s `cat /.build/.date` fi + # Enable Core dump generation + mkdir -p "$BUILD_ROOT/.build/cores" + echo "/.build/cores/%p" > /proc/sys/kernel/core_pattern + return 0 } vm_set_filesystem_type() { - if test -z "$VMDISK_FILESYSTEM" -a -n "$BUILD_DIST" ; then - VMDISK_FILESYSTEM=`queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags vmfstype` - fi + vmfstype="" + if test -n "$BUILD_DIST" ; then + # testing for build specific filesystem, which are more important then worker defaults + vmfstype=`queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags vmfstype` + fi + test -n "$vmfstype" && VMDISK_FILESYSTEM="$vmfstype" + # use either commandline specified fs or ext3 as fallback test -n "$VMDISK_FILESYSTEM" || VMDISK_FILESYSTEM=ext3 } @@ -776,7 +788,7 @@ if ! test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then rm -rf "$BUILD_ROOT/.build-srcdir" mkdir "$BUILD_ROOT/.build-srcdir" - if test "$BUILDTYPE" = kiwi -o "$BUILDTYPE" = docker -o "$BUILDTYPE" = fissile ; then + if test "$BUILDTYPE" = kiwi -o "$BUILDTYPE" = docker -o "$BUILDTYPE" = fissile -o "$BUILDTYPE" = podman ; then cp -pRL "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir else cp -p "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir @@ -917,7 +929,7 @@ vm_attach_root if test -n "$VM_SWAP" ; then vm_attach_swap - BUILDSTATUS=`dd if="$VM_SWAP" bs=12 count=1 2>/dev/null` + BUILDSTATUS=$(dd if="$VM_SWAP" bs=12 count=1 2>/dev/null | tr '\0' a) case $BUILDSTATUS in BUILDSTATUS[02]) mkdir -p $BUILD_ROOT/.build.packages @@ -993,7 +1005,7 @@ echo "... saving built packages" swapoff "$VM_SWAP" pushd "$BUILD_ROOT$TOPDIR" >/dev/null - find "$@" -print0 | computeblocklists --padstart 512 --padend 512 -v --manifest - -0 > "$VM_SWAP" + find "$@" -print0 | computeblocklists --padstart 512 --padend 512 -v --manifest - -0 > "$VM_SWAP" || cleanup_and_exit 1 popd >/dev/null fi } diff -Nru obs-build-20180302/build-vm-docker obs-build-20180831/build-vm-docker --- obs-build-20180302/build-vm-docker 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-vm-docker 2018-09-19 07:07:55.000000000 +0000 @@ -32,7 +32,7 @@ docker rm "$name" >/dev/null 2>&1 || true docker run \ --rm --name "$name" --cap-add=sys_admin --cap-add=MKNOD --net=none \ - -v "$BUILD_ROOT:/mnt" busybox /bin/chroot /mnt "$vm_init_script" + --mount "type=bind,source=$BUILD_ROOT,destination=/mnt" busybox /bin/chroot /mnt "$vm_init_script" BUILDSTATUS="$?" test "$BUILDSTATUS" != 255 || BUILDSTATUS=3 cleanup_and_exit "$BUILDSTATUS" diff -Nru obs-build-20180302/build-vm-ec2 obs-build-20180831/build-vm-ec2 --- obs-build-20180302/build-vm-ec2 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-vm-ec2 2018-09-19 07:07:55.000000000 +0000 @@ -150,7 +150,7 @@ echo "" >> "$BUILD_ROOT/boot/grub/menu.lst" echo "title default" >> "$BUILD_ROOT/boot/grub/menu.lst" echo " root (hd0)" >> "$BUILD_ROOT/boot/grub/menu.lst" - echo " kernel /boot/vmlinuz root=/dev/sda1 xencons=xvc0 console=xvc0 splash=silent" >> "$BUILD_ROOT/boot/grub/menu.lst" + echo " kernel /boot/vmlinuz root=/dev/sda1 xencons=xvc0 console=xvc0 splash=silent $vm_linux_kernel_parameter" >> "$BUILD_ROOT/boot/grub/menu.lst" echo " initrd /boot/initrd" >> "$BUILD_ROOT/boot/grub/menu.lst" fi } diff -Nru obs-build-20180302/build-vm-kvm obs-build-20180831/build-vm-kvm --- obs-build-20180302/build-vm-kvm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-vm-kvm 2018-09-19 07:07:55.000000000 +0000 @@ -243,8 +243,12 @@ elif test -n "$VM_CONSOLE_INPUT" ; then qemu_args=("${qemu_args[@]}" -serial mon:stdio) else - mkfifo "${VM_ROOT}.monitor" - qemu_args=("${qemu_args[@]}" -serial stdio -chardev socket,id=monitor,server,nowait,path="${VM_ROOT}.monitor" -mon chardev=monitor,mode=readline) + if ! test -e "${VM_ROOT}.qemu/monitor"; then + mkdir -p "${VM_ROOT}.qemu" + mkfifo "${VM_ROOT}.qemu/monitor" + chown "$VM_USER" "${VM_ROOT}.qemu" + fi + qemu_args=("${qemu_args[@]}" -serial stdio -chardev socket,id=monitor,server,nowait,path="${VM_ROOT}.qemu/monitor" -mon chardev=monitor,mode=readline) fi if test -n "$BUILD_JOBS" -a "$icecream" = 0 -a -z "$BUILD_THREADS" ; then @@ -263,7 +267,10 @@ if test -n "$VMDISK_MOUNT_OPTIONS" ; then qemu_append="$qemu_append rootflags=${VMDISK_MOUNT_OPTIONS#-o }" fi - qemu_append="$qemu_append panic=1 quiet no-kvmclock nmi_watchdog=0 rw rd.driver.pre=binfmt_misc elevator=noop console=$kvm_console init=$vm_init_script" + qemu_append="$qemu_append $vm_linux_kernel_parameter" + qemu_append="$qemu_append panic=1 quiet no-kvmclock elevator=noop" + qemu_append="$qemu_append nmi_watchdog=0 rw rd.driver.pre=binfmt_misc" + qemu_append="$qemu_append console=$kvm_console init=$vm_init_script" if test -z "$VM_NETOPT" -a -z "$VM_NETDEVOPT"; then kvm_options="$kvm_options -net none" fi @@ -287,6 +294,8 @@ export QEMU_AUDIO_DRV=none # we do not want to have sound inside the VMs echo "$@" "$@" + qemu_ret=$? + test "$qemu_ret" = "137" && cleanup_and_exit 3 "qemu got SIGKILL" } vm_kill_kvm() { @@ -330,7 +339,7 @@ vm_sysrq_kvm() { perl -e 'use Socket; socket(SOCK, PF_UNIX, SOCK_STREAM, 0) || die("socket: $!\n"); - connect(SOCK, sockaddr_un("'"$VM_ROOT.monitor"'")) || die("connect: $!\n"); + connect(SOCK, sockaddr_un("'"$VM_ROOT.qemu/monitor"'")) || die("connect: $!\n"); print SOCK "sendkey alt-print-'$1'\n";' } diff -Nru obs-build-20180302/build-vm-pvm obs-build-20180831/build-vm-pvm --- obs-build-20180302/build-vm-pvm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-vm-pvm 2018-09-19 07:07:55.000000000 +0000 @@ -187,7 +187,7 @@ insmod disk insmod elf set root='ieee1275//vdevice/v-scsi@30000002/disk@8100000000000000,msdos2' -linux /.build.kernel.kvm init=/.build/build console=hvc0 root=/dev/sda2 rw elevator=noop +linux /.build.kernel.kvm init=/.build/build console=hvc0 root=/dev/sda2 rw elevator=noop $vm_linux_kernel_parameter initrd /.build.initrd.kvm boot EOF diff -Nru obs-build-20180302/build-vm-xen obs-build-20180831/build-vm-xen --- obs-build-20180302/build-vm-xen 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-vm-xen 2018-09-19 07:07:55.000000000 +0000 @@ -82,7 +82,7 @@ XLDISK= XLDISK="\"${XMROOT#disk=}\"" test -n "$XMSWAP" && XLDISK="$XLDISK, \"${XMSWAP#disk=}\"" - set -- xl create -c $XEN_CONF_FILE name="\"build_$XENID\"" "disk=[ $XLDISK ]" extra=\""panic=1 quiet init="$vm_init_script" rd.driver.pre=binfmt_misc elevator=noop console=$VM_CONSOLE"\" + set -- xl create -c $XEN_CONF_FILE name="\"build_$XENID\"" "disk=[ $XLDISK ]" extra=\""panic=1 quiet init="$vm_init_script" rd.driver.pre=binfmt_misc $vm_linux_kernel_parameter elevator=noop console=$VM_CONSOLE"\" fi if test "$PERSONALITY" != 0 ; then # have to switch back to PER_LINUX to make xm work diff -Nru obs-build-20180302/build-vm-zvm obs-build-20180831/build-vm-zvm --- obs-build-20180302/build-vm-zvm 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/build-vm-zvm 2018-09-19 07:07:55.000000000 +0000 @@ -25,7 +25,7 @@ # lets go with the default parameters. However zvm_initrd will be a required parameter #zvm_kernel=/boot/image #zvm_initrd=/boot/initrd_worker -zvm_param="root=/dev/disk/by-path/ccw-0.0.0150-part1 hvc_iucv=8 console=hvc0" +zvm_param="root=/dev/disk/by-path/ccw-0.0.0150-part1 hvc_iucv=8 console=hvc0 $vm_linux_kernel_parameter" zvm_mult_pass="THR4ME" zvm_init_script="/.build/build" diff -Nru obs-build-20180302/changelog2spec obs-build-20180831/changelog2spec --- obs-build-20180302/changelog2spec 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/changelog2spec 2018-09-19 07:07:55.000000000 +0000 @@ -40,6 +40,7 @@ my $zone; my $test; my $fulltimestamps; +my $emailonly; my $printtype; my $input = ''; my $target = 'rpm'; @@ -70,6 +71,11 @@ $target = shift @ARGV; next; } + if ($ARGV[0] eq '--emailonly') { + $emailonly = 1; + shift @ARGV; + next; + } last; } @@ -118,6 +124,7 @@ $dt = lc($dt); $who =~ s/^\s+//; $who =~ s/^-\s*//; + $who = $1 if $emailonly && $who =~ /\<(.*)\>/; $dt =~ /([0-9][0-9][0-9][0-9])/; $dline = $_; my $year = $1; diff -Nru obs-build-20180302/computeblocklists obs-build-20180831/computeblocklists --- obs-build-20180302/computeblocklists 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/computeblocklists 2018-09-19 07:07:55.000000000 +0000 @@ -13,7 +13,7 @@ ################################################################ # -# Copyright (c) 1995-2014 SUSE Linux Products GmbH +# Copyright (c) 1995-2018 SUSE Linux Products GmbH # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or 3 as @@ -33,7 +33,163 @@ use strict; -my ($opt_padstart, $opt_padend, $opt_verbose, $opt_manifest, $opt_mani0); +# the ioctls we use +my $FIBMAP = 1; +my $FIGETBSZ = 2; +my $FIEMAP = 0xc020660b; # _IOWR('f', 11, struct fiemap) + +# powerpc, mips, sparc, and alpha have 3 direction bits +# and represent _IOC_NONE as 1 instead of 0. +sub alt_ioctl($) { + my ($ioctl_nr) = @_; + my $size = ($ioctl_nr >> 16) & 0x3fff; + my $dir = ($ioctl_nr >> 30); + my $base = $ioctl_nr & 0x1fffffff; + die "invalid size $size" if ($size > (1 << 13)); + return $base | ($dir + 1) << 29; +} + +# +# Use FIBMAP to gather block lists, block-by-block +# This is the older, slower way to iterate over file extents but +# will generally work on older kernels. The block number also +# must fit into an integer limiting the size of the file system. +# +sub fibmap_blocklist($$$) { + my ($fd, $filesize, $bsize) = @_; + + my $exts = ''; + my $blocks = int(($filesize + $bsize - 1) / $bsize); + die("file is too big for fibmap\n") if $blocks * $bsize < $filesize; + my ($firstblock, $lastblock); + for (my $cnt = 0; $cnt < $blocks; ++$cnt) { + my $block = pack('I', $cnt); + if (not defined ioctl($fd, $FIBMAP, $block)) { + if (not defined ioctl($fd, alt_ioctl($FIBMAP), $block)) { + die("fibmap ioctl: $!\n"); + } + } + $block = unpack('I', $block); + if (defined($firstblock) && $block == ($firstblock ? $lastblock + 1 : 0)) { + $lastblock++; # continue run + next; + } + # finish old run + $exts .= "-$lastblock" if defined($firstblock) && $firstblock != $lastblock; + # start new run + $exts .= " $block"; + $firstblock = $lastblock = $block; + } + # finish last run + $exts .= "-$lastblock" if defined($firstblock) && $firstblock != $lastblock; + return $exts; +} + +# +# Use the FIEMAP ioctl to gather block lists, defined extent at a time +# This is the newer way to gather extent information. We iterate the file +# up to 50 extents at a time, each describing a contiguous, non-hole, range. +# +# see /usr/include/linux/fiemap.h for definitions of the flags used below +# +my $q_emu = 0; # 0=no emu, 1=little endian, 2=big endian + +sub pack_Q { + my ($v) = @_; + return pack('Q', $v) unless $q_emu; + my $v1 = int($v / 4294967296); + my $v2 = int($v - 4294967296 * $v1); + ($v1, $v2) = ($v2, $v1) if $q_emu == 1; + return pack('LL', $v1, $v2); +} + +sub unpack_Q { + return unpack('Q', $_[0]) unless $q_emu; + my ($v1, $v2) = unpack('LL', $_[0]); + ($v1, $v2) = ($v2, $v1) if $q_emu == 1; + my $v = $v1 * 4294967296 + $v2; + die("unpack_Q: number too big\n") if int($v - 4294967296 * $v1) != $v2; + return $v; +} + +# Convert a size into a block number and an offset. +sub bytes_in_blocks($$) { + my ($bytes, $bsize) = @_; + my $blk = int($bytes / ($bsize * 65536)) * 65536; # work with 32bit int + $blk += int(($bytes - $blk * $bsize) / $bsize); + return ($blk, $bytes - $blk * $bsize); +} + +# Create an extent descriptor +sub createext($$$;$) { + my ($start, $end, $bsize, $islast) = @_; + die if $start > $end; + my ($startblk, $startoff) = bytes_in_blocks($start, $bsize); + my ($endblk, $endoff) = bytes_in_blocks($end, $bsize); + $endoff = $bsize - 1 if $islast; + my $ext = " $startblk"; + $ext .= ":$startoff" if $startoff != 0; + if ($startblk != $endblk || $endoff != $bsize - 1) { + $ext .= "-$endblk"; + $ext .= ":$endoff" if $endoff != $bsize - 1; + } + return $ext; +} + +sub fiemap_blocklist($$$) { + my ($file, $filesize, $bsize) = @_; + + # check if pack/unpack supports the Q template + $q_emu = 0; + eval { die if unpack('Q', pack('Q', 1)) != 1 }; + if ($@) { + # nope, fallback to encode/decode helpers + $q_emu = unpack('C', pack('L', 1)) ? 1 : 2; + } + + my $exts = ''; + my $offset = 0; + while ($offset < $filesize) { + my $flags_in = 0x00000001; # FIEMAP_FLAG_SYNC + my $x = pack("a8a8IIIx4.", pack_Q($offset), pack_Q($filesize), $flags_in, 0, 50, 4096); + + if (not defined ioctl($file, $FIEMAP, $x)) { + if (not defined ioctl($file, alt_ioctl($FIEMAP), $x)) { + die("fiemap ioctl: $!\n"); + } + } + + my ($flags, $count, @extents) = unpack('x16IIx8(a8a8a8a8a8IIII)[50]', $x); + last if $count == 0; # rest is a hole + + for (my $i = 0; $i < $count; $i++) { + $extents[$_] = unpack_Q($extents[$_]) for 0, 1, 2; + my ($logical, $physical, $length, $resv1, $resv2, $flags) = splice(@extents, 0, 9); + die("logical offset outside of file?\n") if $logical < 0 || $logical >= $filesize; + die("going back in file?\n") if $offset > $logical; + die("extent with bad size?\n") if $length <= 0; + # add a hole entry if needed + $exts .= createext(0, $logical - $offset - 1, $bsize) if $offset < $logical; + my $islast = $logical + $length >= $filesize ? 1 : 0; + # Not a hole but for these purposes we should treat it as one + if ($flags & 0x00000800) { # UNWRITTEN + $exts .= createext(0, $length - 1, $bsize, $islast); + } elsif ($flags & 0x00000008) { # ENCODED + die("extent mapped but is encoded\n"); + # UNKNOWN|DELALLOC|DATA_ENCRYPTED|NOT_ALIGNED|DATA_INLINE|DATA_TAIL + } elsif ($flags & 0x00000786) { + die("extent cannot be block-mapped\n"); + } else { + $exts .= createext($physical, $physical + $length - 1, $bsize, $islast); + } + $offset = $logical + $length; + } + } + $exts .= createext(0, $filesize - $offset - 1, $bsize, 1) if $offset < $filesize; + return $exts; +} + +my ($opt_padstart, $opt_padend, $opt_verbose, $opt_manifest, $opt_mani0, $opt_fibmap); $opt_verbose = 0; while (@ARGV) { @@ -62,6 +218,11 @@ $opt_manifest = shift @ARGV; next; } + if ($ARGV[0] eq '--fibmap') { + shift @ARGV; + $opt_fibmap = 1; + next; + } last; } @@ -100,18 +261,18 @@ my $c = readlink($file); die("$file: readlink: $!\n") unless defined $c; if ("/$c/" =~ /\/\.?\//s) { - print STDERR "$file: bad symlink ($c) ignored\n"; + print STDERR "$file: bad symlink ($c), ignored\n"; next; } if ("/$c/" =~ /^((?:\/\.\.)+)\/(.*?)$/s) { my ($head, $tail) = ($1, $2); if (("/$tail/" =~ /\/\.\.\//s) || (($head =~ y!/!!) > ($file =~ y!/!!))) { - print STDERR "$file: bad symlink ($c) ignored\n"; + print STDERR "$file: bad symlink ($c), ignored\n"; next; } } else { if ("/$c/" =~ /\/\.\.\//s) { - print STDERR "$file: bad symlink ($c) ignored\n"; + print STDERR "$file: bad symlink ($c), ignored\n"; next; } } @@ -119,68 +280,51 @@ print "l $n $c\n"; next; } elsif (-d _) { - print STDERR "$file\n" if $opt_verbose && $opt_verbose > 1; + print STDERR "$file\n" if $opt_verbose && ($opt_verbose > 1 || $file =~ /^KIWI\/[^\/]*$/); print "d $n\n"; next; - } elsif (!-f _) { + } elsif (! -f _) { + print STDERR "$file: unsupported file type, ignored\n"; next; } print STDERR "$file\n" if $opt_verbose && !($opt_verbose == 1 && $file =~ /^KIWI\/.*\//); - if (!open(F, '<', $file)) { - print STDERR "$file: $!"; + my $fd = undef; + if (!open($fd, '<', $file)) { + print STDERR "$file: $!\n"; next; } - my @stat = stat(F); + my @stat = stat($fd); die unless @stat; - my $st_size = $stat[7]; - if ($st_size == 0) { + my $filesize = $stat[7]; + if ($filesize == 0) { print "f $n 0\n"; - close F; + close($fd); next; } - my $bsize = 'xxxx'; - ioctl(F, 2, $bsize) || ioctl(F, 536870914, $bsize) || die("FIGETBSZ: $!\n"); - $bsize = unpack("L", $bsize); - die("$file: empty blocksize\n") unless $bsize != 0; - - print "f $n $st_size $bsize"; - my $blocks = int(($st_size+$bsize-1)/$bsize); - my ($firstblock, $lastblock); - for ($b = 0; $b < $blocks; ++$b) { - my $block = pack('I', $b); - if (not defined ioctl(F, 1, $block)) { - if (not defined ioctl(F, 536870913, $block)) { - die "$file: $!\n"; - } + my $bsize = pack('I', 0); + if (not defined ioctl($fd, $FIGETBSZ, $bsize)) { + if (not defined ioctl($fd, alt_ioctl($FIGETBSZ), $bsize)) { + die("$file: FIGETBSZ failed: $!\n"); } - $block = unpack('I', $block); - if (!$firstblock && defined($firstblock)) { - # last block was hole - if (!$block) { - $lastblock++; # count holes, 0-2 means three hole blocks - } else { - # switch back from 'hole mode' into normal mode - printf "-$lastblock" if defined($firstblock) && $firstblock != $lastblock; - print " $block"; - $firstblock = $lastblock = $block; - } - next; - } - if (!$firstblock || $lastblock + 1 != $block) { - # start of a new run - printf "-$lastblock" if defined($firstblock) && $firstblock != $lastblock; - print " $block"; - $firstblock = $block; - } - $lastblock = $block; } - # finish last run - printf "-$lastblock" if defined($firstblock) && $firstblock != $lastblock; - close F; - print "\n"; + $bsize = unpack('I', $bsize); + die("$file: illegal blocksize $bsize\n") unless $bsize > 0; + + my $exts; + if (!$opt_fibmap) { + eval { $exts = fiemap_blocklist($fd, $filesize, $bsize) }; + warn($@) if $@; + } + if (!defined($exts)) { + eval { $exts = fibmap_blocklist($fd, $filesize, $bsize) }; + warn($@) if $@; + } + die "$file: could not get extent list\n" unless defined $exts; + print "f $n $filesize $bsize$exts\n"; + close($fd); } print "\n"x$opt_padend if $opt_padend; diff -Nru obs-build-20180302/configs/arch.conf obs-build-20180831/configs/arch.conf --- obs-build-20180302/configs/arch.conf 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/configs/arch.conf 2018-09-19 07:07:55.000000000 +0000 @@ -13,7 +13,7 @@ Support: acl autoconf automake zlib bzip2 filesystem curl Support: libtool ncurses perl gpgme libarchive openssl libssh2 Support: libassuan libgpg-error attr expat xz pacman pacman-mirrorlist -Support: fakeroot file sudo patch make net-tools pkg-config inetutils +Support: fakeroot file sudo patch make net-tools pkgconf inetutils Support: bison flex gettext which Prefer: zlib ttf-dejavu diff -Nru obs-build-20180302/configs/debian-jessie.conf obs-build-20180831/configs/debian-jessie.conf --- obs-build-20180302/configs/debian-jessie.conf 1970-01-01 00:00:00.000000000 +0000 +++ obs-build-20180831/configs/debian-jessie.conf 2018-09-19 07:07:55.000000000 +0000 @@ -0,0 +1,39 @@ +Repotype: debian +type: dsc +buildengine: debootstrap + +Order: base-passwd:base-files +Order: init-system-helpers:util-linux + +Preinstall: dash bash sed grep coreutils debianutils +Preinstall: libc6 libncurses5 libacl1 libattr1 libpcre3 +Preinstall: diffutils tar dpkg libc-bin +Preinstall: gzip base-files base-passwd +Preinstall: libselinux1 libsepol1 +Preinstall: libgcc1 util-linux debconf tzdata findutils libdbus-1-3 +Preinstall: liblzma5 xz-utils libstdc++6 passwd +Preinstall: login zlib1g libbz2-1.0 libtinfo5 libsigsegv2 +Preinstall: dash insserv libmpfr4 libgmp10 libdebconfclient0 +Preinstall: perl-base perl mawk init-system-helpers + +Required: build-essential apt mount fakeroot dpkg-dev ncurses-base hostname +Required: libtool + +# Work around packge looking up variations of localhost .e.g glibc tries to look up localhost. +Support: libnss-myhostname + + + +Prefer: cvs libesd0 libfam0 libfam-dev expect +Prefer: mawk locales default-jdk +Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa +Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel +Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2 +Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp +Prefer: glib-sharp libzypp-zmd-backend +Prefer: sysv-rc make +Prefer: libjack-jackd2-dev libsndio-dev +Prefer: pkg-config +Prefer: texlive-htmlxml +Prefer: libjpeg-dev + diff -Nru obs-build-20180302/configs/debian-unstable.conf obs-build-20180831/configs/debian-unstable.conf --- obs-build-20180302/configs/debian-unstable.conf 1970-01-01 00:00:00.000000000 +0000 +++ obs-build-20180831/configs/debian-unstable.conf 2018-09-19 07:07:55.000000000 +0000 @@ -0,0 +1,41 @@ +Repotype: debian +type: dsc +buildengine: debootstrap + +Order: base-passwd:base-files + +Preinstall: dash bash sed grep coreutils debianutils +Preinstall: libc6 libncurses5 libacl1 libattr1 libpcre3 +Preinstall: diffutils tar dpkg libc-bin +Preinstall: gzip base-files base-passwd +Preinstall: libselinux1 libsepol1 +Preinstall: libgcc1 util-linux debconf tzdata findutils libdbus-1-3 +Preinstall: liblzma5 xz-utils libstdc++6 passwd +Preinstall: login zlib1g libbz2-1.0 libtinfo5 libsigsegv2 +Preinstall: dash insserv libmpfr4 libgmp10 libdebconfclient0 +Preinstall: perl-base perl libperl-dev mawk init-system-helpers + +Required: build-essential apt mount fakeroot dpkg-dev ncurses-base hostname +Required: libtool + +# Work around packge looking up variations of localhost .e.g glibc tries to look up localhost. +Support: libnss-myhostname + +Prefer: mawk +Prefer: cvs libesd0 libfam0 libfam-dev expect +Prefer: locales default-jdk +Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa +Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel +Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2 +Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp +Prefer: glib-sharp libzypp-zmd-backend +Prefer: sysv-rc make +Prefer: libjack-jackd2-dev libsndio-dev +Prefer: pkg-config +Prefer: texlive-htmlxml + +Prefer: golang-github-miekg-dns-dev +Prefer: golang-gopkg-yaml.v2-dev +Prefer: golang-github-spf13-cobra-dev +Prefer: golang-github-burntsushi-toml-dev + diff -Nru obs-build-20180302/configs/sle12.4.conf obs-build-20180831/configs/sle12.4.conf --- obs-build-20180302/configs/sle12.4.conf 1970-01-01 00:00:00.000000000 +0000 +++ obs-build-20180831/configs/sle12.4.conf 2018-09-19 07:07:55.000000000 +0000 @@ -0,0 +1,667 @@ +%define gcc_version 48 + +Patterntype: rpm-md ymp + +Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux dosfstools kiwi-instsource-plugins-SLE-12 + +Conflict: kiwi:libudev-mini1 +Conflict: kiwi:systemd-mini +Conflict: libudev1:udev-mini +Conflict: udev:udev-mini +Conflict: sles-release:dummy-release + +FileProvides: /usr/sbin/groupadd shadow +FileProvides: /usr/sbin/useradd shadow +FileProvides: /sbin/netconfig sysconfig-netconfig +FileProvides: /usr/bin/docbook2man docbook-utils +FileProvides: /usr/bin/mkisofs cdrkit-cdrtools-compat +FileProvides: /usr/sbin/lockdev lockdev +FileProvides: /bin/logger util-linux-systemd + +Preinstall: aaa_base attr bash coreutils diffutils +Preinstall: filesystem fillup glibc grep +Preinstall: libbz2-1 libgcc_s1 m4 libncurses5 pam +Preinstall: permissions libreadline6 rpm sed tar libz1 libselinux1 +Preinstall: liblzma5 libcap2 libacl1 libattr1 +Preinstall: libpopt0 libelf1 liblua5_1 +Preinstall: libpcre1 libsmartcols1 + +Runscripts: aaa_base + +Order: libopenssl0_9_8:openssl-certs + +VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 net-tools +VMInstall: kernel-obs-build + +%ifarch DISABLED_aarch64 +Preinstall: qemu-linux-user +Runscripts: qemu-linux-user +Hostarch: x86_64 +Macros: +%qemu_user_space_build 1 +:Macros +%endif + +Required: rpm-build + +Support: pam-modules + +# the basic stuff +Support: perl build-mkbaselibs +Support: brp-check-suse post-build-checks rpmlint-Factory + +Prefer: libblkid1-mini libuuid1-mini libmount1-mini libsmartcols1-mini libdb-4_8-devel +Prefer: krb5-mini krb5-mini-devel +Conflict: krb5-devel:krb5-mini +Conflict: krb5:krb5-mini-devel +Prefer: libreadline5 +Prefer: libdb_java-4_8 libicu +Prefer: cracklib-dict-small postfix +Prefer: jta fam mozilla mozilla-nss +Prefer: unixODBC libsoup glitz +Prefer: gnome-panel desktop-data-SLE gnome2-SuSE +Prefer: mono-nunit gecko-sharp2 +Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript +Prefer: gtk-sharp2 glib-sharp2 glade-sharp2 +Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default +Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default +Prefer: virtualbox-kmp-default virtualbox-host-kmp-default +Prefer: libstdc++6 libgcc_s1 libquadmath0 +Prefer: libstdc++6-32bit libstdc++6-64bit +Prefer: libstdc++6-x86 +Prefer: libstdc++6-gcc%{gcc_version} libgcc_s1-gcc%{gcc_version} libgomp1-gcc%{gcc_version} +%ifarch s390x +Prefer: -libstdc++41 +%endif +Prefer: libstroke +Prefer: syslog-service syslogd +Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp +Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2 +Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24 +Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp +Prefer: gjdoc:antlr-bootstrap +Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2 +Prefer: zmd:libzypp-zmd-backend +Prefer: yast2-packagemanager-devel:yast2-packagemanager +Prefer: glitz-32bit:Mesa-32bit +Prefer: poppler-tools +Prefer: libjpeg8-devel libjpeg-turbo +Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst +Prefer: banshee-1:banshee-1-client-classic +Prefer: libfam0 +Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa +Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts +Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts +Prefer: microcode_ctl:kernel-default +Prefer: notification-daemon +Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs lua-devel +Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt +Prefer: vim-normal myspell-american wine +Prefer: eclipse-platform eclipse-scripts +Prefer: yast2-theme-SLE +Prefer: amarok:amarok-xine +Prefer: kdenetwork3-vnc:tightvnc +Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat6-jsp-2_1-api tomcat6-servlet-2_5-api +Prefer: icewm-lite +Prefer: patterns-openSUSE-GNOME-cd:banshee +Prefer: yast2-ncurses-pkg +Prefer: monodevelop: mono-addins +Prefer: ant-trax:saxon +Prefer: gnome-session:gnome-session-branding-openSUSE +Prefer: gnome-session:gconf2-branding-openSUSE +Prefer: yast2-qt:yast2-qt-branding-openSUSE +Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE +Prefer: fcitx:fcitx-branding-openSUSE +Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream +Prefer: exo-data:exo-branding-upstream +Prefer: xfce4-settings:xfce4-settings-branding-upstream +Prefer: xfdesktop:xfdesktop-branding-upstream +Prefer: texlive-xmltex texlive-tools texlive-jadetex +Prefer: mono-web:mono-data-sqlite +Prefer: gnome-games:gnuchess +Prefer: glchess:gnuchess +Prefer: libreoffice:libreoffice-branding-upstream +Prefer: yast2-branding-openSUSE +Prefer: gimp:gimp-branding-upstream +Prefer: libesd-devel:esound +Prefer: libesd0:esound-daemon +Prefer: package-lists-openSUSE-KDE-cd: esound-daemon +Prefer: glib2:glib2-branding-upstream +Prefer: libgio-2_0-0:gio-branding-upstream +Prefer: libglib-2_0-0:glib2-branding-upstream +Prefer: kdelibs4:kdelibs4-branding-upstream +Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream +Prefer: kdelibs4-branding:kdelibs4-branding-upstream +Prefer: PackageKit:PackageKit-branding-upstream +Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream +Prefer: mysql-connector-java:java-1_5_0-gcj-compat +Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api +Prefer: rhino:xmlbeans-mini +Prefer: ghostscript-devel:ghostscript-library +Prefer: gdm:gdm-branding-upstream +Prefer: rpcbind log4j-mini eclipse-source +Prefer: mx4j:log4j-mini +Prefer: podsleuth:sg3_utils +Prefer: libcdio_cdda0 libcdio_paranoia0 +Prefer: mozilla-xulrunner191 +Prefer: mozilla-xulrunner191-32bit +Prefer: boo tog-pegasus +Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp +Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd +Prefer: ant:xerces-j2 +Prefer: dhcp-client:dhcp +Prefer: dummy-release +# provides typelib(St) +Prefer: -cinnamon +Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es +Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el +Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl +Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da +Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb +Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar +Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr +Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el +Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs +Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu +Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv +Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar +Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr +Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el +Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs +Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu +Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv +Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar +Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr +Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el +Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru +Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da +Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv +Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar +Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++ +Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g +Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links +Prefer: -python-setuptools +Prefer: -kdenetwork3-InstantMessenger +Prefer: -icc-profiles +Prefer: libsocialweb:libsocialweb-branding-upstream +Prefer: gnome-panel:gnome-panel-branding-upstream +Prefer: vala +Prefer: wallpaper-branding-SLE +Prefer: -crimson +Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4 +Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3 +Prefer: -rubygem-json_pure-1_5 +Prefer: geronimo-servlet-2_4-api +Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi +Prefer: typelib-1_0-Gst-0_10 gstreamer-0_10-utils-unversioned gstreamer-0_10-utils typelib-1_0-GstInterfaces-0_10 +# prefer the small systemd for building +Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo +Prefer: systemd-mini systemd-mini-devel +Prefer: systemd-mini-devel:systemd-mini +Prefer: udev-mini libcom_err2-mini libext2fs2-mini +Prefer: libudev1:udev +Prefer: xmlgraphics-commons:apache-commons-io +# the -32bit stuff provides things it shouldn't (hopefully temporary) +Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit +Prefer: postgresql postgresql-server +Prefer: -unzip-rcc + +Prefer: kernel-default-devel +Prefer: wxWidgets-2_9-devel + +Prefer: -NX -xaw3dd -db43 +Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis +Prefer: -vmware-player +Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit +Prefer: libffi%{gcc_version} libffi%{gcc_version}-devel +Prefer: libgcc_s1-x86 libffi4 libgcj_bc1 +Prefer: libffi4-32bit libffi4-64bit +Prefer: libgomp1 libgomp1-32bit libgomp1-64bit +Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit +Prefer: libobjc4 libgfortran3 libquadmath0 +Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini +Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel +Prefer: -seamonkey +Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2 +Prefer: libopenal0-soft openal-soft -lsb-buildenv +Prefer: -libevent +Prefer: gnu-crypto libusb-compat-devel +Prefer: libusb-0_1-4 +Prefer: CASA_auth_token_svc:xerces-j2 +Prefer: libreoffice:xerces-j2 +Prefer: k3b:libdvdread4 +Prefer: glibc-devel +Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4 -java-1_7_0-openjdk-javadoc -java-1_7_0-icedtea-javadoc +Prefer: -java-1_7_0-icedtea-devel +Prefer: NetworkManager:dhcp-client +Prefer: kdebase3-SuSE:kdebase3 +Prefer: kde4-kdm:kde4-kdm-branding-upstream +Prefer: kdm:kdm-branding-upstream +Prefer: pcre-tools +Prefer: libpopt0 +Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2 +Prefer: libgnome-keyring-devel +Prefer: linux-glibc-devel +Prefer: squid sysvinit +Prefer: libpng16-compat-devel +Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0 +Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client +Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis +Prefer: xmlgraphics-fop:xerces-j2 +Prefer: libxfce4ui:libxfce4ui-branding-upstream +Prefer: libgarcon-1-0:libgarcon-branding-upstream +Prefer: libgarcon-data:libgarcon-branding-upstream +Prefer: libexo-1-0:libexo-1-0-branding-upstream +Prefer: gnome-shell:mozilla-js20 +Prefer: cogl-devel +Prefer: -perl-XML-SAX +Prefer: gettext-tools-mini gettext-runtime-mini +Prefer: mozilla-nss-certs +Prefer: phonon-backend-gstreamer-0_10 +Prefer: dracut +Prefer: kmod-compat + +Prefer: typelib-1_0-Wnck-3_0 +Prefer: -cups154-libs -cups154-client -cups154 + +Ignore: java-1_7_0-openjdk:mozilla-nss +Ignore: java-1_7_0-openjdk:java-ca-certificates +Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome +Ignore: cracklib:cracklib-dict +Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev +Ignore: sysvinit:mingetty +Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel +Ignore: libgcj43,libstdc++43-devel +Ignore: libgcj44,libstdc++44-devel +Ignore: libgcj45,libstdc++45-devel +Ignore: libgcj46,libstdc++46-devel +Ignore: libgcj47,libstdc++47-devel +Ignore: pwdutils:openslp +Ignore: pam-modules:resmgr +Ignore: rpm:suse-build-key,build-key +Ignore: bind-utils:bind-libs +Ignore: alsa:dialog,pciutils +Ignore: portmap:syslogd +Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng +Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video +Ignore: apache2:logrotate +Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis +Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper +Ignore: kdelibs3-devel:libvorbis-devel +Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb +Ignore: kdebase3-SuSE:release-notes +Ignore: jack:alsa,libsndfile +Ignore: libxml2-devel:readline-devel +Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration +Ignore: libgda:file_alteration +Ignore: gnutls:lzo,libopencdk +Ignore: gnutls-devel:lzo-devel,libopencdk-devel +Ignore: pango:cairo,glitz,libpixman,libpng +Ignore: pango-devel:cairo-devel +Ignore: cairo-devel:libpixman-devel +Ignore: libgnomeprint:libgnomecups +Ignore: libgnomeprintui:libgnomecups +Ignore: orbit2-devel:indent +Ignore: qt3:libmng +Ignore: qt-sql:qt_database_plugin +Ignore: gtk2:libpng,libtiff +Ignore: libgnomecanvas-devel:glib-devel +Ignore: libgnomeui:gnome-icon-theme,shared-mime-info +Ignore: scrollkeeper:docbook_4 +Ignore: gnome-desktop:libgnomesu,startup-notification +Ignore: python-devel:python-tk +Ignore: gnome-pilot:gnome-panel +Ignore: gnome-panel:control-center2 +Ignore: gnome-menus:kdebase3 +Ignore: gnome-main-menu:rug +Ignore: libbonoboui:gnome-desktop +Ignore: libxfce4ui-1-0:exo-tools +Ignore: docbook_4:iso_ent,xmlcharent +Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification +Ignore: docbook-xsl-stylesheets:xmlcharent +Ignore: liby2util-devel:libstdc++-devel,openssl-devel +Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2 +Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils +Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel +Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel +Ignore: yast2-devtools:libxslt +Ignore: yast2-iscsi-lio-server:lio-utils +Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation +Ignore: yast2-bootloader:bootloader-theme +Ignore: yast2-packager:yast2-x11,libyui_pkg +Ignore: yui_backend +Ignore: yast2-x11:sax2-libsax-perl +Ignore: yast2-network:yast2-inetd +Ignore: openslp-devel:openssl-devel +Ignore: java-1_4_2-sun:xorg-x11-libs +Ignore: java-1_4_2-sun-devel:xorg-x11-libs +Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed +Ignore: texlive-bin:ghostscript-x11 +Ignore: texlive-bin-omega:ghostscript-x11 +Ignore: yast2-country:yast2-trans-stats +Ignore: tpb:tpctl-kmp +Ignore: tpctl:tpctl-kmp +Ignore: zaptel:zaptel-kmp +Ignore: mkinitrd:pciutils +Ignore: pciutils:pciutils-ids +Ignore: postfix:iproute2 +Ignore: aaa_base:systemd +Ignore: gpm:systemd +Ignore: ConsoleKit:systemd +Ignore: openssh:systemd +Ignore: cronie:systemd +Ignore: systemd:kbd +Ignore: systemd:kmod +Ignore: systemd:systemd-presets-branding +Ignore: systemd:dbus-1 +Ignore: systemd:pam-config +Ignore: systemd:udev +Ignore: pesign:systemd +Ignore: systemd-mini:this-is-only-for-build-envs +Ignore: udev-mini:this-is-only-for-build-envs +Ignore: libudev-mini1:this-is-only-for-build-envs +Ignore: polkit:ConsoleKit +Ignore: logrotate:cron +Ignore: texlive-filesystem:cron +Ignore: xinit:xterm +Ignore: xdm:xterm +Ignore: gnome-control-center:gnome-themes-accessibility +Ignore: coreutils:info +Ignore: cpio:info +Ignore: diffutils:info +Ignore: findutils:info +Ignore: gawk:info +Ignore: grep:info +Ignore: groff:info +Ignore: m4:info +Ignore: sed:info +Ignore: tar:info +Ignore: util-linux:info +Ignore: util-linux-mini:info +Ignore: gettext-tools:info +Ignore: gettext-runtime:info +Ignore: libgcrypt-devel:info +Ignore: binutils:info +Ignore: gzip:info +Ignore: make:info +Ignore: bison:info +Ignore: flex:info +Ignore: help2man:info +Ignore: man:groff-full +Ignore: git-core:rsync +Ignore: apache2:systemd +Ignore: icewm-lite:icewm +Ignore: cluster-glue:sudo + +Ignore: libgcc:glibc-32bit +Ignore: libgcc41:glibc-32bit +Ignore: libgcc42:glibc-32bit +Ignore: libgcc43:glibc-32bit +Ignore: libgcc44:glibc-32bit +Ignore: libgcc45:glibc-32bit +Ignore: libgcc46:glibc-32bit +Ignore: libgcc47:glibc-32bit +Ignore: libstdc++:glibc-32bit +Ignore: libstdc41++:glibc-32bit +Ignore: libstdc42++:glibc-32bit +Ignore: libstdc43++:glibc-32bit +Ignore: libstdc44++:glibc-32bit +Ignore: libstdc45++:glibc-32bit +Ignore: libstdc46++:glibc-32bit +Ignore: libstdc47++:glibc-32bit +Ignore: ncurses-32bit + +Ignore: susehelp:susehelp_lang,suse_help_viewer +Ignore: mailx:smtp_daemon +Ignore: cron:smtp_daemon +Ignore: hotplug:syslog +Ignore: pcmcia:syslog +Ignore: openct:syslog +Ignore: postfix:sysvinit(syslog) +Ignore: cups:sysvinit(syslog) +Ignore: avalon-logkit:servlet +Ignore: jython:servlet +Ignore: ispell:ispell_dictionary,ispell_english_dictionary +Ignore: aspell:aspel_dictionary,aspell_dictionary +Ignore: smartlink-softmodem:kernel,kernel-nongpl +Ignore: libreoffice-de:myspell-german-dictionary +Ignore: libreoffice:libreoffice-i18n +Ignore: libreoffice:libreoffice-icon-themes +Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any +Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl +Ignore: perl-Log-Log4perl:rrdtool + +Ignore: simias:mono(log4net) +Ignore: zmd:mono(log4net) +Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php + +Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver +Ignore: xdg-menu:desktop-data +Ignore: nessus-libraries:nessus-core +Ignore: evolution:yelp +Ignore: e17:e17-branding e17:e17-theme + +Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp) +Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp) + +Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4) +Ignore: libcdio:libcddb.so.2 + +Ignore: gnome-libs:libgnomeui +Ignore: nautilus:gnome-themes +Ignore: gnome-panel:gnome-themes +Ignore: gnome-panel:tomboy +Ignore: NetworkManager:NetworkManager-client +Ignore: libbeagle:beagle +Ignore: coreutils:coreutils-lang +Ignore: cpio:cpio-lang +Ignore: glib2:glib2-lang +Ignore: gtk2:gtk2-lang +Ignore: gtk:gtk-lang +Ignore: atk:atk-lang +Ignore: hal:pm-utils +Ignore: MozillaThunderbird:pinentry-dialog +Ignore: seamonkey:pinentry-dialog +Ignore: pinentry:pinentry-dialog +Ignore: gpg2:gpg2-lang +Ignore: util-linux:util-linux-lang +Ignore: util-linux-mini:util-linux-mini-lang +Ignore: suseRegister:distribution-release +Ignore: compiz:compiz-decorator +Ignore: icecream:gcc-c++ +Ignore: no +Ignore: package +Ignore: provides +Ignore: j9vm/libjvm.so()(64bit) +Ignore: kdepim3:suse_help_viewer +Ignore: kdebase3-SuSE:kdebase3-SuSE-branding +Ignore: kio_sysinfo:kdebase3-SuSE-branding +Ignore: gnome-menus:gnome-menus-branding +Ignore: epiphany:epiphany-branding +Ignore: gnome-control-center:gnome-control-center-branding +Ignore: phonon:phonon-backend +Ignore: openwbem-devel +Ignore: MozillaFirefox:MozillaFirefox-branding +Ignore: yast2:yast2-branding +Ignore: plymouth:plymouth-branding +Ignore: plymouth:suspend +Ignore: yast2-qt:yast2-branding +Ignore: yast2-theme-SLE:yast2-branding +Ignore: yast2-registration:yast2-registration-branding +Ignore: compiz:compiz-branding +Ignore: texlive:perl-Tk texlive-bin:perl-Tk +Ignore: xfce4-desktop:xfce4-desktop-branding +Ignore: xfce4-panel:xfce4-panel-branding +Ignore: xfce4-session:xfce4-session-branding +Ignore: kdebase4-runtime:kdebase4-runtime-branding +Ignore: kwin:kdebase4-workspace-branding +Ignore: pulseaudio:kernel +Ignore: transmission-common:transmission-ui +Ignore: mutter-moblin:moblin-branding +Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd +Ignore: mkinitrd:sbin_init +Ignore: opensc:pinentry +Ignore: gpg2:pinentry +Ignore: NetworkManager:dhcp +Ignore: NetworkManager:iproute2 +Ignore: sysconfig:dbus-1 +Ignore: sysconfig:procps +Ignore: sysconfig:iproute2 +Ignore: sysconfig-network:iproute2 +Ignore: sysconfig:tunctl +# no build dependencies +Ignore: libksuseinstall1:yast2-packager +Ignore: libksuseinstall1:zypper +Ignore: syslog-service:logrotate +Ignore: libglue-devel:cluster-glue +Ignore: libqca2:gpg2 +Ignore: NetworkManager:wpa_supplicant +Ignore: NetworkManager:dhcp-client +Ignore: openSUSE-release:product_flavor(openSUSE) +Ignore: sles-release:product_flavor(SLES) +Ignore: autoyast2:yast2-schema +Ignore: libgio-2_0-0:dbus-1-x11 +Ignore: weather-wallpaper:inkscape +Ignore: libgamin-1-0:gamin-server +Ignore: libfam0-gamin:gamin-server +Ignore: avahi:sysvinit(network) +Ignore: sysconfig:sysvinit(network) + +Prefer: java-1_7_0-openjdk java-1_7_0-openjdk-devel + +Prefer: -java-1_5_0-gcj-compat-devel +Prefer: -java-1_6_0-ibm-devel +%ifarch %ix86 x86_64 +Prefer: -java-1_5_0-ibm-devel +%endif + +Substitute: java2-devel-packages java-1_7_0-openjdk-devel + +%ifarch x86_64 ppc64 s390x sparc64 +Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit +%else + %ifarch ppc sparc sparcv9 +Substitute: glibc-devel-32bit glibc-devel-64bit + %else +Substitute: glibc-devel-32bit + %endif +%endif + +%ifarch %ix86 +Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen +%endif +%ifarch ia64 +Substitute: kernel-binary-packages kernel-default kernel-debug +%endif +%ifarch x86_64 +Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen +%endif +%ifarch ppc +Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3 +%endif +%ifarch ppc64 +Substitute: kernel-binary-packages kernel-default kernel-ppc64 +%endif +%ifarch s390 +Substitute: kernel-binary-packages kernel-s390 +%endif +%ifarch s390x +Substitute: kernel-binary-packages kernel-default +%endif + +Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -fstack-protector +Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -fstack-protector +Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches -fstack-protector +Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches -fstack-protector +Optflags: s390 -fmessage-length=0 -grecord-gcc-switches -fstack-protector +Optflags: s390x -fmessage-length=0 -grecord-gcc-switches -fstack-protector +Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches -fstack-protector + +Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -funwind-tables -fasynchronous-unwind-tables + +%define suse_version 1315 +%define _without_mono 1 +%define _without_vlc 1 +%define _without_compat_libs 1 + +%define rb_default_ruby ruby21 +%define rb_default_ruby_suffix ruby2.1 +%define rb_default_ruby_abi ruby:2.1.0 + +%define rb_build_ruby_abis ruby:2.1.0 +%define rb_build_versions ruby21 + +#Prefer: rubygem(%{rb_default_ruby_abi}:gem2rpm) +Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm + +Macros: +%insserv_prereq insserv sed +%fillup_prereq fillup coreutils grep diffutils +%suseconfig_fonts_prereq perl aaa_base +%install_info_prereq info +%kernel_module_package_buildreq kmod-compat kernel-syms +%kernel_module_package_buildreqs kmod-compat kernel-syms +%maintenance_vendor SUSE LLC +%maintenance_distribution SUSE Linux Enterprise 12 + +%suse_version 1315 +%sles_version 0 +%ul_version 0 +%do_profiling 1 +%_without_mono 1 +%_without_vlc 1 +%_without_compat_libs 1 +%rb_default_ruby ruby21 +%rb_default_ruby_suffix ruby2.1 +%rb_default_ruby_abi ruby:2.1.0 + +%rb_build_ruby_abis ruby:2.1.0 +%rb_build_versions ruby21 + +%rubygemsruby21() rubygem(ruby:2.1.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}} +%rubygemsxruby21() %{expand:%%{rubygemsx%*}} +# +%rubygemsruby22() rubygem(ruby:2.2.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}} +%rubygemsxruby22() %{expand:%%{rubygemsx%*}} +# +%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}} +%rubygemsSTOP() %nil +%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*} +%rubygemsxxSTOP(a:) %{-a*}) %* +# +%rubyruby21() ruby2.1 %{expand:%%rubyx%*} %{expand:%%{ruby%*}} +%rubyxruby21() %{expand:%%{rubyx%*}} +# +%rubyruby22() ruby2.2 %{expand:%%rubyx%*} %{expand:%%{ruby%*}} +%rubyxruby22() %{expand:%%{rubyx%*}} +# +%rubySTOP() %nil +%rubyxSTOP() %* +# +%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}} +# +%rubydevelruby21() ruby2.1-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}} +%rubydevelxruby21() %{expand:%%{rubydevelx%*}} +# +%rubydevelruby22() ruby2.2-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}} +%rubydevelxruby22() %{expand:%%{rubydevelx%*}} +# +%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}} +# +%rubydevelSTOP() %nil +%rubydevelxSTOP() %* + +%_vendor suse + +# define which gcc package builds the system libraries +%product_libs_gcc_ver 48 + +%ext_info .gz +%ext_man .gz + +%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \ +%{nil} + +%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \ +%{nil} + diff -Nru obs-build-20180302/configs/sles15.conf obs-build-20180831/configs/sles15.conf --- obs-build-20180302/configs/sles15.conf 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/configs/sles15.conf 2018-09-19 07:07:55.000000000 +0000 @@ -49,9 +49,6 @@ # Build all packages with -pie enabled Required: gcc-PIE -# needed for su's default config - perhaps we should use a simplified form? -Support: pam-modules - # the basic stuff Support: perl Support: brp-check-suse post-build-checks rpmlint-Factory diff -Nru obs-build-20180302/debian/changelog obs-build-20180831/debian/changelog --- obs-build-20180302/debian/changelog 2018-05-24 09:20:21.000000000 +0000 +++ obs-build-20180831/debian/changelog 2018-12-22 00:19:36.000000000 +0000 @@ -1,3 +1,42 @@ +obs-build (20180831-2) unstable; urgency=medium + + [ Ondřej Nový ] + * d/copyright: Use https protocol in Format field + + [ Héctor Orón Martínez ] + * debian/control: build depend on libtimedate-perl for tests + (Closes: #912048) + + -- Héctor Orón Martínez Sat, 22 Dec 2018 01:19:36 +0100 + +obs-build (20180831-1) unstable; urgency=medium + + * New upstream release. + * Drop patches already applied upstream. + * Release Debian version 20180831-1. + + -- Andrew Lee (李健秋) Wed, 19 Sep 2018 14:58:42 +0800 + +obs-build (20180302-4) unstable; urgency=medium + + [ Simon McVittie ] + * d/control: Add Vcs-Git, Vcs-Browser fields pointing to salsa.d.o + * Refresh patches through gbp pq import; gbp pq export + * d/control: Suggest btrfs-progs instead of deprecated btrfs-tools. + Thanks to Paul Wise (Closes: #900455) + + [ Andrew Lee (李健秋) ] + * Added DEP-3 compliant headers in all patches + + [ Simon McVittie ] + * Added policy-rc.d that turns invoke-rc.d into a no-op + + [ Andrew Lee (李健秋) ] + * Fix a typo in patch descriptions. + * Release Debian version 20180302-4. + + -- Andrew Lee (李健秋) Tue, 04 Sep 2018 18:08:54 +0800 + obs-build (20180302-3) unstable; urgency=medium * configs: Add Debian configurations diff -Nru obs-build-20180302/debian/control obs-build-20180831/debian/control --- obs-build-20180302/debian/control 2018-05-24 09:18:13.000000000 +0000 +++ obs-build-20180831/debian/control 2018-12-22 00:19:36.000000000 +0000 @@ -4,8 +4,11 @@ Maintainer: Héctor Orón Martínez Uploaders: Dimitri John Ledkov , Andrew Lee (李健秋) -Build-Depends: debhelper (>= 9) +Build-Depends: debhelper (>= 9), + libtimedate-perl Standards-Version: 4.1.3 +Vcs-Git: https://salsa.debian.org/debian/obs-build.git +Vcs-Browser: https://salsa.debian.org/debian/obs-build Package: obs-build Architecture: all @@ -13,7 +16,7 @@ ${misc:Depends}, ${perl:Depends}, rpm, debootstrap, sudo, libarchive-tools, python Recommends: rpm2cpio, osc, libcrypt-ssleay-perl, e2fsprogs, xzdec -Suggests: xfsprogs, btrfs-tools +Suggests: xfsprogs, btrfs-progs Description: scripts for building RPM/debian packages for multiple distributions This package provides scripts for building RPM and debian packages in contained environments for various build distributions. These tools diff -Nru obs-build-20180302/debian/copyright obs-build-20180831/debian/copyright --- obs-build-20180302/debian/copyright 2018-03-05 11:16:17.000000000 +0000 +++ obs-build-20180831/debian/copyright 2018-12-22 00:19:36.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: obs-build Upstream-Contact: Adrian Schröter Source: https://github.com/openSUSE/obs-build diff -Nru obs-build-20180302/debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch obs-build-20180831/debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch --- obs-build-20180302/debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch 2018-03-05 11:16:00.000000000 +0000 +++ obs-build-20180831/debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch 2018-12-22 00:16:58.000000000 +0000 @@ -3,11 +3,14 @@ Subject: Use obs-build in locations and executable names MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: base64 +Content-Transfer-Encoding: 8bit -ICBpbnN0ZWFkIG9mIGp1c3QgYnVpbGQuCgpTaWduZWQtb2ZmLWJ5OiBEaW1pdHJpIEpvaG4gTGVk -a292IDxkaW1pdHJpLmoubGVka292QGludGVsLmNvbT4KU2lnbmVkLW9mZi1ieTogSMOpY3RvciBP -csOzbiBNYXJ0w61uZXogPHp1bWJpQGRlYmlhbi5vcmc+Cg== + instead of just build. + +Signed-off-by: Dimitri John Ledkov +Signed-off-by: Héctor Orón Martínez +Forwarded: not-needed, Debian-specific +Last-Update: 2018-08-30 --- Makefile | 13 +++++++------ build | 6 +++--- diff -Nru obs-build-20180302/debian/patches/0002-debootstrap-ensure-etc-hosts-exists.patch obs-build-20180831/debian/patches/0002-debootstrap-ensure-etc-hosts-exists.patch --- obs-build-20180302/debian/patches/0002-debootstrap-ensure-etc-hosts-exists.patch 2018-03-05 11:16:00.000000000 +0000 +++ obs-build-20180831/debian/patches/0002-debootstrap-ensure-etc-hosts-exists.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?= -Date: Mon, 5 Mar 2018 01:06:54 +0100 -Subject: debootstrap: ensure /etc/hosts exists -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: base64 - -ZGVib290c3RyYXAgd29uJ3QgbmVjZXNzZXJpbHkgY3JlYXRlIC9ldGMvaG9zdHMsIHNvIGNvcHkg -aXQgZnJvbSB0aGUKbWFpbiBidWlsZHJvb3QgaWYgaXQncyBub3QgdGhlcmUuCgpTaWduZWQtb2Zm -LWJ5OiBTam9lcmQgU2ltb25zIDxzam9lcmQuc2ltb25zQGNvbGxhYm9yYS5jby51az4KU2lnbmVk -LW9mZi1ieTogSMOpY3RvciBPcsOzbiBNYXJ0w61uZXogPHp1bWJpQGRlYmlhbi5vcmc+Cg== ---- - build-recipe-debootstrap | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap -index baee905..9220952 100644 ---- a/build-recipe-debootstrap -+++ b/build-recipe-debootstrap -@@ -77,6 +77,10 @@ recipe_build_debootstrap() { - - chroot $BUILD_ROOT/$myroot apt-cache gencaches - -+ if ! test -e $BUILD_ROOT/$myroot/etc/hosts ; then -+ cp $BUILD_ROOT/etc/hosts $BUILD_ROOT/$myroot/etc/hosts -+ fi -+ - # move topdir over - mv "$BUILD_ROOT/$TOPDIR" "$BUILD_ROOT/$myroot/${TOPDIR%/*}" - diff -Nru obs-build-20180302/debian/patches/0003-HACK-make-glibc-build.patch obs-build-20180831/debian/patches/0003-HACK-make-glibc-build.patch --- obs-build-20180302/debian/patches/0003-HACK-make-glibc-build.patch 2018-03-05 11:16:00.000000000 +0000 +++ obs-build-20180831/debian/patches/0003-HACK-make-glibc-build.patch 2018-12-22 00:16:58.000000000 +0000 @@ -3,12 +3,16 @@ Subject: HACK: make glibc build MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: base64 +Content-Transfer-Encoding: 8bit -U2VlOgogIGh0dHBzOi8vYnVncy5kZWJpYW4ub3JnL2NnaS1iaW4vYnVncmVwb3J0LmNnaT9idWc9 -ODQ0NDIwCgpTaWduZWQtb2ZmLWJ5OiBTam9lcmQgU2ltb25zIDxzam9lcmQuc2ltb25zQGNvbGxh -Ym9yYS5jby51az4KU2lnbmVkLW9mZi1ieTogSMOpY3RvciBPcsOzbiBNYXJ0w61uZXogPHp1bWJp -QGRlYmlhbi5vcmc+Cg== +See: + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844420 + +Signed-off-by: Sjoerd Simons +Signed-off-by: Héctor Orón Martínez +Forwarded: not-needed, Debian-specific +Bug-Debian: http://bugs.debian.org/844420 +Last-Update: 2018-08-30 --- build-recipe-debootstrap | 5 +++++ 1 file changed, 5 insertions(+) diff -Nru obs-build-20180302/debian/patches/0004-deb-don-t-create-an-empty-rcS.patch obs-build-20180831/debian/patches/0004-deb-don-t-create-an-empty-rcS.patch --- obs-build-20180302/debian/patches/0004-deb-don-t-create-an-empty-rcS.patch 2018-03-05 11:16:00.000000000 +0000 +++ obs-build-20180831/debian/patches/0004-deb-don-t-create-an-empty-rcS.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?= -Date: Mon, 5 Mar 2018 01:16:37 +0100 -Subject: deb: don't create an empty rcS -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: base64 - -cmNTIGlzIGEgY29uZmlndXJhdGlvbiBmaWxlIGNyZWF0ZWQgYnkgaW5pdHNjcmlwdHMsIG5vdCBl -bnRpcmVseSBjbGVhcgp3aHkgb2JzLWJ1aWxkIHRyaWVzIHRvIGNyZWF0ZSBpdC4gQnV0IGlmIGl0 -IGRvZXMgaW5pdHNjcmlwdHMgd2lsbCBhc2sKd2hldGhlciB0byBrZWVwL3JlcGxhY2UgaXQgaW50 -ZXJhY3RpdmVseSBibG9ja2luZyB0aGUgYnVpbGQuCgpTaWduZWQtb2ZmLWJ5OiBTam9lcmQgU2lt -b25zIDxzam9lcmQuc2ltb25zQGNvbGxhYm9yYS5jby51az4KU2lnbmVkLW9mZi1ieTogSMOpY3Rv -ciBPcsOzbiBNYXJ0w61uZXogPHp1bWJpQGRlYmlhbi5vcmc+Cg== ---- - build-pkg-deb | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/build-pkg-deb b/build-pkg-deb -index ea2fc2a..c5959c0 100644 ---- a/build-pkg-deb -+++ b/build-pkg-deb -@@ -48,7 +48,6 @@ deb_setup() { - :>> $BUILD_ROOT/var/lib/dpkg/available - :>> $BUILD_ROOT/var/log/dpkg.log - :>> $BUILD_ROOT/etc/ld.so.conf -- :>> $BUILD_ROOT/etc/default/rcS - } - - pkg_initdb_deb() { diff -Nru obs-build-20180302/debian/patches/0005-dsc-keep-everything.patch obs-build-20180831/debian/patches/0005-dsc-keep-everything.patch --- obs-build-20180302/debian/patches/0005-dsc-keep-everything.patch 2018-03-05 11:16:00.000000000 +0000 +++ obs-build-20180831/debian/patches/0005-dsc-keep-everything.patch 2018-12-22 00:16:58.000000000 +0000 @@ -3,16 +3,19 @@ Subject: dsc: keep everything MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: base64 +Content-Transfer-Encoding: 8bit -RGViaWFuIHBhY2thZ2UgYnVpbGQgZGVwZW5kZW5jaWVzIGFsbG93IGZvciBkaXJlY3Qgb3IgaW5k -aXJlY3QgYnVpbGQKY3ljbGVzLCB3aGVuIGRvaW5nIGEgZnVsbCBkaXN0cmlidXRpb24gYnVpbGQg -aW4gT0JTIHRoaXMgbWVhbnMga2VlcGluZwp0aGUga2VlcCBsaXN0IGdldHMgdmVyeSB0ZWRpb3Vz -IHZlcnkgcXVpY2tseS4KCkFkanVzdCB0aGUgZGVmYXVsdCBrZWVwIHByb2Nlc3Npbmcgc3VjaCB0 -aGF0IGZvciBEZWJpYW4gKGRzYykgYnVpbGRzCmV2ZXJ5dGhpbmcgaXMga2VwdCBieSBkZWZhdWx0 -CgpTaWduZWQtb2ZmLWJ5OiBTam9lcmQgU2ltb25zIDxzam9lcmQuc2ltb25zQGNvbGxhYm9yYS5j -by51az4KU2lnbmVkLW9mZi1ieTogSMOpY3RvciBPcsOzbiBNYXJ0w61uZXogPHp1bWJpQGRlYmlh -bi5vcmc+Cg== +Debian package build dependencies allow for direct or indirect build +cycles, when doing a full distribution build in OBS this means keeping +the keep list gets very tedious very quickly. + +Adjust the default keep processing such that for Debian (dsc) builds +everything is kept by default + +Signed-off-by: Sjoerd Simons +Signed-off-by: Héctor Orón Martínez +Forwarded: https://github.com/openSUSE/obs-build/pull/342 +Last-Update: 2018-08-30 --- Build.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -Nru obs-build-20180302/debian/patches/add-debian-unstable-and-jessie-configs.patch obs-build-20180831/debian/patches/add-debian-unstable-and-jessie-configs.patch --- obs-build-20180302/debian/patches/add-debian-unstable-and-jessie-configs.patch 2018-03-06 13:16:18.000000000 +0000 +++ obs-build-20180831/debian/patches/add-debian-unstable-and-jessie-configs.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -Description: adds Debian configurations - Add Debian configuration for Unstable and Jessie. - -Author: Héctor Orón Martínez - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: Debian -Last-Update: 2018-03-06 - ---- /dev/null -+++ obs-build-20180302/configs/jessie.conf -@@ -0,0 +1,39 @@ -+Repotype: debian -+type: dsc -+buildengine: debootstrap -+ -+Order: base-passwd:base-files -+Order: init-system-helpers:util-linux -+ -+Preinstall: dash bash sed grep coreutils debianutils -+Preinstall: libc6 libncurses5 libacl1 libattr1 libpcre3 -+Preinstall: diffutils tar dpkg libc-bin -+Preinstall: gzip base-files base-passwd -+Preinstall: libselinux1 libsepol1 -+Preinstall: libgcc1 util-linux debconf tzdata findutils libdbus-1-3 -+Preinstall: liblzma5 xz-utils libstdc++6 passwd -+Preinstall: login zlib1g libbz2-1.0 libtinfo5 libsigsegv2 -+Preinstall: dash insserv libmpfr4 libgmp10 libdebconfclient0 -+Preinstall: perl-base perl mawk init-system-helpers -+ -+Required: build-essential apt mount fakeroot dpkg-dev ncurses-base hostname -+Required: libtool -+ -+# Work around packge looking up variations of localhost .e.g glibc tries to look up localhost. -+Support: libnss-myhostname -+ -+ -+ -+Prefer: cvs libesd0 libfam0 libfam-dev expect -+Prefer: mawk locales default-jdk -+Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa -+Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel -+Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2 -+Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp -+Prefer: glib-sharp libzypp-zmd-backend -+Prefer: sysv-rc make -+Prefer: libjack-jackd2-dev libsndio-dev -+Prefer: pkg-config -+Prefer: texlive-htmlxml -+Prefer: libjpeg-dev -+ ---- /dev/null -+++ obs-build-20180302/configs/unstable.conf -@@ -0,0 +1,41 @@ -+Repotype: debian -+type: dsc -+buildengine: debootstrap -+ -+Order: base-passwd:base-files -+ -+Preinstall: dash bash sed grep coreutils debianutils -+Preinstall: libc6 libncurses5 libacl1 libattr1 libpcre3 -+Preinstall: diffutils tar dpkg libc-bin -+Preinstall: gzip base-files base-passwd -+Preinstall: libselinux1 libsepol1 -+Preinstall: libgcc1 util-linux debconf tzdata findutils libdbus-1-3 -+Preinstall: liblzma5 xz-utils libstdc++6 passwd -+Preinstall: login zlib1g libbz2-1.0 libtinfo5 libsigsegv2 -+Preinstall: dash insserv libmpfr4 libgmp10 libdebconfclient0 -+Preinstall: perl-base perl libperl-dev mawk init-system-helpers -+ -+Required: build-essential apt mount fakeroot dpkg-dev ncurses-base hostname -+Required: libtool -+ -+# Work around packge looking up variations of localhost .e.g glibc tries to look up localhost. -+Support: libnss-myhostname -+ -+Prefer: mawk -+Prefer: cvs libesd0 libfam0 libfam-dev expect -+Prefer: locales default-jdk -+Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa -+Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel -+Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2 -+Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp -+Prefer: glib-sharp libzypp-zmd-backend -+Prefer: sysv-rc make -+Prefer: libjack-jackd2-dev libsndio-dev -+Prefer: pkg-config -+Prefer: texlive-htmlxml -+ -+Prefer: golang-github-miekg-dns-dev -+Prefer: golang-gopkg-yaml.v2-dev -+Prefer: golang-github-spf13-cobra-dev -+Prefer: golang-github-burntsushi-toml-dev -+ diff -Nru obs-build-20180302/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch obs-build-20180831/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch --- obs-build-20180302/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch 2018-03-05 23:44:05.000000000 +0000 +++ obs-build-20180831/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch 2018-12-22 00:16:58.000000000 +0000 @@ -7,15 +7,17 @@ which we'd rather avoid. Signed-off-by: Andrew Shadura +Forwarded: https://github.com/openSUSE/obs-build/pull/459 +Last-Update: 2018-08-30 --- build-recipe-dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -Index: obs-build/build-recipe-dsc -=================================================================== ---- obs-build.orig/build-recipe-dsc 2018-03-06 00:44:00.132983994 +0100 -+++ obs-build/build-recipe-dsc 2018-03-06 00:44:00.132983994 +0100 -@@ -95,7 +95,7 @@ +diff --git a/build-recipe-dsc b/build-recipe-dsc +index 79cfc66..c104890 100644 +--- a/build-recipe-dsc ++++ b/build-recipe-dsc +@@ -95,7 +95,7 @@ dsc_build() { # this allows the build environment to be manipulated # and alternate build commands can be used DSC_BUILD_CMD="$(queryconfig --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" substitute dsc:build_cmd)" diff -Nru obs-build-20180302/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch obs-build-20180831/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch --- obs-build-20180302/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch 2017-11-06 15:01:34.000000000 +0000 +++ obs-build-20180831/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch 2018-12-22 00:16:58.000000000 +0000 @@ -4,22 +4,24 @@ Subject: debootstrap: add fallback for Debian SID distro MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: base64 +Content-Transfer-Encoding: 8bit -ICBXaGVuIGF0dGVtcHRpbmcgdG8gYnVpbGQgRGViaWFuIHVuc3RhYmxlLCBkaXN0cmlidXRpb24g -aXMKICBjYWxjdWxhdGVkIHVzaW5nIGxzYiwgd2hpY2ggcmVsaWVzIG9uIGFwdCBjYWNoZS4gQXMg -b3VyCiAgYnVpbGQgc3lzdGVtcyBsYWNrIGFwdCBjYWNoZSBhbmQgbmV0d29yayB3ZSBjYW5ub3Qg -ZGV0ZWN0CiAgd2UgYXJlIGJ1aWxkaW5nIGZvciBEZWJpYW4gU0lEIChha2EgdW5zdGFibGUpLgog -IEZvciBtb3JlIGJhY2tncm91bmQgaW5mb3JtYXRpb24gc2VlOiBEZWJpYW5CdWcjODQ1NjUxCgpT -aWduZWQtb2ZmLWJ5OiBIw6ljdG9yIE9yw7NuIE1hcnTDrW5leiA8aGVjdG9yLm9yb25AY29sbGFi -b3JhLmNvLnVrPgpUZXN0ZWQtYnk6IEjDqWN0b3IgT3LDs24gTWFydMOtbmV6IDxoZWN0b3Iub3Jv -bkBjb2xsYWJvcmEuY28udWs+Cg== + When attempting to build Debian unstable, distribution is + calculated using lsb, which relies on apt cache. As our + build systems lack apt cache and network we cannot detect + we are building for Debian SID (aka unstable). + For more background information see: DebianBug#845651 + +Signed-off-by: Héctor Orón Martínez +Tested-by: Héctor Orón Martínez +Forwarded: https://github.com/openSUSE/obs-build/pull/460 +Last-Update: 2018-08-30 --- build-recipe-debootstrap | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap -index 72fb599..c06ef34 100644 +index 2404fdc..f28cdfc 100644 --- a/build-recipe-debootstrap +++ b/build-recipe-debootstrap @@ -31,7 +31,11 @@ recipe_prepare_debootstrap() { diff -Nru obs-build-20180302/debian/patches/Prevent-processes-in-deb-build-chroots-from-trying-to-sta.patch obs-build-20180831/debian/patches/Prevent-processes-in-deb-build-chroots-from-trying-to-sta.patch --- obs-build-20180302/debian/patches/Prevent-processes-in-deb-build-chroots-from-trying-to-sta.patch 1970-01-01 00:00:00.000000000 +0000 +++ obs-build-20180831/debian/patches/Prevent-processes-in-deb-build-chroots-from-trying-to-sta.patch 2018-12-22 00:16:58.000000000 +0000 @@ -0,0 +1,57 @@ +From: Simon McVittie +Date: Thu, 14 Jun 2018 15:12:22 +0100 +Subject: Prevent processes in deb build chroots from trying to start system + services + +Description: Added policy-rc.d that turns invoke-rc.d into a no-op + The problem is that in older versions of Ubuntu, the unpack packageset + from the target distribution to be able to run the first-stage + debootstrap is not very minimal. + . + In particular, it includes packages like initscripts, udev and procps, + which have initscripts that are started by postinst. In older Ubuntu, + when a postinst runs invoke-rc.d, it communicates with Upstart via a + mechanism that can escape from the chroot and talk to the host system's + Upstart (!); and if it can't, invoke-rc.d will fail and the first-stage + bootstrap will also fail. + . + The symptom is that on workers whose host OS did not boot using Upstart + (for example Debian stretch, but not Ubuntu trusty), the first-stage + bootstrap fails with: + . + [ 22s] initctl: Unable to connect to Upstart: Failed to connect to + socket /com/ubuntu/upstart: Connection refused + . + So here is a patch to provide OBS-level solution that adds a policy-rc.d + that turns invoke-rc.d into a no-op, just like debootstrap does to + prevent processes in deb build chroots from trying to start system + services. +Forwarded: https://github.com/openSUSE/obs-build/pull/462 +Author: Simon McVittie +Last-Update: 2018-08-31 +--- + obuild-pkg-deb | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/build-pkg-deb b/build-pkg-deb +index c5959c0..4cf47c9 100644 +--- a/build-pkg-deb ++++ b/build-pkg-deb +@@ -44,10 +44,17 @@ deb_setup() { + mkdir -p $BUILD_ROOT/var/lib/dpkg + mkdir -p $BUILD_ROOT/var/log + mkdir -p $BUILD_ROOT/etc/default ++ mkdir -p "$BUILD_ROOT/usr/sbin" + :>> $BUILD_ROOT/var/lib/dpkg/status + :>> $BUILD_ROOT/var/lib/dpkg/available + :>> $BUILD_ROOT/var/log/dpkg.log + :>> $BUILD_ROOT/etc/ld.so.conf ++ cat > "$BUILD_ROOT/usr/sbin/policy-rc.d" <<'EOF' ++#!/bin/sh ++echo "policy-rc.d from obs-build build-pkg-deb: disallowing rc.d action: $*" >&2 ++exit 101 ++EOF ++ chmod 755 "$BUILD_ROOT/usr/sbin/policy-rc.d" + } + + pkg_initdb_deb() { diff -Nru obs-build-20180302/debian/patches/series obs-build-20180831/debian/patches/series --- obs-build-20180302/debian/patches/series 2018-03-06 13:15:07.000000000 +0000 +++ obs-build-20180831/debian/patches/series 2018-12-22 00:16:58.000000000 +0000 @@ -1,8 +1,6 @@ 0001-Use-obs-build-in-locations-and-executable-names.patch -0002-debootstrap-ensure-etc-hosts-exists.patch 0003-HACK-make-glibc-build.patch -0004-deb-don-t-create-an-empty-rcS.patch 0005-dsc-keep-everything.patch build-recipe-dsc-don-t-rebuild-the-source-package.patch debootstrap-add-fallback-for-Debian-SID-distro.patch -add-debian-unstable-and-jessie-configs.patch +Prevent-processes-in-deb-build-chroots-from-trying-to-sta.patch diff -Nru obs-build-20180302/dist/build.changes obs-build-20180831/dist/build.changes --- obs-build-20180302/dist/build.changes 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/dist/build.changes 2018-09-19 07:07:55.000000000 +0000 @@ -1,4 +1,74 @@ ------------------------------------------------------------------- +Wed Aug 29 13:57:07 UTC 2018 - Adrian Schröter + +- Fall back to $mailaddr if $VC_MAILADDR is unset/null +- don't crash with no rpm macros defined +- Kiwi: support parsing of repos where the .repo file got used +- package hostarch definition in preinstallimages +- avoid double creation of monitor fifo +- Debian: + - debootstrap: ensure /etc/hosts exists + - debootstrap: Add abuild shadow password entry + - livebuild: publish source tarball + - Adds Debian configurations for jessie and unstable + - collect *.ddeb, *.udeb files + +------------------------------------------------------------------- +Thu Aug 16 14:55:53 UTC 2018 - adrian@suse.de + +- docker format: New podman/buildah build engine support +- Support for full names in changes files +- Set %url macro when seeing an Url: +- pacman CLI updates +- enable core dump generation in VM builds +- Disable kpti on guest kernel for performance and correctness +- support for e2fsprogs 1.43.1 with old kernels + +------------------------------------------------------------------- +Fri Jun 29 12:02:10 UTC 2018 - FSchreiner@suse.com + +- docker: + * use a correct prefixed label for disturl + * Support building multiple image types containing a docker image + * Set build user to root for docker/fissile builds + * Compress containers so that old kiwi versions can handle them + * Put obs-docker-support uninstall before the last user line + * Also pass arch and buildflavor when creating the containerinfo + * set disturl as container LABEL + * Uncompress kiwi generated containers + * build-vm-docker: type=bind instead of type=volume in --mount option +- computeblocklists/extractbuild: + * Tweak verbose logging of directories in computeblocklists/extractbuild + * add support for FIEMAP ioctl + * don't use bare F for file + * document and use alternate ioctl numbers + * more tweaks and sanity checks + * Fallback to encode/decode helpers if perl does not support 'Q' in pack/unpack + * Use 'eval' when querying the blocklist +- Misc: + * fix escaping in regexp + * log toplevel KIWI directories in verbose mode + * Split kiwi product parser in a separate function + * Always add extra dependencies when doing sysdeps expansion + * Fix REPOTYPE setting if the PKGCONFIG file is generated by a service + * support zypper's handling of versioned deps + * pam-modules got dropped on sles 15 + * testing for build specific filesystem, which are more important then worker defaults + * mark lint option as obsolete + * Make sure that we know all pre/vminstalls + + +------------------------------------------------------------------- +Tue Apr 3 11:30:47 UTC 2018 - adrian@suse.de + +- KIWI: Support OBS-Profiles kiwi annotation + kiwi profile filtering +- Switch to a little perl http server to get rid of the python2 dependency +- Avoid Ubuntu 18.04 uncompress failure messages +- Don't rely on AppImage's auto-detection for architecture +- build-recipe-livebuild: count ONIE images as build results + +------------------------------------------------------------------- Fri Feb 9 15:17:38 UTC 2018 - adrian@suse.de - add sysrq functionality for KVM builds diff -Nru obs-build-20180302/dummyhttpserver obs-build-20180831/dummyhttpserver --- obs-build-20180302/dummyhttpserver 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/dummyhttpserver 2018-09-19 07:07:55.000000000 +0000 @@ -108,8 +108,8 @@ while (1) { next if $path =~ s!//!/!; next if $path =~ s!/\.(?:/|$)!/!; - next if $path =~ s!/[^/]+/..(?:/|$)!/!; - next if $path =~ s!/..(?:/|$)!/!; + next if $path =~ s!/[^/]+/\.\.(?:/|$)!/!; + next if $path =~ s!/\.\.(?:/|$)!/!; last; } return ($path, $query_string, $qu); diff -Nru obs-build-20180302/expanddeps obs-build-20180831/expanddeps --- obs-build-20180302/expanddeps 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/expanddeps 2018-09-19 07:07:55.000000000 +0000 @@ -423,6 +423,11 @@ my @sysdeps = Build::get_sysbuild($cf, $buildtype, $extrasysdeps); if ($buildtype eq 'kiwi-image' || $buildtype eq 'kiwi-product') { + if (!shift @sysdeps) { + print STDERR "expansion error\n"; + print STDERR " $_\n" for @sysdeps; + exit(1); + } # just use the sysdeps for now, ignore real deps print_rpmlist(@sysdeps); exit(0); @@ -450,8 +455,18 @@ @bdeps = Build::unify(@sysdeps, @bdeps); } -# make sure all preinstalls are in bdeps; -@bdeps = Build::unify(@bdeps, Build::get_preinstalls($cf)); -@bdeps = Build::unify(@bdeps, Build::get_vminstalls($cf)) if $isvm; +# get preinstalls/vminstalls and check if the packages exist +my @xdeps = Build::get_preinstalls($cf); +push @xdeps, Build::get_vminstalls($cf) if $isvm; +my @missing = grep {!$packs{$_}} @xdeps; +if (@missing) { + @missing = sort(Build::unify(@missing)); + print STDERR "expansion error\n"; + print STDERR " missing pre/vminstalls: ".join(', ', @missing)."\n"; + exit(1); +} + +# make sure all preinstalls/vminstalls are in bdeps +@bdeps = Build::unify(@bdeps, @xdeps); print_rpmlist(@bdeps); diff -Nru obs-build-20180302/extractbuild obs-build-20180831/extractbuild --- obs-build-20180302/extractbuild 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/extractbuild 2018-09-19 07:07:55.000000000 +0000 @@ -2,7 +2,7 @@ ################################################################ # -# Copyright (c) 1995-2014 SUSE Linux Products GmbH +# Copyright (c) 1995-2018 SUSE Linux Products GmbH # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or 3 as @@ -71,7 +71,7 @@ while () { chomp; last unless length $_; - my ($filetype, $file, $filesize, $blksize, @blocks) = split(/ /); + my ($filetype, $file, $filesize, $blksize, @blocks) = split(' '); die("invalid input '$_'\n") unless defined($file); $file =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge; die("bad file '$file' (contains \\0)\n") if $file =~ /\0/; @@ -81,7 +81,7 @@ die("file without directory: $file\n") unless $done{$1} && $done{$1} eq 'd'; } if ($filetype eq 'd') { # dir - print "$file\n" if $opt_verbose && $opt_verbose > 1; + print "$file\n" if $opt_verbose && ($opt_verbose > 1 || $file =~ /^KIWI\/[^\/]*$/); mkdir($file) || die("mkdir $file: $!\n"); $done{$file} = 'd'; next; @@ -105,54 +105,46 @@ next; } die("illegal file type: $filetype\n") unless $filetype eq 'f'; - die "invalid input '$_'\n" if !@blocks && $filesize; + print "$file\n" if $opt_verbose && !($opt_verbose == 1 && $file =~ /^KIWI\/.*\//); $done{$file} = 'f'; - $filesize = int($filesize); + open (O, '>', $file) or die "$file: $!\n"; if ($filesize == 0) { - print "$file\n" if $opt_verbose && !($opt_verbose == 1 && $file =~ /^KIWI\/.*\//); - open (O, '>', $file) or die "$file: $!\n"; - close O; + close(O) || die("$file: close error: $!\n"); next; } $blksize = int($blksize); die "$file: invalid block size $blksize\n" unless $blksize > 0 && $blksize <= $bufsize; - my $maxblocks = int($bufsize/$blksize); - print "$file\n" if $opt_verbose && !($opt_verbose == 1 && $file =~ /^KIWI\/.*\//); - open (O, '>', $file) or die "$file: $!\n"; + my $needtruncate; + my $left = $filesize; for my $block (@blocks) { - my $end; - ($block, $end) = split(/-/, $block); - $block = int($block); - if ($block == 0) { # a hole! - $end = (($end || 0) + 1) * $blksize; - $end = $filesize if $end > $filesize; - seek(O, $end, 1); - $filesize -= $end; + die("bad extent '$block'\n") unless $block =~ /^(\d+)(?::(\d+))?(?:-(\d+)(?::(\d+))?)?$/; + my ($startblk, $startoff, $endblk, $endoff) = ($1, $2, $3, $4); + $startoff = 0 unless defined $startoff; + $endblk = $startblk unless defined $endblk; + $endoff = $blksize - 1 unless defined $endoff; + my $start = $startblk * $blksize + $startoff; + my $len = $endblk * $blksize + $endoff + 1 - $start; + die "$file: bad length\n" if $len <= 0; + die "$file: extent is outside of file\n" if $left <= 0; + $len = $left if $len > $left; # it's ok to overshoot the last block + $left -= $len; + if ($start == 0) { # a hole! + seek(O, $len, 1); + $needtruncate = 1; next; } - $end = $block unless $end; - $end = int($end); - seek(F, $block*$blksize, 0) || die "$file: seek: $!\n"; - while ($block <= $end && $filesize) { - my $size; - if ($end == $block) { - $size = $blksize; - ++$block; - } elsif ($maxblocks >= $end-$block) { - $size = ($end-$block)*$blksize; - $block += $end-$block; - } else { - $size = $maxblocks*$blksize; - $block += $maxblocks; - } - $size = $filesize if $size > $filesize; + $needtruncate = undef; + seek(F, $start, 0) || die "$file: seek: $!\n"; + while ($len > 0) { + my $size = $len > $bufsize ? $bufsize : $len; my $buf; (sysread(F, $buf, $size) || 0) == $size || die("$file: read: $!\n"); - $filesize -= $size; (syswrite(O, $buf) || 0) == length($buf) || die("$file: write error\n"); + $len -= $size; } } + truncate(O, $filesize) if $needtruncate; close(O) || die("$file: close error: $!\n"); # sanity check - die "$file: invalid file size ($filesize bytes left)\n" if $filesize != 0; + die "$file: invalid file size ($left bytes left)\n" if $left != 0; } diff -Nru obs-build-20180302/init_buildsystem obs-build-20180831/init_buildsystem --- obs-build-20180302/init_buildsystem 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/init_buildsystem 2018-09-19 07:07:55.000000000 +0000 @@ -356,7 +356,7 @@ REPOTYPE=rpm-md ;; *.dsc) REPOTYPE=debian ;; - */PKGBUILD|PKGBUILD) + */PKGBUILD|PKGBUILD|*/_service:*:PKGBUILD|_service:*:PKGBUILD) REPOTYPE=arch ;; esac fi diff -Nru obs-build-20180302/obs-docker-support obs-build-20180831/obs-docker-support --- obs-build-20180302/obs-docker-support 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/obs-docker-support 2018-09-19 07:07:55.000000000 +0000 @@ -46,7 +46,7 @@ esac done case $cmd in - in|install|rm|remove|up|update) + in|install|rm|remove|up|update|if|info) exec /usr/bin/zypper -D $LOCAL_REPOS_D "${globalopts[@]}" "$cmd" "$@" ;; ar|addrepo) diff -Nru obs-build-20180302/queryconfig obs-build-20180831/queryconfig --- obs-build-20180302/queryconfig 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/queryconfig 2018-09-19 07:07:55.000000000 +0000 @@ -27,6 +27,14 @@ use strict; use Build; +use Build::Rpm; + +sub evalmacros { + my ($config, $str) = @_; + my @xspec; + Build::Rpm::parse({%$config, 'save_expanded' => 1} , [ "$str" ], \@xspec); + return @xspec && ref($xspec[0]) ? $xspec[0]->[1] : ''; +} my ($dist, $archs, $configdir, $type, $argument); @@ -81,6 +89,10 @@ die("Specify which substitute to query\n") unless $argument; my @res = @{$cf->{'substitute'}->{$argument} || []}; print join(' ', @res)."\n" if @res; +} elsif ($type eq 'eval') { + die("Specify what to eval\n") unless defined $argument; + my $result = evalmacros($cf, $argument); + print "$result\n"; } else { die("unsupported query type: $type\n"); } diff -Nru obs-build-20180302/spec2changelog obs-build-20180831/spec2changelog --- obs-build-20180302/spec2changelog 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/spec2changelog 2018-09-19 07:07:55.000000000 +0000 @@ -77,7 +77,7 @@ $head =~ s/^\s+//; $head =~ s/^\-\s+//; if ($head =~ m/^(.+?)\s*<(.+?\@.+?\..+?)>(\s*.*)$/) { - $head = $2; + $head = "$1 <$2>"; } elsif ($head =~ m/^<(.+?\@.+?\..+?)>(\s*.*)$/) { $head = $1; } diff -Nru obs-build-20180302/startdockerd obs-build-20180831/startdockerd --- obs-build-20180302/startdockerd 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/startdockerd 2018-09-19 07:07:55.000000000 +0000 @@ -28,6 +28,7 @@ IS_UNSHARED= KILL= WEBSERVER= +WEBSERVER_ONLY= while test -n "$1" ; do case "$1" in @@ -39,6 +40,11 @@ WEBSERVER="$2" shift 2 ;; + --webserver-only) + WEBSERVER_ONLY="1" + WEBSERVER="$2" + shift 2 + ;; --isunshared) IS_UNSHARED=true shift @@ -80,7 +86,7 @@ rm -f $BUILD_ROOT/.startdockerd.pids -if test -z "$IS_UNSHARED" ; then +if test -z "$IS_UNSHARED" -a -z "$WEBSERVER_ONLY" ; then echo "Unsharing environment" # unshare mounts and network exec unshare -m -n $BUILD_DIR/startdockerd --isunshared --root "$BUILD_ROOT" --webserver "$WEBSERVER" "$@" @@ -130,6 +136,18 @@ # setup mounts test -e "$BUILD_ROOT/proc/self" || mount -n -tproc none $BUILD_ROOT/proc +if test -n "$WEBSERVER" ; then + echo "Starting local repository server" + $BUILD_DIR/dummyhttpserver "$BUILD_ROOT" "$WEBSERVER" & + WEBSERVER_PID=$! + echo "$CONTAINERD_PID $DOCKERD_PID $WEBSERVER_PID" > $BUILD_ROOT/.startdockerd.pids +fi + +if test -n "$WEBSERVER_ONLY" ; then + echo "SKIPPING DOCKERD" + exit 0 +fi + echo "Starting container daemon" CONTAINERD_BIN=/usr/sbin/containerd test -x $BUILD_ROOT/usr/bin/containerd && CONTAINERD_BIN=/usr/bin/containerd @@ -151,12 +169,5 @@ cleanup_and_exit 1 "Docker is dead" fi -if test -n "$WEBSERVER" ; then - echo "Starting local repository server" - $BUILD_DIR/dummyhttpserver "$BUILD_ROOT" "$WEBSERVER" & - WEBSERVER_PID=$! - echo "$CONTAINERD_PID $DOCKERD_PID $WEBSERVER_PID" > $BUILD_ROOT/.startdockerd.pids -fi - echo "Docker is running" exit 0 diff -Nru obs-build-20180302/substitutedeps obs-build-20180831/substitutedeps --- obs-build-20180302/substitutedeps 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/substitutedeps 2018-09-19 07:07:55.000000000 +0000 @@ -296,6 +296,11 @@ $isbuildrequires = 1 if $line =~ /^BuildRequires/i; my $r = $line; $r =~ s/^[^:]*:\s*//; + if ($r =~ /^\(/) { + # no rich dependency support for now + print F "$line\n"; + next; + } my @deps = $r =~ /([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?[\s,]*/g; my @ndeps = (); my $replace = 0; diff -Nru obs-build-20180302/vc obs-build-20180831/vc --- obs-build-20180302/vc 2018-03-02 14:35:05.000000000 +0000 +++ obs-build-20180831/vc 2018-09-19 07:07:55.000000000 +0000 @@ -28,6 +28,14 @@ mailaddr="$USER@$domain" fi +if [ -n "$VC_REALNAME" ]; then + packager="$VC_REALNAME <${VC_MAILADDR:-$mailaddr}>" +elif [ -x /usr/bin/rpmdev-packager ]; then + packager=`rpmdev-packager` +else + packager="`getent passwd $UID | cut -d: -f5 | cut -d ',' -f 1` <$mailaddr>" +fi + EDITOR=${EDITOR:-vim} date=`LC_ALL=POSIX TZ=UTC date` @@ -57,7 +65,7 @@ --help) echo "Usage: $0 [-m MESSAGE|-e] [filename[.changes]|path [file_with_comment]]" echo - echo "Will use '$mailaddr' for changelog entries" + echo "Will use '$packager' for changelog entries" echo echo "Options:" echo " -m MESSAGE add MESSAGE to changes (not open an editor)" @@ -122,7 +130,7 @@ { if [ ! $just_edit ]; then echo "-------------------------------------------------------------------" - echo "$date - $mailaddr" + echo "$date - $packager" echo fi if [ -n "$message" ]; then