Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package build for openSUSE:Factory checked 
in at 2025-03-24 13:25:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/build (Old)
 and      /work/SRC/openSUSE:Factory/.build.new.2696 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "build"

Mon Mar 24 13:25:22 2025 rev:173 rq:1255056 version:20250321

Changes:
--------
--- /work/SRC/openSUSE:Factory/build/build.changes      2025-03-15 
16:17:06.710653908 +0100
+++ /work/SRC/openSUSE:Factory/.build.new.2696/build.changes    2025-03-24 
13:25:27.078796689 +0100
@@ -1,0 +2,8 @@
+Fri Mar 21 15:46:58 UTC 2025 - Adrian Schröter <adr...@suse.de>
+
+- RemoteAsset support:
+   * Implement automatic packaging of directories into tar balls
+   * Support a 'keepmeta' query parameter in git assets
+   * Support git checkout by commit like with the obs scm bridge
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ build.spec ++++++
--- /var/tmp/diff_new_pack.sB6Uxn/_old  2025-03-24 13:25:27.782826024 +0100
+++ /var/tmp/diff_new_pack.sB6Uxn/_new  2025-03-24 13:25:27.782826024 +0100
@@ -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:        20250314
+Version:        20250321
 Release:        0
 Source:         obs-build-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.sB6Uxn/_old  2025-03-24 13:25:27.842828524 +0100
+++ /var/tmp/diff_new_pack.sB6Uxn/_new  2025-03-24 13:25:27.846828691 +0100
@@ -1,5 +1,5 @@
 pkgname=build
-pkgver=20250314
+pkgver=20250321
 pkgrel=0
 pkgdesc="Build packages in sandbox"
 arch=('i686' 'x86_64')

++++++ _service ++++++
--- /var/tmp/diff_new_pack.sB6Uxn/_old  2025-03-24 13:25:27.882830191 +0100
+++ /var/tmp/diff_new_pack.sB6Uxn/_new  2025-03-24 13:25:27.882830191 +0100
@@ -1,7 +1,7 @@
 <services>
   <service name="tar_scm" mode="manual">
-    <param name="revision">20250314</param>
-    <param name="version">20250314</param>
+    <param name="revision">20250321</param>
+    <param name="version">20250321</param>
     <param name="url">https://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.sB6Uxn/_old  2025-03-24 13:25:27.926832024 +0100
+++ /var/tmp/diff_new_pack.sB6Uxn/_new  2025-03-24 13:25:27.938832524 +0100
@@ -1,6 +1,6 @@
 Format: 1.0
 Source: build
-Version: 20250314
+Version: 20250321
 Binary: build
 Maintainer: Adrian Schroeter <adr...@suse.de>
 Architecture: all

++++++ debian.changelog ++++++
--- /var/tmp/diff_new_pack.sB6Uxn/_old  2025-03-24 13:25:27.978834191 +0100
+++ /var/tmp/diff_new_pack.sB6Uxn/_new  2025-03-24 13:25:27.982834357 +0100
@@ -1,4 +1,4 @@
-build (20250314) unstable; urgency=low
+build (20250321) unstable; urgency=low
 
   * Update to current git trunk
     - add sles11sp2 build config and adapt autodetection

++++++ obs-build-20250314.tar.gz -> obs-build-20250321.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20250314/Build/Rpm.pm 
new/obs-build-20250321/Build/Rpm.pm
--- old/obs-build-20250314/Build/Rpm.pm 2025-03-14 13:32:45.000000000 +0100
+++ new/obs-build-20250321/Build/Rpm.pm 2025-03-21 16:47:43.000000000 +0100
@@ -712,6 +712,7 @@
   my $ret = {};
   my $ifdeps;
   my %autonum = (patch => 0, source => 0);
+  my %moveassets;
 
   my $specdata;
   local *SPEC;
@@ -919,8 +920,13 @@
         $arg = (split(' ', $arg, 2))[0];
         $ret->{'multiversion'} = 1 if @subpacks && exists($ret->{'version'}) 
&& $ret->{'version'} ne $arg;
       } elsif ($keyword eq '#!remoteasset') {
-        $remoteasset = {};
-        $remoteasset->{'digest'} = $arg if $arg =~ /^[a-z0-9]+:[0-9a-f]+$/;
+       $remoteasset = {};
+       my @args = split(' ', $arg);
+       if (@args && $args[0] =~ /^(?:git\+)?https?:\/\//) {
+         $remoteasset->{'url'} = $args[0];
+         shift @args;
+       }
+       $remoteasset->{'digest'} = $args[0] if @args && $args[0] =~ 
/^[a-z0-9]+:[0-9a-f]+$/;
       } elsif ($keyword eq '#!remoteasseturl') {
         $arg = (split(' ', $arg, 2))[0];
         $remoteasset->{'url'} = $arg;
@@ -1050,7 +1056,18 @@
       $macros{uc($tagtype) . "URL$num"} = $val;
       $ret->{$tag} = $val;
       if ($remoteasset) {
-        $remoteasset->{'url'} = $val;
+       if ($remoteasset->{'url'} && !defined($remoteasset->{'file'}) && $val 
=~ /([^\/\.][^\/]+$)/) {
+         my $fn = $1;
+         if ($remoteasset->{'url'} =~ 
/^git(?:\+https?)?:.*\/([^\/]+?)(?:\#[^\#\/]+)?$/) {
+           my $gfn = $1;
+           $gfn =~ s/\?.*//;
+           $gfn =~ s/\.git$//;
+           $moveassets{$gfn} = $fn if $fn ne $gfn;
+         } else {
+           $remoteasset->{'file'} = $fn;
+         }
+       }
+        $remoteasset->{'url'} ||= $val;
         push @{$ret->{'remoteassets'}}, $remoteasset;
       }
       $remoteasset = undef;
@@ -1090,6 +1107,8 @@
   $ret->{'onlynative'} = \@onlynative if @onlynative;
   $ret->{'alsonative'} = \@alsonative if @alsonative;
   $ret->{'configdependent'} = 1 if $ifdeps;
+  $ret->{'moveassets'} = [ map {"$_/$moveassets{$_}"} sort keys %moveassets] 
if %moveassets;
+  $ret->{'dirassets'} = [ sort keys %moveassets ] if %moveassets;
   do_warn($config, "unterminated if/ifarch/ifos statement") if $skip && 
$config->{'parsing_config'};
   return $ret;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20250314/PBuild/RemoteAssets.pm 
new/obs-build-20250321/PBuild/RemoteAssets.pm
--- old/obs-build-20250314/PBuild/RemoteAssets.pm       2025-03-14 
13:32:45.000000000 +0100
+++ new/obs-build-20250321/PBuild/RemoteAssets.pm       2025-03-21 
16:47:43.000000000 +0100
@@ -67,23 +67,30 @@
   for my $s (@{$p->{'remoteassets'} || []}) {
     my $url = $s->{'url'};
     my $file = $s->{'file'};
-    if ($url && $url =~ 
/^git(?:\+https?)?:.*\/([^\/]+?)(?:.git)?(?:\#[^\#\/]+)?$/) {
-      $file = $1 unless defined $file;
-      next unless $file =~ /^([^\.\/][^\/]+)$/s;
+    if ($url && $url =~ /^git(?:\+https?)?:.*\/([^\/]+?)(?:\#[^\#\/]+)?$/) {
+      if (!defined($file)) {
+       $file = $1;
+       $file =~ s/\?.*//;
+       $file =~ s/\.git$//;
+      }
+      next unless defined($file) && $file =~ /^([^\.\/][^\/]+)$/s;
       next if $p->{'files'}->{$file};
       push @assets, { 'file' => $file, 'url' => $url, 'type' => 'url', 'isdir' 
=> 1 };
       next;
     }
     if (($s->{'type'} || '' eq 'webcache')) {
-      next unless $s->{'url'};
-      $file = 'build-webcache-'.Digest::SHA::sha256_hex($s->{'url'});
+      next unless $url;
+      $file = 'build-webcache-'.Digest::SHA::sha256_hex($url);
+    }
+    next unless $url =~ /(?:^|\/)([^\.\/][^\/]+)$/s;
+    if (!defined($file)) {
+      $file = $1;
+      $file =~ s/\?.*// if $url =~ /^https?:\/\//;
     }
-    next unless $s->{'url'} =~ /(?:^|\/)([^\.\/][^\/]+)$/s;
-    $file = $1 unless defined $file;
     undef $url unless $url =~ /^https?:\/\/.*\/([^\.\/][^\/]+)$/s;
     my $digest = $s->{'digest'};
     next unless $digest || $url;
-    next unless $file =~ /^([^\.\/][^\/]+)$/s;
+    next unless defined($file) && $file =~ /^([^\.\/][^\/]+)$/s;
     my $asset = { 'file' => $file };
     $asset->{'digest'} = $digest if $digest;
     $asset->{'url'} = $url if $url;
@@ -293,10 +300,39 @@
   my $url = $asset->{'url'};
   die unless $url =~ /^git(?:\+https?)?:/;
   $url =~ s/^git\+//;
-  my @cmd = ('git', 'clone', '-q', '--recurse-submodules');
-  push @cmd, '-b', $1 if $url =~ s/#([^#]+)$//;
-  push @cmd, '--', $url, "$tmpdir/$file";
-  system(@cmd) && die("git clone failed: $!\n");
+  my $branch;
+  $branch = $1 if $url =~ s/#([^#]+)$//;
+  my $keepmeta;
+  if ($url =~ /(.*?)\?(.*)$/) {
+    my ($urlpath, $urlquery) = ($1, "&$2&");
+    $keepmeta = defined($1) ? $1 : 1 if $urlquery =~ 
s/\&keepmeta(?:=([01]))?\&/\&/;
+    $urlquery =~ s/\&$//;
+    $urlquery =~ s/^\&/?/;
+    $url = "$urlpath$urlquery";
+  }
+  if ($branch =~ /^[0-9a-fA-F]{40,}$/) {
+    my $objectformat = length($branch) == 64 ? 'sha256' : 'sha1';
+    my @cmd = ('git', 'init', '-q', "--object-format=$objectformat", 
"$tmpdir/$file");
+    system(@cmd) && die("git init failed: $?\n");
+    @cmd = ('git', '-C', "$tmpdir/$file", 'remote', 'add', 'origin', $url);
+    system(@cmd) && die("git remote failed: $?\n");
+    @cmd = ('git', '-C', "$tmpdir/$file", 'fetch', '-q', 'origin', $branch);
+    if (system(@cmd)) {
+      @cmd = ('git', '-C', "$tmpdir/$file", 'fetch', '-q', 'origin');
+      system(@cmd) && die("git fetch failed: $?\n");
+    }
+    @cmd = ('git', '-C', "$tmpdir/$file", 'checkout', '-q', $branch);
+    system(@cmd) && die("git checkout failed: $?\n");
+    @cmd = ('git', '-C', "$tmpdir/$file", 'submodule', 'init');
+    system(@cmd) && die("git submodule init failed: $?\n");
+    @cmd = ('git', '-C', "$tmpdir/$file", 'submodule', 'update', 
'--recursive');
+    system(@cmd) && die("git submodule update failed: $?\n");
+  } else {
+    my @cmd = ('git', 'clone', '-q', '--recurse-submodules');
+    push @cmd, '-b', $branch if defined $branch;
+    push @cmd, '--', $url, "$tmpdir/$file";
+    system(@cmd) && die("git clone failed: $?\n");
+  }
   # get timestamp of last commit
   my $pfd;
   open($pfd, '-|', 'git', '-C', "$tmpdir/$file", 'log', '--pretty=format:%ct', 
'-1') || die("open: $!\n");
@@ -304,6 +340,8 @@
   close($pfd);
   chomp $t;
   $t = undef unless $t && $t > 0;
+  # get rid of .git directory (need to make this optional)
+  PBuild::Util::rm_rf("$tmpdir/$file/.git") unless $keepmeta;
   if ($asset->{'donotpack'}) {
     rename("$tmpdir/$file", "$adir/$assetid") || die("rename $tmpdir 
$adir/$assetid: $!\n");
   } else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20250314/build new/obs-build-20250321/build
--- old/obs-build-20250314/build        2025-03-14 13:32:45.000000000 +0100
+++ new/obs-build-20250321/build        2025-03-21 16:47:43.000000000 +0100
@@ -852,12 +852,20 @@
        image_mode=
        ( shopt -s nullglob ; cp -pRd "$1/".[^.]* "$1/"..?* "$1"/* "$2" )
     elif test -e "$1/.git" ; then
-       # check which directory belongs to the git repository and only copy 
those
+       # query recipe for directories to copy
+       local dirassets
+       dirassets=$(queryrecipe --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" 
--archpath "$BUILD_ARCH" "$1/$RECIPEFILE" dirassets)
+       test -n "$dirassets" && dirassets="/${dirassets// /\\/}/"
+       # check which directory belongs to the git repository and only copy 
those and the dir assets
        type -p git >& /dev/null || cleanup_and_exit 1 "need git to check file 
status"
        for i in "$1/".* "$1"/* ; do
            local ii="${i##*/}"
            test "$ii" = . -o "$ii" = .. -o "$ii" = .git && continue
            test -n "$image_mode" -a \( "$ii" = repos -o "$ii" = containers \) 
&& continue
+           if test -n "$dirassets" -a -d "$i" -a "${dirassets/\/$ii\//}" != 
"$dirassets" ; then
+               cp -pRd "$i" "$2"
+               continue
+           fi
            if test -L "$i" -o -d "$i" -o "${ii#.}" != "$ii" ; then
                if test -e "$i/.build.asset" || git -C "$1" --noglob-pathspecs 
-c safe.directory="$ii" ls-files --error-unmatch -- "$ii" >& /dev/null ; then
                    cp -pRd "$i" "$2"
@@ -873,10 +881,18 @@
            $BUILD_DIR/export_debian_orig_from_git "$1" "$2/build.origtar" || 
cleanup_and_exit 1 "export_debian_orig_from_git failed"
        fi
     else
-       if test -n "$image_mode" ; then
+       # query recipe for directories to copy
+       local dirassets
+       dirassets=$(queryrecipe --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" 
--archpath "$BUILD_ARCH" "$1/$RECIPEFILE" dirassets)
+       test -n "$dirassets" && dirassets="/${dirassets// /\\/}/"
+       if test -n "$image_mode" -o -n "$dirassets" ; then
            for i in "$1"/* ; do
                local ii="${i##*/}"
                test -n "$image_mode" -a \( "$ii" = repos -o "$ii" = containers 
\) && continue
+               if test -n "$dirassets" -a -d "$i" -a "${dirassets/\/$ii\//}" 
!= "$dirassets" ; then
+                   cp -pRd "$i" "$2"
+                   continue
+               fi
                cp -p "$i" "$2"
            done
        else
@@ -1865,6 +1881,39 @@
        rm -f $BUILD_ROOT/.unpack.command $BUILD_ROOT/.build.unpackarchive
     done
 
+    for i in $(queryrecipe --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" 
--archpath "$BUILD_ARCH" "$BUILD_ROOT$TOPDIR/SOURCES/$RECIPEFILE" moveassets) ; 
do
+       mvf="${i%%/*}"
+       mvt="${i##*/}"
+       if test -d "$mvf" ; then
+           compressor=()
+           case $i in
+               *.tar.xz) compressor=(xz --threads=2) ;;
+               *.tar.gz) compressor=(gzip -c -n --rsyncable) ;;
+               *.tar.zst) compressor=(zstd --rsyncable -15 --threads=0 -c) ;;
+           esac
+           case "$mvt" in
+               *.tar.gz | *.tar.xz | *.tar.zst) 
+                   echo "Creating $mvt from directory $mvf"
+                   mv -f "$mvf" "${mvt%.tar.*}"
+                   rm -f $BUILD_ROOT/.unpack.command
+                   echo "#!/bin/sh -e" > $BUILD_ROOT/.unpack.command
+                   shellquote cd "$TOPDIR/SOURCES" >> 
$BUILD_ROOT/.unpack.command
+                   echo >> $BUILD_ROOT/.unpack.command
+                   shellquote tar -cf - --owner=root:0 --group=root:0 -- 
"${mvt%*.tar.*}" >> $BUILD_ROOT/.unpack.command
+                   echo -n ' | ' >> $BUILD_ROOT/.unpack.command
+                   shellquote "${compressor[@]}" >> $BUILD_ROOT/.unpack.command
+                   echo -n ' > ' >> $BUILD_ROOT/.unpack.command
+                   shellquote "$mvt" >> $BUILD_ROOT/.unpack.command
+                   echo >> $BUILD_ROOT/.unpack.command
+                   chmod 0755 $BUILD_ROOT/.unpack.command
+                   chroot $BUILD_ROOT su -c /.unpack.command - $BUILD_USER || 
cleanup_and_exit 1
+                   rm -f $BUILD_ROOT/.unpack.command
+                   continue
+           esac
+           mv "$mvf" "${mvt}"
+       fi
+    done
+
     # macros may be used by buildtime services or non-rpm build types
     recipe_setup_macros
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-20250314/dist/build.changes 
new/obs-build-20250321/dist/build.changes
--- old/obs-build-20250314/dist/build.changes   2025-03-14 13:32:45.000000000 
+0100
+++ new/obs-build-20250321/dist/build.changes   2025-03-21 16:47:43.000000000 
+0100
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Fri Mar 21 15:46:58 UTC 2025 - Adrian Schröter <adr...@suse.de>
+
+- RemoteAsset support:
+   * Implement automatic packaging of directories into tar balls
+   * Support a 'keepmeta' query parameter in git assets
+   * Support git checkout by commit like with the obs scm bridge
+
+-------------------------------------------------------------------
 Fri Mar 14 12:28:07 UTC 2025 - Adrian Schröter <adr...@suse.de>
 
 - Support reprobudicble builds using jobs/smp_mflags handling

Reply via email to