Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package build for openSUSE:Factory checked 
in at 2021-09-11 22:24:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/build (Old)
 and      /work/SRC/openSUSE:Factory/.build.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "build"

Sat Sep 11 22:24:11 2021 rev:136 rq:915720 version:20210902

Changes:
--------
--- /work/SRC/openSUSE:Factory/build/build.changes      2021-08-24 
10:54:49.544324691 +0200
+++ /work/SRC/openSUSE:Factory/.build.new.1899/build.changes    2021-09-11 
22:24:18.111373085 +0200
@@ -1,0 +2,10 @@
+Thu Sep  2 09:18:33 UTC 2021 - Adrian Schr??ter <adr...@suse.de>
+
+- Fix unpacking of deb/arch archives without bsdtar
+
+-------------------------------------------------------------------
+Mon Aug 30 12:44:52 UTC 2021 - Adrian Schr??ter <adr...@suse.de>
+
+- fixed regression in multiline macro evaluation from 20th August release
+
+-------------------------------------------------------------------

Old:
----
  obs-build-20210820.tar.gz

New:
----
  obs-build-20210902.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ build.spec ++++++
--- /var/tmp/diff_new_pack.Pst6eo/_old  2021-09-11 22:24:18.803373767 +0200
+++ /var/tmp/diff_new_pack.Pst6eo/_new  2021-09-11 22:24:18.803373767 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package build
+# spec file
 #
 # Copyright (c) 2021 SUSE LLC
 #
@@ -28,7 +28,7 @@
 Summary:        A Script to Build SUSE Linux RPMs
 License:        GPL-2.0-only OR GPL-3.0-only
 Group:          Development/Tools/Building
-Version:        20210820
+Version:        20210902
 Release:        0
 Source:         obs-build-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -65,19 +65,19 @@
 # None of them are actually required for core features.
 # Perl helper scripts use them.
 Recommends:     perl(Date::Language)
+Recommends:     /sbin/mkfs.ext3
+Recommends:     /usr/bin/qemu-kvm
+Recommends:     bsdtar
+Recommends:     qemu-linux-user
+Recommends:     zstd
 Recommends:     perl(Date::Parse)
 Recommends:     perl(LWP::UserAgent)
+Recommends:     perl(Net::SSL)
 Recommends:     perl(Pod::Usage)
 Recommends:     perl(Time::Zone)
 Recommends:     perl(URI)
 Recommends:     perl(XML::Parser)
-Recommends:     perl(Net::SSL)
 Recommends:     perl(YAML::LibYAML)
-Recommends:     bsdtar
-Recommends:     qemu-linux-user
-Recommends:     zstd
-Recommends:     /usr/bin/qemu-kvm
-Recommends:     /sbin/mkfs.ext3
 %endif
 
 %if 0%{?suse_version} > 1120 || ! 0%{?suse_version}
@@ -126,6 +126,7 @@
 %if "%{_host_cpu}" == "i686"
 %define initvm_arch i586
 %endif
+
 %package initvm-%{initvm_arch}
 Summary:        Virtualization initializer for emulated cross architecture 
builds
 Group:          Development/Tools/Building

++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.Pst6eo/_old  2021-09-11 22:24:18.835373799 +0200
+++ /var/tmp/diff_new_pack.Pst6eo/_new  2021-09-11 22:24:18.839373803 +0200
@@ -1,5 +1,5 @@
 pkgname=build
-pkgver=20210820
+pkgver=20210902
 pkgrel=0
 pkgdesc="Build packages in sandbox"
 arch=('i686' 'x86_64')

++++++ _service ++++++
--- /var/tmp/diff_new_pack.Pst6eo/_old  2021-09-11 22:24:18.855373819 +0200
+++ /var/tmp/diff_new_pack.Pst6eo/_new  2021-09-11 22:24:18.855373819 +0200
@@ -1,7 +1,7 @@
 <services>
   <service name="tar_scm" mode="manual">
-    <param name="revision">20210820</param>
-    <param name="version">20210820</param>
+    <param name="revision">20210902</param>
+    <param name="version">20210902</param>
     <param name="url">git://github.com/openSUSE/obs-build.git</param>
     <param name="scm">git</param>
     <param name="extract">dist/build.changes</param>

++++++ build.dsc ++++++
--- /var/tmp/diff_new_pack.Pst6eo/_old  2021-09-11 22:24:18.871373835 +0200
+++ /var/tmp/diff_new_pack.Pst6eo/_new  2021-09-11 22:24:18.871373835 +0200
@@ -1,6 +1,6 @@
 Format: 1.0
 Source: build
-Version: 20210820
+Version: 20210902
 Binary: build
 Maintainer: Adrian Schroeter <adr...@suse.de>
 Architecture: all

++++++ debian.changelog ++++++
--- /var/tmp/diff_new_pack.Pst6eo/_old  2021-09-11 22:24:18.899373862 +0200
+++ /var/tmp/diff_new_pack.Pst6eo/_new  2021-09-11 22:24:18.899373862 +0200
@@ -1,4 +1,4 @@
-build (20210820) unstable; urgency=low
+build (20210902) unstable; urgency=low
 
   * Update to current git trunk
     - add sles11sp2 build config and adapt autodetection

++++++ debian.control ++++++
--- /var/tmp/diff_new_pack.Pst6eo/_old  2021-09-11 22:24:18.923373886 +0200
+++ /var/tmp/diff_new_pack.Pst6eo/_new  2021-09-11 22:24:18.927373890 +0200
@@ -7,7 +7,7 @@
 
 Package: obs-build
 Architecture: all
-Depends: ${perl:Depends}, rpm
+Depends: ${perl:Depends}, rpm, libarchive-tools | bsdtar
 Recommends: rpm2cpio
 Conflicts: build
 Replaces: build

++++++ obs-build-20210820.tar.gz -> obs-build-20210902.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/Build/Modulemd.pm 
new/obs-build-20210902/Build/Modulemd.pm
--- old/obs-build-20210820/Build/Modulemd.pm    1970-01-01 01:00:00.000000000 
+0100
+++ new/obs-build-20210902/Build/Modulemd.pm    2021-09-02 11:50:53.000000000 
+0200
@@ -0,0 +1,91 @@
+################################################################
+#
+# Copyright (c) 2021 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::Modulemd;
+
+use Build::SimpleYAML;
+
+use strict;
+
+# This module provides a modulemd data to yaml converter. It supports
+# both the 'modulemd' and 'modulemd-defaults' formats.
+
+my $mdtemplate = {
+  '_order' => [ 'document', 'version', 'data' ],
+  'version' => 'number',
+  'data' => {
+    '_order' => [ 'name', 'stream', 'version', 'context', 'arch', 'summary', 
'description', 'license', 'xmd', 'dependencies', 'references', 'profiles', 
'api', 'filter', 'buildopts', 'components', 'artifacts' ],
+    'version' => 'number',
+    'description' => 'folded',
+    'license' => {
+      '_order' => [ 'module', 'content' ],
+    },
+    'components' => {
+      'rpms' => {
+        '*' => {
+          '_order' => [ 'rationale', 'ref', 'buildorder', 'arches' ],
+          'buildorder' => 'number',
+          'arches' => 'inline',
+        },
+      },
+    },
+    'buildopts' => {
+      'rpms' => {
+        'macros' => 'literal',
+      },
+    },
+    'dependencies' => {
+      'requires' => {
+        '*' => 'inline',
+      },
+      'buildrequires' => {
+        '*' => 'inline',
+      },
+    },
+  },
+};
+
+my $mddefaultstemplate = {
+  '_order' => [ 'document', 'version', 'data' ],
+  'version' => 'number',
+  'data' => {
+    '_order' => [ 'module', 'modified', 'stream', 'profiles', 'intents' ],
+    'modified' => 'number',
+    'profiles' => {
+      '*' => 'inline',
+    },
+    'intents' => {
+      '*' => {
+        '_order' => [ 'stream', 'profiles' ],
+        'profiles' => {
+          '*' => 'inline',
+        },
+      },
+    },
+  },
+};
+
+sub mdtoyaml {
+  my ($md) = @_;
+  my $template = $md && $md->{'document'} eq 'modulemd-defaults' ? 
$mddefaultstemplate : $mdtemplate;
+  return Build::SimpleYAML::unparse($md, 'template' => $template);
+}
+
+1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/Build/Modules.pm 
new/obs-build-20210902/Build/Modules.pm
--- old/obs-build-20210820/Build/Modules.pm     2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/Build/Modules.pm     2021-09-02 11:50:53.000000000 
+0200
@@ -21,7 +21,6 @@
 package Build::Modules;
 
 use strict;
-use Data::Dumper;
 
 use YAML::XS;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/Build/Rpm.pm 
new/obs-build-20210902/Build/Rpm.pm
--- old/obs-build-20210820/Build/Rpm.pm 2021-08-20 08:46:34.000000000 +0200
+++ new/obs-build-20210902/Build/Rpm.pm 2021-09-02 11:50:53.000000000 +0200
@@ -280,7 +280,7 @@
   my $optmacros = {};
   # newer perls: \{((?:(?>[^{}]+)|(?2))*)\}
 reexpand:
-  while ($line =~ 
/^(.*?)%(\{([^\}]+)\}|[\?\!]*[0-9a-zA-Z_]+|%|\*\*?|#|\(|\[)(.*?)$/s) {
+  while ($line =~ 
/^(.*?)%(\{([^\}]+)\}|[\?\!]*[0-9a-zA-Z_]+|%|\*\*?|#|\(|\[)(.*?)\z/s) {
     if ($tries++ > 1000) {
       print STDERR "Warning: spec file parser ",($lineno?" line 
$lineno":''),": macro too deeply nested\n" if $config->{'warnings'};
       $line = 'MACRO';
@@ -302,10 +302,10 @@
        $line = substr("%$macorig$line", length($macname));
         $macorig = substr($macname, 1);
        $macname =~ s/^%\{//s;
-       $macname =~ s/\}$//s;
+       $macname =~ s/\}\z//s;
       }
       $macdata = '';
-      if ($macname =~ /^([^\s:]+)([\s:])(.*)$/) {
+      if ($macname =~ /^([^\s:]+)([\s:])(.*)\z/s) {
        $macname = $1;
        if ($2 eq ':') {
          $macalt = $3;
@@ -315,12 +315,12 @@
       }
     }
     my $mactest = 0;
-    if ($macname =~ /^\!\?/ || $macname =~ /^\?\!/) {
+    if ($macname =~ /^\!\?/s || $macname =~ /^\?\!/s) {
       $mactest = -1;
-    } elsif ($macname =~ /^\?/) {
+    } elsif ($macname =~ /^\?/s) {
       $mactest = 1;
     }
-    $macname =~ s/^[\!\?]+//;
+    $macname =~ s/^[\!\?]+//s;
     if ($macname eq '(') {
       print STDERR "Warning: spec file parser",($lineno?" line $lineno":''),": 
can't expand %(...)\n" if $config->{'warnings'};
       $line = 'MACRO';
@@ -440,6 +440,47 @@
   return $line;
 }
 
+sub splitexpansionresult {
+  my ($line, $includelines) = @_;
+  my @l = split("\n", $line);
+  $line = shift @l;
+  s/%/%%/g for @l;
+  unshift @$includelines, @l;
+  return $line;
+}
+
+# see rpm's copyNextLineFromOFI() function in build/parseSpec.c
+sub needmorelines {
+  my ($line) = @_;
+  my ($bc, $pc, $xc, $nc) = (0, 0, 0, 0);
+  while (1) {
+    $line =~ s/^[^\\\n%\{\}\(\)\[\]]*//s;
+    last if $line eq '';
+    if ($line =~ s/^%\{//s) {
+      $bc++;
+    } elsif ($line =~ s/^%\(//s) {
+      $pc++;
+    } elsif ($line =~ s/^%\[//s) {
+      $xc++;
+    } elsif ($line =~ s/^%%?//s) {
+      next;
+    } elsif ($line =~ s/^\n//s) {
+      $nc = 0;
+    } elsif ($line =~ s/^\\\n//s) {
+      $nc = 1;
+    } elsif ($line =~ s/^\\.?//s) {
+      next;
+    } elsif ($line =~ s/^([\{\}])//s) {
+      $bc += $1 eq '{' ? 1 : -1 if $bc;
+    } elsif ($line =~ s/^([\(\)])//s) {
+      $pc += $1 eq '(' ? 1 : -1 if $pc;
+    } elsif ($line =~ s/^([\[\]])//s) {
+      $xc += $1 eq '[' ? 1 : -1 if $xc;
+    }
+  }
+  return $pc || $bc || $xc || $nc ? 1 : 0;
+}
+
 sub splitdeps {
   my ($d) = @_;
   my @deps;
@@ -552,11 +593,11 @@
        next;
       }
     }
-    if ($multilinecondition || $line =~ /^\s*\%\{\?.*:\s*$/s) {
-      # is this a multi-line macro definition?
+    if ($multilinecondition || $line =~ /^\s*\%\{[?!]*-?[0-9a-zA-Z_]+:\s*$/s) {
+      # is this a multi-line macro condition?
       $line = "$multilinecondition\n$line" if defined $multilinecondition;
       undef $multilinecondition;
-      if ($line !~ /\}\s*$/s) {
+      if (needmorelines($line)) {
        $multilinecondition = $line;    # we need another line!
        next;
       }
@@ -566,6 +607,7 @@
     }
     if (!$skip && ($line =~ /%/)) {
       $line = expandmacros($config, $line, $lineno, \%macros, \%macros_args);
+      $line = splitexpansionresult($line, \@includelines) if $line =~ /\n/s;
     }
     if ($line =~ /^\s*%(?:elif|elifarch|elifos)\b/) {
       $skip = 1 if !$skip;
@@ -573,6 +615,7 @@
       next if $skip;
       $line =~ s/^(\s*%)el/$1/;
       $line = expandmacros($config, $line, $lineno, \%macros, \%macros_args);
+      $line = splitexpansionresult($line, \@includelines) if $line =~ /\n/s;
     }
     if ($line =~ /^\s*%else\b/) {
       $skip = 2 - $skip if $skip <= 2;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/Build/SimpleYAML.pm 
new/obs-build-20210902/Build/SimpleYAML.pm
--- old/obs-build-20210820/Build/SimpleYAML.pm  2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/Build/SimpleYAML.pm  2021-09-02 11:50:53.000000000 
+0200
@@ -25,12 +25,12 @@
 use Scalar::Util;
 
 sub unparse_keys {
-  my ($d) = @_;
+  my ($d, $order) = @_;
   my @k = grep {$_ ne '_start' && $_ ne '_end' && $_ ne '_order' && $_ ne 
'_type'} sort keys %$d;
-  return @k unless $d->{'_order'};
+  return @k unless $d->{'_order'} || $order;
   my %k = map {$_ => 1} @k;
   my @ko;
-  for (@{$d->{'_order'}}) {
+  for (@{$d->{'_order'} || $order}) {
     push @ko, $_ if delete $k{$_};
   }
   return (@ko, grep {$k{$_}} @k);
@@ -126,7 +126,6 @@
   return $r;
 }
 
-
 sub unparse_bool {
   my ($d) = @_;
   return $d ? 'true' : 'false';
@@ -144,8 +143,12 @@
 
   return "---\n".unparse($d, %opts, 'noheader' => 1)."\n...\n" unless 
$opts{'noheader'};
   my $r = '';
+  my $template = delete $opts{'template'};
+  $opts{'_type'} ||= $template if $template && !ref($template);
+  undef $template unless ref($template) eq 'HASH';
   if (ref($d) eq 'ARRAY') {
     return '[]' unless @$d;
+    $opts{'template'} = $template if $template;
     $opts{'inline'} = 1 if $opts{'_type'} && $opts{'_type'} =~ s/^inline_?//;
     if ($opts{'inline'}) {
       my $first = 0;
@@ -164,12 +167,13 @@
     return $r;
   }
   if (ref($d) eq 'HASH') {
-    my @k = unparse_keys($d);
+    my @k = unparse_keys($d, $template ? $template->{'_order'} : undef);
     return '{}' unless @k;
     $opts{'inline'} = 1 if $opts{'_type'} && $opts{'_type'} =~ s/^inline_?//;
     if ($opts{'inline'}) {
       my $first = 0;
       for my $k (@k) {
+        $opts{'template'} = $template->{$k} || $template->{'*'} if $template;
         $r .= ", " if $first++;
         my $dd = $d->{$k};
         my $type = ($d->{'_type'} || {})->{$k};
@@ -180,8 +184,10 @@
     my $indent = $opts{'indent'} || '';
     my $first = 0;
     for my $k (@k) {
+      $opts{'template'} = $template->{$k} || $template->{'*'} if $template;
       my $dd = $d->{$k};
       my $type = ($d->{'_type'} || {})->{$k} || ($d->{'_type'} || {})->{'*'};
+      $type = $opts{'template'} if !$type && $opts{'template'} && 
!ref($opts{'template'});
       $r .= "\n$indent" if $first++;
       $r .= unparse_string($k).":";
       if (ref($dd) eq 'ARRAY' && @$dd && !($type && $type =~ /^inline_?/)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/README.md 
new/obs-build-20210902/README.md
--- old/obs-build-20210820/README.md    2021-08-20 08:46:34.000000000 +0200
+++ new/obs-build-20210902/README.md    2021-09-02 11:50:53.000000000 +0200
@@ -1,7 +1,7 @@
 
 This repository provides the `build` tool to build binary packages in a
 a safe and reproducible way. It can be used standalone or within the
-Open Build Service (OBS).
+[Open Build Service](http://openbuildservice.org) (OBS).
 
 Latest packages for `obs-build` are available from
 [openSUSE:Tools 
downloads](https://software.opensuse.org/download/package?package=obs-build&project=openSUSE%3ATools).
@@ -9,67 +9,80 @@
 Supported build environments
 ============================
 
- Unsecure:
- - chroot
- - LXC
-
- Secure but with limited reproducibility:
- - docker
- - nspawn
-
- Secure and with full reproducibility:
- - KVM
- - XEN
- - ZVM (S390)
-
- In addition there is currently experimental support for:
- - UML
- - PVM (PowerPC)
- - OpenStack
- - Amazon EC2
-
- For hardware emulation there are:
- - qemu
-   which runs a QEMU system emulator inside of KVM. This can
-   be considered also secure and reproducible.
- - The "emulator" VM can be used to run builds using any other
-   emulator via a wrapper script.
- - A QEMU user land emulation is also possible. This would give
-   higher speed, but requires a preparation inside of the base
-   distribution for this mode.
+Unsecure
+---
+- `chroot`
+- `LXC`
+
+Secure but with limited reproducibility
+---
+- `docker`
+- `nspawn`
+
+Secure and with full reproducibility
+---
+- `KVM`
+- `XEN`
+- `ZVM` (**S390**)
+
+Experimental support
+---
+In addition, there is currently experimental support for
+
+- `UML`
+- `PVM` (**PowerPC**)
+- [OpenStack](http://openstack.org)
+- [Amazon EC2](http://ec2.amazon.com)
+
+For hardware emulation there are
+---
+- `qemu`,
+  which runs a `QEMU` system emulator inside of ``KVM``. This can
+  be considered also secure and reproducible.
+- The "emulator" VM can be used to run builds using any other
+  emulator via a wrapper script.
+- A `QEMU` user land emulation is also possible. This would give
+  higher speed, but requires a preparation inside of the base
+  distribution for this mode.
 
 Supported build formats
 =======================
 
- Major distribution package formats
- - spec to rpm           eg SUSE, Fedora, RedHat, CentOS, Mandriva
- - dsc to deb            eg Debian, Ubuntu
- - PKGBUILD to pkg       eg Arch Linux
-
- Image formats
- - Dockerfile            Docker container via docker or podman tooling
- - kiwi appliances       This include a long list of formats supported by the 
kiwi tool.
-                         From live USB stick images, network deployment 
images, VM images
-                         to docker containers
-                         
https://documentation.suse.com/kiwi/9/html/kiwi/building-types.html
- - SUSE Product          SUSE product media builds
- - SimpleImage           chroot tar ball based on rpm spec file syntax
- - Debian Livebuild
- - Preinstallimages      for speeding up builds esp. inside of OBS
-
- Desktop Image formats
- - AppImage
- - FlatPak
- - Snapcraft
-
- Special modes and formats
- - debbuild              building debian debs our of rpm spec file
- - debbootstrap          debian builds using debootstrap as engine
- - mock                  rpm spec file build using mock as engine
- - collax                debian package variation
- - fissile               docker images based on BOSH dev releases
- - helm                  helm charts
+Major distribution package formats
+---
+- `spec` to `rpm`,           e.g. [SUSE](http://suse.com), 
[Fedora](http://getfedora.org), [RedHat](http://redhat.com),
+[CentOS](http://centos.org), [Mandriva](http://mageia.org)
+- `dsc` to `deb`,            e.g. [Debian](http://debian.org), 
[Ubuntu](http://ubuntu.com)
+- `PKGBUILD` to `pkg`,       e.g. [Arch Linux](http://archlinux.org)
+
+Image formats
+---
+- `Dockerfile`&mdash;[Docker](http://docker.com) container via `docker` or 
`podman` tooling)
+- kiwi appliances&mdash;This includes a [long list of 
formats](http://documentation.suse.com/kiwi/9/html/kiwi/image-types.html)
+supported by the kiwi tool
+                        From live USB stick images, network deployment images, 
VM images
+                        to docker containers
+- SUSE Product&mdash;[SUSE](http://suse.com) product media builds
+- *SimpleImage*&mdash;`chroot` `tar` ball based on `rpm` spec file syntax
+- [Debian](http://debian.org) *Livebuild*
+- *Preinstallimages*&mdash;for speeding up builds esp. inside of 
[OBS](http://openbuildservice.org/)
+
+Desktop Image formats
+---
+- *AppImage*
+- *FlatPak*
+- *Snapcraft*
+
+Special modes and formats
+---
+- `debbuild`:     building [debian](http://debian.org) `deb`s our of `rpm` 
spec file
+- `debbootstrap`: [debian](http://debian.org) builds using `debootstrap` as 
engine
+- `mock`:         `rpm` spec file build using `mock` as engine
+- `collax`:       [debian](http://debian.org)package variation
+- `fissile`:      `docker` images based on `BOSH` dev releases
+- `helm`:         `helm` charts
+- `modulemd`:     `modulemd` rpm-md extensions
 
 
-Use the --help option for more information.
+Use the `--help` option for more information.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/build-pkg-arch 
new/obs-build-20210902/build-pkg-arch
--- old/obs-build-20210820/build-pkg-arch       2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/build-pkg-arch       2021-09-02 11:50:53.000000000 
+0200
@@ -60,7 +60,7 @@
 
 pkg_preinstall_arch() {
     mkdir -p "$BUILD_INIT_CACHE/scripts"
-    $TAR -f "$BUILD_INIT_CACHE/rpms/$PKG.arch"
+    $TAR < "$BUILD_INIT_CACHE/rpms/$PKG.arch"
     rm -rf "$BUILD_INIT_CACHE/scripts/$PKG.post"
     if test -e "$BUILD_INIT_CACHE/scripts/$PKG.run" -a -f .INSTALL -a ! -L 
.INSTALL ; then
        cat .INSTALL > "$BUILD_INIT_CACHE/scripts/$PKG.post"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/build-pkg-deb 
new/obs-build-20210902/build-pkg-deb
--- old/obs-build-20210820/build-pkg-deb        2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/build-pkg-deb        2021-09-02 11:50:53.000000000 
+0200
@@ -142,14 +142,14 @@
     mkdir "$BUILD_INIT_CACHE/scripts/control" || cleanup_and_exit 1
     :> "$BUILD_INIT_CACHE/scripts/control/.dummy"      # pin control dir
     if test -f "control.tar.gz" -a ! -L "control.tar.gz" ; then
-       $TAR -C "$BUILD_INIT_CACHE/scripts/control" -z -f control.tar.gz
+       $TAR -C "$BUILD_INIT_CACHE/scripts/control" -z < control.tar.gz
     elif test -f "control.tar.xz" -a ! -L "control.tar.xz" ; then
-       $TAR -C "$BUILD_INIT_CACHE/scripts/control" -J -f control.tar.xz
+       $TAR -C "$BUILD_INIT_CACHE/scripts/control" -J < control.tar.xz
     fi
     if test -f "data.tar.gz" -a ! -L "data.tar.gz" ; then
-       $TAR -z -f data.tar.gz
+       $TAR -z < data.tar.gz
     elif test -f "data.tar.xz" -a ! -L "data.tar.xz" ; then
-       $TAR -J -f data.tar.xz
+       $TAR -J < data.tar.xz
     fi
     rm -rf "$BUILD_INIT_CACHE/scripts/$PKG.pre" 
"$BUILD_INIT_CACHE/scripts/$PKG.post"
     if test -e "$BUILD_INIT_CACHE/scripts/$PKG.run" ; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/build-vm 
new/obs-build-20210902/build-vm
--- old/obs-build-20210820/build-vm     2021-08-20 08:46:34.000000000 +0200
+++ new/obs-build-20210902/build-vm     2021-09-02 11:50:53.000000000 +0200
@@ -879,6 +879,10 @@
        # umount later so step aside
        cd "$SRCDIR"
     fi
+    # do the conversion now because a yaml reader may be missing in the vm
+    if test -n "$MODULEMDFILE" -a "${MODULEMDFILE##*/}" != _modulemd.pst ; then
+       $BUILD_DIR/writemodulemd --converttopst "$MODULEMDFILE" > 
"$MYSRCDIR/_modulemd.pst"
+    fi
 
     # some time has passed copying files, lets make sure we should not exit
     check_exit
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/dist/build.changes 
new/obs-build-20210902/dist/build.changes
--- old/obs-build-20210820/dist/build.changes   2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/dist/build.changes   2021-09-02 11:50:53.000000000 
+0200
@@ -1,4 +1,14 @@
 -------------------------------------------------------------------
+Thu Sep  2 09:18:33 UTC 2021 - Adrian Schr??ter <adr...@suse.de>
+
+- Fix unpacking of deb/arch archives without bsdtar
+
+-------------------------------------------------------------------
+Mon Aug 30 12:44:52 UTC 2021 - Adrian Schr??ter <adr...@suse.de>
+
+- fixed regression in multiline macro evaluation from 20th August release
+
+-------------------------------------------------------------------
 Fri Aug 20 07:44:26 UTC 2021 - Adrian Schr??ter <adr...@suse.de>
 
 Features:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/dist/debian.control 
new/obs-build-20210902/dist/debian.control
--- old/obs-build-20210820/dist/debian.control  2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/dist/debian.control  2021-09-02 11:50:53.000000000 
+0200
@@ -7,7 +7,7 @@
 
 Package: obs-build
 Architecture: all
-Depends: ${perl:Depends}, rpm
+Depends: ${perl:Depends}, rpm, libarchive-tools | bsdtar
 Recommends: rpm2cpio
 Conflicts: build
 Replaces: build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/getbuildids 
new/obs-build-20210902/getbuildids
--- old/obs-build-20210820/getbuildids  2021-08-20 08:46:34.000000000 +0200
+++ new/obs-build-20210902/getbuildids  2021-09-02 11:50:53.000000000 +0200
@@ -55,7 +55,7 @@
        next unless $bid;
        if ($bid =~ / 0-/) {
          my $buildid2 = $buildid;
-         $buildid2 =~ s/ .*?-/0-/;
+         $buildid2 =~ s/ .*?-/ 0-/;
          next if $bid ne $buildid2;
        } else {
          next if $bid ne $buildid;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/init_buildsystem 
new/obs-build-20210902/init_buildsystem
--- old/obs-build-20210820/init_buildsystem     2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/init_buildsystem     2021-09-02 11:50:53.000000000 
+0200
@@ -278,13 +278,13 @@
     preinstall_setup
     if test "$UID" = 0 -a -x /usr/bin/bsdtar ; then
        CPIO="/usr/bin/bsdtar --exclude .build --exclude .init_b_cache -P 
--chroot -o --numeric-owner -x -f-"
-       TAR="/usr/bin/bsdtar --exclude .build --exclude .init_b_cache -P 
--chroot -o --numeric-owner -x"
+       TAR="/usr/bin/bsdtar --exclude .build --exclude .init_b_cache -P 
--chroot -o --numeric-owner -x -f-"
     else
 #      unsafe_preinstall_check
 #      CPIO="cpio --extract --unconditional --preserve-modification-time 
--make-directories --no-absolute-filenames --quiet"
 #      TAR="tar --exclude .build --exclude .init_b_cache -x"
-       CPIO="$BUILD_DIR/unpackarchive --cpio ."
-       TAR="$BUILD_DIR/unpackarchive --tar ."
+       CPIO="$BUILD_DIR/unpackarchive --cpio"
+       TAR="$BUILD_DIR/unpackarchive --tar"
     fi
     pkg_preinstall
     preinstall_integrate
@@ -512,18 +512,33 @@
     mv "$destfile" "$SRC" || cleanup_and_exit 1
 }
 
+getobslocation() {
+    local url=$1
+    local obsurl="${OBSURL%/}"
+    test -n "$obsurl" || cleanup_and_exit 1 "Please use the --obs option to 
specify the url of the obs instance"
+    url="${url#obs:/}"
+    url="${url#/}"
+    url="${url#/}"
+    url="${url%/}"
+    url="$obsurl/build/$url/${BUILD_ARCH%%:*}"
+    echo "$url"
+}
+
 getcachedir() {
     local url=$1
+    local repoid dummy
     for repo in "${repos[@]}" ; do
        case $repo in
            arch@* | debian@* | hdlist2@* | rpmmd@* | rpm-md@* | suse@*) 
repo=${repo#*@} ;;
        esac
+       test "${repo#obs:/}" != "$repo" && repo=$(getobslocation "$repo")
        if test "${url:0:${#repo}}" == "$repo" ; then
            read repoid dummy < <(echo -n "$repo" | md5sum)
-           echo "$CACHE_DIR/$repoid"
            break
        fi
     done
+    test -z "$repoid" && cleanup_and_exit 1 "could not determine cachedir for 
$url"
+    echo "$CACHE_DIR/$repoid"
 }
 
 set_build_arch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/queryobs 
new/obs-build-20210902/queryobs
--- old/obs-build-20210820/queryobs     2021-08-20 08:46:34.000000000 +0200
+++ new/obs-build-20210902/queryobs     2021-09-02 11:50:53.000000000 +0200
@@ -37,7 +37,6 @@
 use PBuild::Download;
 use PBuild::OBS;
 use PBuild::Cpio;
-use PBuild::BuildConfig;
 
 Getopt::Long::Configure("no_ignore_case");
 
@@ -81,7 +80,7 @@
     @$obsconfigs = reverse @$obsconfigs unless $reverse;
     push @configs, @$obsconfigs;
   }
-  my $config = PBuild::BuildConfig::combineconfigs(@configs);
+  my $config = Build::combine_configs(@configs);
   $config =~ s/\n?$/\n/s if $config ne '';
   print $config;
   exit;
@@ -99,7 +98,7 @@
 for my $url (@ARGV) {
   die("$url: not a valid  obs: repo") unless $url =~ 
/^obs:\/{1,3}([^\/]+\/[^\/]+)\/?$/;
   my $prp = $1;
-  my $repoid = Digest::MD5::md5_hex("$obsurl/$prp");
+  my $repoid = Digest::MD5::md5_hex("$obsurl/build/$prp/$arch");
   my $dir = "$cachedir/$repoid";
   File::Path::mkpath($dir);
   
PBuild::Download::download("$obsurl/build/$prp/$arch/_repository?view=cache", 
"$dir/repository.cpio");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/t/parse_spec.t 
new/obs-build-20210902/t/parse_spec.t
--- old/obs-build-20210820/t/parse_spec.t       2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/t/parse_spec.t       2021-09-02 11:50:53.000000000 
+0200
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use Test::More tests => 10;
+use Test::More tests => 14;
 
 use Build;
 use Build::Rpm;
@@ -363,3 +363,36 @@
 $result = Build::Rpm::parse($conf, [ split("\n", $spec) ]);
 is_deeply($result, $expected, "multiline define");
 
+$spec = q[
+%{?foo:
+BuildRequires: foo
+%{?!bar:
+BuildRequires: bar
+}
+BuildRequires: baz
+}xxx
+];
+$expected = {
+  'deps' => [],
+  'subpacks' => [],
+};
+$result = Build::Rpm::parse($conf, [ split("\n", "$spec") ]);
+is_deeply($result, $expected, "multiline condition 1");
+
+$result = Build::Rpm::parse($conf, [ split("\n", "%global bar 1\n$spec") ]);
+is_deeply($result, $expected, "multiline condition 2");
+
+$expected = {
+  'deps' => [ 'foo', 'bar', 'baz' ],
+  'subpacks' => [],
+};
+$result = Build::Rpm::parse($conf, [ split("\n", "%global foo 1\n$spec") ]);
+is_deeply($result, $expected, "multiline condition 3");
+
+$expected = {
+  'deps' => [ 'foo', 'baz' ],
+  'subpacks' => [],
+};
+$result = Build::Rpm::parse($conf, [ split("\n", "%global foo 1\n%global bar 
1\n$spec") ]);
+is_deeply($result, $expected, "multiline condition 4");
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/unpackarchive 
new/obs-build-20210902/unpackarchive
--- old/obs-build-20210820/unpackarchive        2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/unpackarchive        2021-09-02 11:50:53.000000000 
+0200
@@ -335,7 +335,7 @@
       exec(@decomp);
       die("$decomp[0]: $!\n");
     }
-    print G $first16bytes;
+    print G $first16bytes if $first16bytes ne '';
     while (1) {
       my $d = '';
       my $r = read(F, $d, 8192);
@@ -354,8 +354,22 @@
 #
 # Main
 #
-die("usage: unpackarchive --cpio|--tar <root>\n") unless @ARGV == 2;
-my ($format, $root) = @ARGV;
+die("usage: unpackarchive --cpio|--tar [-C <root>]\n") unless @ARGV;
+my $format = shift @ARGV;
+my $root = '.';
+while (@ARGV) {
+  if (@ARGV > 1 && $ARGV[0] eq '-C') {
+    (undef, $root) = splice(@ARGV, 0, 2);
+  } elsif (@ARGV && $ARGV[0] eq '-J') {
+    shift @ARGV;
+  } elsif ($ARGV[0] eq '-j' || $ARGV[0] eq '-J' || $ARGV[0] eq '-z') {
+    shift @ARGV;
+  } elsif ($ARGV[0] =~ /^-/) {
+    die("unpackarchive: unsupported option $ARGV[0]\n");
+  } else {
+    die("usage: unpackarchive --cpio|--tar [-C <root>]\n");
+  }
+}
 
 die("$root: No such file or directory\n") unless -d $root;
 my $readhead;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20210820/writemodulemd 
new/obs-build-20210902/writemodulemd
--- old/obs-build-20210820/writemodulemd        2021-08-20 08:46:34.000000000 
+0200
+++ new/obs-build-20210902/writemodulemd        2021-09-02 11:50:53.000000000 
+0200
@@ -29,49 +29,11 @@
 use strict;
 
 use Build::Rpm;
-use Build::SimpleYAML;
-use Data::Dumper;
-
-sub convertdeps {
-  my ($d) = @_;
-  my $nd = {};
-  for my $dd (@$d) {
-    my ($n, @v) = split(':', $dd);
-    $nd->{$n} = \@v;
-  }
-  return $nd;
-}
+use Build::Modulemd;
 
 sub printmd {
   my ($md) = @_;
-  $md->{'_order'} = [ 'document', 'version', 'data' ];
-  $md->{'_type'}->{'version'} = 'number';
-
-  my $mdd = $md->{'data'};
-  $mdd->{'_order'} = [ 'module', 'name', 'stream', 'version', 'context', 
'arch', 'summary', 'description', 'license', 'xmd', 'dependencies', 
'references', 'profiles', 'api', 'filter', 'buildopts', 'components', 
'artifacts' ];
-  $mdd->{'_type'}->{'version'} = 'number';
-  $mdd->{'_type'}->{'description'} = 'folded';
-  if ($mdd->{'license'}) {
-    $mdd->{'license'}->{'_order'} = [ 'module', 'content' ];
-  }
-  if ($mdd->{'components'} && $mdd->{'components'}->{'rpms'}) {
-    for (values %{$mdd->{'components'}->{'rpms'}}) {
-      $_->{'_order'} = [ 'rationale', 'ref', 'buildorder', 'arches' ];
-      $_->{'_type'}->{'buildorder'} = 'number';
-      $_->{'_type'}->{'arches'} = 'inline';
-    }
-  }
-  if ($mdd->{'buildopts'} && $mdd->{'buildopts'}->{'rpms'}) {
-    $mdd->{'buildopts'}->{'rpms'}->{'_type'}->{'macros'} = 'literal';
-  }
-  for my $d (@{$mdd->{'dependencies'} || []}) {
-    $d->{'requires'}->{'_type'}->{'*'} = 'inline' if $d->{'requires'};
-    $d->{'buildrequires'}->{'_type'}->{'*'} = 'inline' if 
$d->{'buildrequires'};
-  }
-  if ($md->{'document'} eq 'modulemd-defaults' && $mdd->{'profiles'}) {
-    $mdd->{'profiles'}->{'_type'}->{'*'} = 'inline';
-  }
-  print Build::SimpleYAML::unparse($md);
+  print Build::Modulemd::mdtoyaml($md);
 }
 
 sub readmds {
@@ -98,6 +60,16 @@
   return $mds;
 }
 
+sub convertdeps {
+  my ($d) = @_;
+  my $nd = {};
+  for my $dd (@$d) {
+    my ($n, @v) = split(':', $dd);
+    $nd->{$n} = \@v;
+  }
+  return $nd;
+}
+
 sub unifyandsort {
   my %m = map {$_ => 1} @_;
   return [ sort keys %m ];
@@ -187,6 +159,25 @@
   exit;
 }
 
+if (@ARGV && $ARGV[0] eq '--convert') {
+  shift @ARGV;
+  die("usage: writemodulemd --convert <modulemdfile>\n") unless @ARGV == 1;
+  my ($modulemdfile) = @ARGV;
+  my $mds = readmds($modulemdfile);
+  printmd($_) for @$mds;
+  exit;
+}
+
+if (@ARGV && $ARGV[0] eq '--converttopst') {
+  shift @ARGV;
+  die("usage: writemodulemd --converttopst <modulemdfile>\n") unless @ARGV == 
1;
+  my ($modulemdfile) = @ARGV;
+  my $mds = readmds($modulemdfile);
+  require Storable;
+  Storable::nstore_fd($mds, \*STDOUT);
+  exit
+}
+
 die("usage: writemodulemd <modulemdfile> <rpmmanifestfile>\n") unless @ARGV == 
2;
 my ($modulemdfile, $manifestfile) = @ARGV;
 
@@ -220,4 +211,3 @@
 $mdd->{'license'}->{'content'} = [ sort keys %licenses ] if %licenses;
 printmd($_) for @$mds;
 
-

Reply via email to