commit build for openSUSE:Factory
Hello community, here is the log from the commit of package build for openSUSE:Factory checked in at 2018-11-05 22:47:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/build (Old) and /work/SRC/openSUSE:Factory/.build.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "build" Mon Nov 5 22:47:31 2018 rev:118 rq:643708 version:20181022 Changes: -------- --- /work/SRC/openSUSE:Factory/build/build.changes 2018-09-11 17:07:03.844362520 +0200 +++ /work/SRC/openSUSE:Factory/.build.new/build.changes 2018-11-05 22:47:35.620647553 +0100 @@ -1,0 +2,14 @@ +Mon Oct 22 09:43:20 UTC 2018 - Adrian Schröter <adrian@suse.de> + +- require psmisc util for fuser +- Start debian support for kiwi images/containers +- Support building with unordered repositories for kiwi/docker builds +- Write the package list of the base container in kiwi container builds +- Support kiwi's "additionaltags" attribute (added in kiwi 9.15.3) +- Add some substitutes for the extra container tags +- Support "OBS-AddTag" directive to set multiple container tags in kiwi builds +- Archlinux updates +- SLE 12 SP4 config +- Appimage: support source file parsing + +------------------------------------------------------------------- Old: ---- obs-build-20180830.tar.gz New: ---- obs-build-20181022.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ build.spec ++++++ --- /var/tmp/diff_new_pack.oVL8Aj/_old 2018-11-05 22:47:38.704643652 +0100 +++ /var/tmp/diff_new_pack.oVL8Aj/_new 2018-11-05 22:47:38.704643652 +0100 @@ -22,7 +22,7 @@ Summary: A Script to Build SUSE Linux RPMs License: GPL-2.0-or-later AND GPL-2.0-only Group: Development/Tools/Building -Version: 20180830 +Version: 20181022 Release: 0 Source: obs-build-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -33,6 +33,14 @@ Requires: binutils Requires: perl Requires: tar +# needed for fuser +Requires: psmisc +# just to verify existence of packages +BuildRequires: bash +BuildRequires: binutils +BuildRequires: perl +BuildRequires: psmisc +BuildRequires: tar %if 0%{?fedora} Requires: perl-MD5 Requires: perl-TimeDate ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.oVL8Aj/_old 2018-11-05 22:47:38.756643586 +0100 +++ /var/tmp/diff_new_pack.oVL8Aj/_new 2018-11-05 22:47:38.760643581 +0100 @@ -1,5 +1,5 @@ pkgname=build -pkgver=20180830 +pkgver=20181022 pkgrel=0 pkgdesc="Build packages in sandbox" arch=('i686' 'x86_64') ++++++ build.dsc ++++++ --- /var/tmp/diff_new_pack.oVL8Aj/_old 2018-11-05 22:47:38.796643536 +0100 +++ /var/tmp/diff_new_pack.oVL8Aj/_new 2018-11-05 22:47:38.796643536 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: build -Version: 20180830 +Version: 20181022 Binary: build Maintainer: Adrian Schroeter <adrian@suse.de> Architecture: all ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.oVL8Aj/_old 2018-11-05 22:47:38.816643510 +0100 +++ /var/tmp/diff_new_pack.oVL8Aj/_new 2018-11-05 22:47:38.816643510 +0100 @@ -1,4 +1,4 @@ -build (20180830) unstable; urgency=low +build (20181022) unstable; urgency=low * Update to current git trunk - add sles11sp2 build config and adapt autodetection ++++++ obs-build-20180830.tar.gz -> obs-build-20181022.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/Build/Docker.pm new/obs-build-20181022/Build/Docker.pm --- old/obs-build-20180830/Build/Docker.pm 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/Build/Docker.pm 2018-10-22 12:11:51.000000000 +0200 @@ -20,7 +20,8 @@ package Build::Docker; -use Build::SimpleXML; +use Build::SimpleXML; # to parse the annotation +use Build::SimpleJSON; use strict; @@ -44,9 +45,10 @@ } sub addrepo { - my ($ret, $url) = @_; + my ($ret, $url, $prio) = @_; - unshift @{$ret->{'repo_urls'}}, $url; + unshift @{$ret->{'imagerepos'}}, { 'url' => $url }; + $ret->{'imagerepos'}->[0]->{'priority'} = $prio if defined $prio; if ($Build::Kiwi::urlmapper) { my $prp = $Build::Kiwi::urlmapper->($url); if (!$prp) { @@ -55,15 +57,17 @@ } my ($projid, $repoid) = split('/', $prp, 2); unshift @{$ret->{'path'}}, {'project' => $projid, 'repository' => $repoid}; - return; + $ret->{'path'}->[0]->{'priority'} = $prio if defined $prio; + return 1; } else { # this is just for testing purposes... $url =~ s/^\/+$//; $url =~ s/:\//:/g; my @url = split('/', $url); unshift @{$ret->{'path'}}, {'project' => $url[-2], 'repository' => $url[-1]} if @url >= 2; + $ret->{'path'}->[0]->{'priority'} = $prio if defined $prio; + return 1; } - return 1; } sub cmd_zypper { @@ -134,6 +138,7 @@ my ($cf, $fn) = @_; my $basecontainer; + my $unorderedrepos; my $dockerfile_data = slurp($fn); return { 'error' => 'could not open Dockerfile' } unless defined $dockerfile_data; @@ -142,7 +147,7 @@ 'name' => 'docker', 'deps' => [], 'path' => [], - 'repo_urls' => [], + 'imagerepos' => [], }; while (@lines) { @@ -153,6 +158,9 @@ my @tags = split(' ', $1); push @{$ret->{'containertags'}}, @tags if @tags; } + if ($line =~ /^#!UnorderedRepos\s*$/) { + $unorderedrepos = 1; + } next; } # add continuation lines @@ -206,6 +214,7 @@ } } push @{$ret->{'deps'}}, "container:$basecontainer" if $basecontainer; + push @{$ret->{'deps'}}, '--unorderedimagerepos' if $unorderedrepos; return $ret; } @@ -222,8 +231,7 @@ for (@tags) { $_ .= ':latest' unless /:[^:\/]+$/; } - @tags = map {"\"$_\""} @tags; - my @repos = map {"{ \"url\": \"$_\" }"} @{$d->{'repo_urls'} || []}; + my @repos = @{$d->{'imagerepos'} || []}; if ($annotationfile) { my $annotation = slurp($annotationfile); $annotation = Build::SimpleXML::parse($annotation) if $annotation; @@ -233,17 +241,20 @@ $annorepos = undef unless $annorepos && ref($annorepos) eq 'ARRAY'; for my $annorepo (@{$annorepos || []}) { next unless $annorepo && ref($annorepo) eq 'HASH' && $annorepo->{'url'}; - push @repos, "{ \"url\": \"$annorepo->{'url'}\" }"; + push @repos, { 'url' => $annorepo->{'url'}, '_type' => {'priority' => 'number'} }; + $repos[-1]->{'priority'} = $annorepo->{'priority'} if defined $annorepo->{'priority'}; } } 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"; + my $containerinfo = { + 'buildtime' => $buildtime, + '_type' => {'buildtime' => 'number'}, + }; + $containerinfo->{'tags'} = \@tags if @tags; + $containerinfo->{'repos'} = \@repos if @repos; + $containerinfo->{'file'} = $image if defined $image; + $containerinfo->{'disturl'} = $disturl if defined $disturl; + print Build::SimpleJSON::unparse($containerinfo)."\n"; } sub showtags { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/Build/Kiwi.pm new/obs-build-20181022/Build/Kiwi.pm --- old/obs-build-20180830/Build/Kiwi.pm 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/Build/Kiwi.pm 2018-10-22 12:11:51.000000000 +0200 @@ -22,6 +22,7 @@ use strict; use Build::SimpleXML; +use Build::SimpleJSON; our $bootcallback; our $urlmapper; @@ -200,7 +201,7 @@ } sub kiwiparse { - my ($xml, $arch, $buildflavor, $count) = @_; + my ($xml, $arch, $buildflavor, $release, $count) = @_; $count ||= 0; die("kiwi config inclusion depth limit reached\n") if $count++ > 10; @@ -222,12 +223,15 @@ my $obsexclusivearch; my $obsexcludearch; my $obsprofiles; + my $unorderedrepos; $obsexclusivearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExclusiveArch:\s+(.*)\s+-->\s*$/im; $obsexcludearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExcludeArch:\s+(.*)\s+-->\s*$/im; $obsprofiles = $1 if $xml =~ /^\s*<!--\s+OBS-Profiles:\s+(.*)\s+-->\s*$/im; if ($obsprofiles) { $obsprofiles = [ grep {defined($_)} map {$_ eq '@BUILD_FLAVOR@' ? $buildflavor : $_} split(' ', $obsprofiles) ]; } + $unorderedrepos = 1 if $xml =~ /^\s*<!--\s+OBS-UnorderedRepos\s+-->\s*$/im; + my $schemaversion = $kiwi->{'schemaversion'} ? versionstring($kiwi->{'schemaversion'}) : 0; $ret->{'name'} = $kiwi->{'name'} if $kiwi->{'name'}; $ret->{'filename'} = $kiwi->{'name'} if $kiwi->{'name'}; @@ -275,6 +279,18 @@ if ($preferences->[0]->{'version'}) { $ret->{'version'} = $preferences->[0]->{'version'}->[0]->{'_content'}; } + + # add extra tags + my @extratags; + if ($xml =~ /^\s*<!--\s+OBS-AddTag:\s+(.*)\s+-->\s*$/im) { + for (split(' ', $1)) { + s/<VERSION>/$ret->{'version'}/g if $ret->{'version'}; + s/<RELEASE>/$release/g if $release; + $_ = "$_:latest" unless /:[^\/]+$/; + push @extratags, $_; + } + } + my $containerconfig; for my $pref (@{$preferences || []}) { if ($obsprofiles && $pref->{'profiles'}) { @@ -290,7 +306,7 @@ # for kiwi 3.8 and before push @types, $type->{'_content'}; } - # save containerconfig so that we can retrievethe tag + # save containerconfig so that we can retrieve the tag $containerconfig = $type->{'containerconfig'}->[0] if $type->{'containerconfig'}; # add derived container dependency @@ -328,7 +344,7 @@ my ($bootxml, $xsrc) = $bootcallback->($1, $2); next unless $bootxml; push @extrasources, $xsrc if $xsrc; - my $bret = kiwiparse($bootxml, $arch, $buildflavor, $count); + my $bret = kiwiparse($bootxml, $arch, $buildflavor, $release, $count); push @bootrepos, map {"$_->{'project'}/$_->{'repository'}"} @{$bret->{'path'} || []}; push @packages, @{$bret->{'deps'} || []}; push @extrasources, @{$bret->{'extrasource'} || []}; @@ -431,6 +447,7 @@ } push @packages, "kiwi-packagemanager:$packman"; push @packages, "--dorecommends--", "--dosupplements--" if $patterntype && $patterntype eq 'plusRecommended'; + push @packages, '--unorderedimagerepos', if $unorderedrepos; $ret->{'exclarch'} = [ unify(split(' ', $obsexclusivearch)) ] if $obsexclusivearch; $ret->{'badarch'} = [ unify(split(' ', $obsexcludearch)) ] if $obsexcludearch; @@ -451,16 +468,17 @@ $ret->{'imagerepos'} = \@imagerepos if @imagerepos; if ($containerconfig) { my $containername = $containerconfig->{'name'}; - my $containertags = $containerconfig->{'tag'}; - $containertags = [ $containertags ] if defined($containertags) && !ref($containertags); - if ($containertags && defined($containername)) { - for (@$containertags) { - $_ = "$containername:$_" unless /:/; + my @containertags; + if (defined $containername) { + push @containertags, $containerconfig->{'tag'} if defined $containerconfig->{'tag'}; + push @containertags, 'latest' unless @containertags; + if (defined($containerconfig->{'additionaltags'})) { + push @containertags, split(',', $containerconfig->{'additionaltags'}); } + @containertags = map {"$containername:$_"} @containertags; } - $containertags = undef if $containertags && !@$containertags; - $containertags = [ "$containername:latest" ] if defined($containername) && !$containertags; - $ret->{'container_tags'} = $containertags if $containertags; + push @containertags, @extratags if @extratags; + $ret->{'container_tags'} = [ unify(@containertags) ] if @containertags; } if ($obsprofiles) { if (@$obsprofiles) { @@ -482,7 +500,7 @@ close F; $cf ||= {}; my $d; - eval { $d = kiwiparse($xml, ($cf->{'arch'} || ''), $cf->{'buildflavor'}, 0) }; + eval { $d = kiwiparse($xml, ($cf->{'arch'} || ''), $cf->{'buildflavor'}, $cf->{'buildrelease'}, 0) }; if ($@) { my $err = $@; chomp $err; @@ -514,34 +532,33 @@ (undef, $buildflavor) = splice(@ARGV, 0, 2) if @ARGV > 2 && $ARGV[0] eq '--buildflavor'; my ($fn, $image) = @ARGV; local $urlmapper = sub { return $_[0] }; + my $release; + $release = $1 if $image =~ /.*-Build(\d+\.\d+).*/; my $cf = {}; $cf->{'arch'} = $arch if defined $arch; $cf->{'buildflavor'} = $buildflavor if defined $buildflavor; + $cf->{'buildrelease'} = $release if $release; my $d = parse($cf, $fn); die("$d->{'error'}\n") if $d->{'error'}; $image =~ s/.*\/// if defined $image; - my $release; - $release = $1 if $image =~ /.*-Build(\d+\.\d+).*/; - my @tags = map {"\"$_\""} @{$d->{'container_tags'} || []}; my @repos; for my $repo (@{$d->{'imagerepos'} || []}) { - if (defined $repo->{'priority'}) { - push @repos, "{ \"url\": \"$repo->{'url'}\", \"priority\": $repo->{'priority'} }"; - } else { - push @repos, "{ \"url\": \"$repo->{'url'}\" }"; - } + push @repos, { 'url' => $repo->{'url'}, '_type' => {'priority' => 'number'} }; + $repos[-1]->{'priority'} = $repo->{'priority'} if defined $repo->{'priority'}; } my $buildtime = time(); - print "{\n"; - print " \"name\": \"$d->{'name'}\""; - print ",\n \"version\": \"$d->{'version'}\"" if defined $d->{'version'}; - print ",\n \"release\": \"$release\"" if defined $release; - print ",\n \"tags\": [ ".join(', ', @tags)." ]" if @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"; + my $containerinfo = { + 'name' => $d->{'name'}, + 'buildtime' => $buildtime, + '_type' => {'buildtime' => 'number'}, + }; + $containerinfo->{'version'} = $d->{'version'} if defined $d->{'version'}; + $containerinfo->{'release'} = $release if defined $d->{'version'}; + $containerinfo->{'tags'} = $d->{'container_tags'} if @{$d->{'container_tags'} || []}; + $containerinfo->{'repos'} = \@repos if @repos; + $containerinfo->{'file'} = $image if defined $image; + $containerinfo->{'disturl'} = $disturl if defined $disturl; + print Build::SimpleJSON::unparse($containerinfo)."\n"; } # not implemented yet. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/Build/SimpleJSON.pm new/obs-build-20181022/Build/SimpleJSON.pm --- old/obs-build-20180830/Build/SimpleJSON.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20181022/Build/SimpleJSON.pm 2018-10-22 12:11:51.000000000 +0200 @@ -0,0 +1,102 @@ +################################################################ +# +# Copyright (c) 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 +# 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 +# +################################################################ + +package Build::SimpleJSON; + +use strict; + +sub unparse_keys { + my ($d) = @_; + my @k = grep {$_ ne '_start' && $_ ne '_end' && $_ ne '_order' && $_ ne '_type'} sort keys %$d; + return @k unless $d->{'_order'}; + my %k = map {$_ => 1} @k; + my @ko; + for (@{$d->{'_order'}}) { + push @ko, $_ if delete $k{$_}; + } + return (@ko, grep {$k{$_}} @k); +} + +my %specialescapes = ( + '"' => '\\"', + '\\' => '\\\\', + '/' => '\\/', + "\b" => '\\b', + "\f" => '\\f', + "\n" => '\\n', + "\r" => '\\r', + "\t" => '\\t', +); + +sub unparse_string { + my ($d) = @_; + $d =~ s/([\"\\\000-\037])/$specialescapes{$1} || sprintf('\\u%04d', ord($1))/ge; + return "\"$d\""; +} + +sub unparse_bool { + my ($d) = @_; + return $d ? 'true' : 'false'; +} + +sub unparse_number { + my ($d) = @_; + return sprintf("%.f", $d) if $d == int($d); + return sprintf("%g", $d); +} + +sub unparse { + my ($d, %opts) = @_; + + my $r = ''; + if (ref($d) eq 'ARRAY') { + return '[]' unless @$d; + my $indent = $opts{'ugly'} ? '' : $opts{'indent'} || ''; + my $nl = $opts{'ugly'} ? '' : "\n"; + my $sp = $opts{'ugly'} ? '' : " "; + my $first = 0; + for my $dd (@$d) { + $r .= ",$nl" if $first++; + $r .= "$indent$sp$sp$sp".unparse($dd, %opts, 'indent' => " $indent"); + } + return "\[$nl$r$nl$indent\]"; + } + if (ref($d) eq 'HASH') { + my @k = unparse_keys($d); + return '{}' unless @k; + my $indent = $opts{'ugly'} ? '' : $opts{'indent'} || ''; + my $nl = $opts{'ugly'} ? '' : "\n"; + my $sp = $opts{'ugly'} ? '' : " "; + my $first = 0; + for my $k (@k) { + $r .= ",$nl" if $first++; + my $dd = $d->{$k}; + $r .= "$indent$sp$sp$sp".unparse_string($k)."$sp:$sp".unparse($dd, %opts, 'indent' => " $indent", '_type' => ($d->{'_type'} || {})->{$k}); + } + return "\{$nl$r$nl$indent\}"; + } + return 'null' unless defined $d; + my $type = $opts{'_type'} || ''; + return unparse_bool($d) if $type eq 'bool'; + return unparse_number($d) if $type eq 'number'; + return unparse_string($d); +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/Makefile new/obs-build-20181022/Makefile --- old/obs-build-20180830/Makefile 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/Makefile 2018-10-22 12:11:51.000000000 +0200 @@ -75,6 +75,7 @@ startdockerd \ dummyhttpserver \ obs-docker-support \ + create_container_package_list \ $(DESTDIR)$(pkglibdir) install -m755 emulator/emulator.sh $(DESTDIR)$(pkglibdir)/emulator/ install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/build-recipe new/obs-build-20181022/build-recipe --- old/obs-build-20180830/build-recipe 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/build-recipe 2018-10-22 12:11:51.000000000 +0200 @@ -191,7 +191,7 @@ } recipe_build_time_statistics() { - if test "$DO_STATISTICS" = 1 -a -n "$RECIPE_BUILD_START_TIME" -a -n "$TOPDIR" ; then + if test "$DO_STATISTICS" = 1 -a -n "$RECIPE_BUILD_START_TIME" -a -n "$TOPDIR" -a -n "$RUNNING_IN_VM" ; then mkdir -p "$TOPDIR/OTHER" echo "TIME_main_build: $(( `date +%s` - $RECIPE_BUILD_START_TIME))" >> "$TOPDIR/OTHER/_statistics" RECIPE_BUILD_START_TIME= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/build-recipe-kiwi new/obs-build-20181022/build-recipe-kiwi --- old/obs-build-20180830/build-recipe-kiwi 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/build-recipe-kiwi 2018-10-22 12:11:51.000000000 +0200 @@ -493,6 +493,7 @@ KIWI_MAIN_PARAMETERS= KIWI_BUILD_PARAMETERS= KIWI_BUNDLE_PARAMETERS= + KIWI_DERIVED_CONTAINER= for i in $KIWI_PARAMETERS ; do if test -n "$lasti" ; then i="$lasti=$i" @@ -528,6 +529,13 @@ 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" + KIWI_DERIVED_CONTAINER="$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}" + fi + KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS $i" + ;; + --set-container-derived-from=dir://./containers/*.tar*) + if test -f "$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}" ; then + KIWI_DERIVED_CONTAINER="$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}" fi KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS $i" ;; @@ -627,6 +635,82 @@ 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 + if test -n "$KIWI_DERIVED_CONTAINER" ; then + for r in $BUILD_ROOT/$TOPDIR/KIWI/*.packages ; do + test -e "$r" || continue + r="${r%.packages}" + for rr in $r*.containerinfo ; do + test -e "$rr" || continue + echo "creating base package information" + rm -f "$BUILD_ROOT/tmp/create_derived_package_list" + cp "$BUILD_DIR/create_container_package_list" "$BUILD_ROOT/tmp/create_container_package_list" + chroot "$BUILD_ROOT" /bin/bash /tmp/create_container_package_list "${KIWI_DERIVED_CONTAINER#$BUILD_ROOT}" > "$r.basepackages" + rm -f "$BUILD_ROOT/tmp/create_derived_package_list" + break + done + done + fi +} + +createrepo_debian_kiwi() { + local dir=$1 + local prp=$2 + local arch=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH") + cat >"${BUILD_ROOT}/.createrepo_debian.tmp.sh" <<-EOF + cd "$dir" || exit 1 + dpkg-scanpackages -m . > Packages + gzip -c9 < Packages > Packages.gz + dpkg-scansources . > Sources + gzip -c9 < Sources > Sources.gz + EOF + chroot $BUILD_ROOT su -c "sh /.createrepo_debian.tmp.sh" - root + cat > "${BUILD_ROOT}/$dir/Release" <<-EOF + Origin: obs:/$prp + Label: ${prp%/*} + Codename: ${prp#*/} + Architectures: $arch + Description: obs repository for $prp + EOF + echo "SHA256:" >> "${BUILD_ROOT}/$dir/Release" + for file in "${BUILD_ROOT}/$dir/Packages"* "${BUILD_ROOT}/$dir/Sources"*; do + local SUM=( $(sha256sum ${file}) ) + local SIZE=$(stat -c '%s' ${file}) + echo " ${SUM} ${SIZE} ${file#${BUILD_ROOT}/$dir/}" >> "${BUILD_ROOT}/$dir/Release" + done +} + +createrepo_debian_dist_kiwi() { + local dir=$1 + local prp=$2 + local dist=$3 + local arch=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH") + mkdir -p "${BUILD_ROOT}/$dir/dists/${dist}/main/binary-$arch" + mkdir -p "${BUILD_ROOT}/$dir/dists/${dist}/main/source" + cat >"${BUILD_ROOT}/.createrepo_debian.tmp.sh" <<-EOF + cd "$dir" || exit 1 + dpkg-scanpackages -m . > dists/${dist}/main/binary-$arch/Packages + gzip -c9 < dists/${dist}/main/binary-$arch/Packages > dists/${dist}/main/binary-$arch/Packages.gz + dpkg-scansources . > dists/${dist}/main/source/Sources + gzip -c9 < dists/${dist}/main/source/Sources > dists/${dist}/main/source/Sources.gz + EOF + chroot $BUILD_ROOT su -c "sh /.createrepo_debian.tmp.sh" - root + ln -s ${dist} ${BUILD_ROOT}/$dir/dists/stable + + cat > "${BUILD_ROOT}/$dir/dists/${dist}/Release" <<-EOF + Origin: obs:/$prp + Label: ${prp%/*} + Suite: stable + Codename: $dist + Architectures: $arch + Description: obs repository for $prp + Components: main + EOF + echo "SHA256:" >> "${BUILD_ROOT}/$dir/dists/${dist}/Release" + for file in "${BUILD_ROOT}/$dir/dists/${dist}/main"/*/Packages* "${BUILD_ROOT}/$dir/$dists/main/source"/Sources*; do + local SUM=( $(sha256sum ${file}) ) + local SIZE=$(stat -c '%s' ${file}) + echo " ${SUM} ${SIZE} ${file#${BUILD_ROOT}/$dir/dists/${dist}/}" >> "${BUILD_ROOT}/$dir/dists/${dist}/Release" + done } recipe_build_kiwi() { @@ -643,6 +727,11 @@ ln -sf $TOPDIR/SOURCES/repos $BUILD_ROOT/repos test -d $BUILD_ROOT/$TOPDIR/SOURCES/containers && ln -sf $TOPDIR/SOURCES/containers $BUILD_ROOT/containers cd $BUILD_ROOT/$TOPDIR/SOURCES/repos + DEBDIST= + if test -x "$BUILD_ROOT/usr/sbin/debootstrap" ; then + DEBDIST=$(sed -ne 's/.*<repository.*distribution="\([^"]*\)".*/\1/p' <"$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" | head -n 1) + echo "using distribution '$DEBDIST'" + fi for r in *[^:]/* ; do test -L $r && continue test -d $r || continue @@ -657,11 +746,18 @@ repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/" fi if test "$imagetype" != product -a "$DO_INIT" != "false" ; then - echo "creating repodata for $repo" - if chroot $BUILD_ROOT createrepo --no-database --simple-md-filenames --help >/dev/null 2>&1 ; then - chroot $BUILD_ROOT createrepo --no-database --simple-md-filenames "$repo" + if ! test -x "$BUILD_ROOT/usr/sbin/debootstrap" ; then + + echo "creating repodata for $r" + if chroot $BUILD_ROOT createrepo --no-database --simple-md-filenames --help >/dev/null 2>&1 ; then + chroot $BUILD_ROOT createrepo --no-database --simple-md-filenames "$repo" + else + chroot $BUILD_ROOT createrepo "$repo" + fi else - chroot $BUILD_ROOT createrepo "$repo" + echo "creating debian repodata for $r" + createrepo_debian_kiwi "$repo" "$r" + test -n "$DEBDIST" && createrepo_debian_dist_kiwi "$repo" "$r" "$DEBDIST" fi fi done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/build-recipe-spec new/obs-build-20181022/build-recipe-spec --- old/obs-build-20180830/build-recipe-spec 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/build-recipe-spec 2018-10-22 12:11:51.000000000 +0200 @@ -82,6 +82,7 @@ if test -n "$BUILD_JOBS" ; then cat >> $BUILD_ROOT/root/$rawcfgmacros <<-EOF + ### from obs-build %jobs $BUILD_JOBS %_smp_mflags -j$BUILD_JOBS EOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/configs/arch.conf new/obs-build-20181022/configs/arch.conf --- old/obs-build-20180830/configs/arch.conf 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/configs/arch.conf 2018-10-22 12:11:51.000000000 +0200 @@ -1,10 +1,10 @@ Repotype: arch Preinstall: glibc bash perl sed grep coreutils pacman pacman-mirrorlist -Preinstall: gawk gzip filesystem curl libidn acl gpgme libarchive -Preinstall: openssl libssh2 zlib libassuan libgpg-error attr +Preinstall: gawk gzip filesystem icu libpsl curl libidn2 libunistring acl gpgme libarchive +Preinstall: openssl libssh2 zlib libassuan libgpg-error attr gcc-libs Preinstall: expat xz bzip2 readline lzo krb5 e2fsprogs keyutils -Preinstall: ncurses lz4 libpsl icu gcc-libs libnghttp2 libidn2 libunistring +Preinstall: ncurses lz4 libnghttp2 zstd VMinstall: util-linux libutil-linux binutils pcre libcap @@ -19,7 +19,8 @@ Prefer: zlib ttf-dejavu Prefer: libgl jdk7-openjdk libdrm -Prefer: -nvidia-libgl -nvidia-304xx-utils +Prefer: -nvidia-libgl -nvidia-304xx-utils -nvidia-304xx-utils -nvidia-utils Prefer: mesa-libgl Prefer: curl:ca-certificates +Prefer: glib-networking:ca-certificates diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/configs/sle12.4.conf new/obs-build-20181022/configs/sle12.4.conf --- old/obs-build-20180830/configs/sle12.4.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20181022/configs/sle12.4.conf 2018-11-05 22:47:39.000643278 +0100 @@ -0,0 +1 @@ +symbolic link to sles12.conf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/create_container_package_list new/obs-build-20181022/create_container_package_list --- old/obs-build-20180830/create_container_package_list 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20181022/create_container_package_list 2018-10-22 12:11:51.000000000 +0200 @@ -0,0 +1,28 @@ +#!/bin/bash + +container="$1" + +if test -z "$container" ; then + echo "usage: create_container_package_list <container>" + exit 1 +fi +if ! test -s "$container" ; then + echo "no such container: $container" >&2 + exit 1 +fi + +tmpdir=$(mktemp -d) +trap "rm -rf $tmpdir" EXIT + +case "$container" in + *.tar) cat < "$container" > $tmpdir/cont ;; + *.tar.gz) gunzip < "$container" > $tmpdir/cont ;; + *.tar.xz) xzdec < "$container" > $tmpdir/cont ;; + *) echo "unsuppored container name $container" >&2 ; exit 1 ;; +esac + +skopeo copy docker-archive:$tmpdir/cont oci:$tmpdir/image:latest >/dev/null +rm -f $tmpdir/cont +umoci unpack --image $tmpdir/image:latest $tmpdir/unpack >/dev/null +chroot $tmpdir/unpack/rootfs rpm -qa --qf '[%{NAME}|%{EPOCH}|%{VERSION}|%{RELEASE}|%{ARCH}|%{DISTURL}\n]' + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/dist/build.changes new/obs-build-20181022/dist/build.changes --- old/obs-build-20180830/dist/build.changes 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/dist/build.changes 2018-10-22 12:11:51.000000000 +0200 @@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Mon Oct 22 09:43:20 UTC 2018 - Adrian Schröter <adrian@suse.de> + +- require psmisc util for fuser +- Start debian support for kiwi images/containers +- Support building with unordered repositories for kiwi/docker builds +- Write the package list of the base container in kiwi container builds +- Support kiwi's "additionaltags" attribute (added in kiwi 9.15.3) +- Add some substitutes for the extra container tags +- Support "OBS-AddTag" directive to set multiple container tags in kiwi builds +- Archlinux updates +- SLE 12 SP4 config +- Appimage: support source file parsing + +------------------------------------------------------------------- Wed Aug 29 13:57:07 UTC 2018 - Adrian Schröter <adrian@suse.de> - Fall back to $mailaddr if $VC_MAILADDR is unset/null diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20180830/dist/build.spec new/obs-build-20181022/dist/build.spec --- old/obs-build-20180830/dist/build.spec 2018-08-30 11:14:11.000000000 +0200 +++ new/obs-build-20181022/dist/build.spec 2018-10-22 12:11:51.000000000 +0200 @@ -33,6 +33,10 @@ Requires: binutils Requires: perl Requires: tar +# needed for fuser +Requires: psmisc +# just to verify existence of packages +BuildRequires: psmisc bash binutils perl tar %if 0%{?fedora} Requires: perl-MD5 Requires: perl-TimeDate
participants (1)
-
root