diff options
author | biao716.wang <biao716.wang@samsung.com> | 2020-12-03 15:31:53 +0900 |
---|---|---|
committer | biao716.wang <biao716.wang@samsung.com> | 2020-12-03 15:31:53 +0900 |
commit | 3fa0dfde7b02f2f9cafc400d739f3f30ffa39317 (patch) | |
tree | fd3155b9b890f380da4d34996da88256f7472a02 | |
parent | 2783de46a9634037df452d28183dca8dfafba7fe (diff) | |
parent | 9e3b211464ec4b7c04dceac0bfcdc11d3cd4cf83 (diff) | |
download | build-3fa0dfde7b02f2f9cafc400d739f3f30ffa39317.tar.gz build-3fa0dfde7b02f2f9cafc400d739f3f30ffa39317.tar.bz2 build-3fa0dfde7b02f2f9cafc400d739f3f30ffa39317.zip |
Merge remote-tracking branch 'origin/devel'submit/trunk/20201203.143330
Change-Id: Ib9b90966826ed8e020f53af9b42e0056bf3c3f9e
-rw-r--r-- | Build.pm | 4 | ||||
-rw-r--r-- | Build/Arch.pm | 36 | ||||
-rw-r--r-- | build-pkg-rpm | 13 | ||||
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | init_buildsystem | 14 | ||||
-rw-r--r-- | packaging/build.changes | 7 | ||||
-rw-r--r-- | packaging/build.spec | 7 |
8 files changed, 77 insertions, 14 deletions
@@ -1376,7 +1376,7 @@ sub query { return Build::Rpm::query($handle, %opts) if $do_rpm && $binname =~ /\.d?rpm$/; return Build::Deb::query($handle, %opts) if $do_deb && $binname =~ /\.deb$/; return Build::Kiwi::queryiso($handle, %opts) if $do_kiwi && $binname =~ /\.iso$/; - return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz)?$/; + return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz|\.zst)?$/; return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.arch$/; return undef; } @@ -1406,7 +1406,7 @@ sub queryhdrmd5 { return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.iso$/; return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw$/; return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw.install$/; - return Build::Arch::queryhdrmd5(@_) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz)?$/; + return Build::Arch::queryhdrmd5(@_) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz|\.zst)?$/; return Build::Arch::queryhdrmd5(@_) if $do_arch && $binname =~ /\.arch$/; return undef; } diff --git a/Build/Arch.pm b/Build/Arch.pm index a100d9f..cb93ef9 100644 --- a/Build/Arch.pm +++ b/Build/Arch.pm @@ -107,6 +107,16 @@ sub islzma { return $h eq "\3757zXZ"; } +sub iszstd { + my ($fn) = @_; + local *F; + return 0 unless open(F, '<', $fn); + my $h; + return 0 unless read(F, $h, 4) == 4; + close F; + return $h eq "(\265\057\375"; +} + sub lzmadec { my ($fn) = @_; my $nh; @@ -120,13 +130,29 @@ sub lzmadec { return $nh; } +sub zstddec { + my ($fn) = @_; + my $nh; + my $pid = open($nh, '-|'); + return undef unless defined $pid; + if (!$pid) { + $SIG{'PIPE'} = 'DEFAULT'; + #zstd -dc is not accepting symlinks, but zstdcat does. + exec('zstdcat', $fn); + die("zstdcat $!\n"); + } + return $nh; +} + sub queryvars { my ($handle) = @_; if (ref($handle)) { die("arch pkg query not implemented for file handles\n"); } - if ($handle =~ /\.xz$/ || islzma($handle)) { + if ($handle =~ /\.zst$/ || iszstd($handle)) { + $handle = zstddec($handle); + } elsif ($handle =~ /\.xz$/ || islzma($handle)) { $handle = lzmadec($handle); } my $tar = Archive::Tar->new; @@ -148,7 +174,9 @@ sub queryfiles { if (ref($handle)) { die("arch pkg query not implemented for file handles\n"); } - if ($handle =~ /\.xz$/ || islzma($handle)) { + if ($handle =~ /\.zst$/ || iszstd($handle)) { + $handle = zstddec($handle); + } elsif ($handle =~ /\.xz$/ || islzma($handle)) { $handle = lzmadec($handle); } my @files; @@ -215,7 +243,9 @@ sub queryhdrmd5 { if (ref($handle)) { die("arch pkg query not implemented for file handles\n"); } - if ($handle =~ /\.xz$/ || islzma($handle)) { + if ($handle =~ /\.zst$/ || iszstd($handle)) { + $handle = zstddec($handle); + } elsif ($handle =~ /\.xz$/ || islzma($handle)) { $handle = lzmadec($handle); } my $tar = Archive::Tar->new; diff --git a/build-pkg-rpm b/build-pkg-rpm index 2c385cc..f8ab32a 100644 --- a/build-pkg-rpm +++ b/build-pkg-rpm @@ -146,15 +146,24 @@ pkg_preinstall_rpm() { case `rpm -qp --nodigest --nosignature --qf "%{PAYLOADCOMPRESSOR}\n" "'$BUILD_ROOT'/.init_b_cache/rpms/$PKG.rpm"` in lzma) rpm --showrc | egrep 'PayloadIsLzma|_lzma' > /dev/null || PAYLOADDECOMPRESS="lzma -d" ;; xz) rpm --showrc | egrep 'PayloadIsXz|_xz' > /dev/null || PAYLOADDECOMPRESS="xz -d" ;; + zstd) rpm --showrc | egrep 'PayloadIsZstd' > /dev/null || PAYLOADDECOMPRESS="zstd -d" ;; esac if test "$PAYLOADDECOMPRESS" = "lzma -d" ; then if ! lzma </dev/null >/dev/null 2>&1 ; then - test -f "$BUILD_DIR/lzmadec.sh" && PAYLOADDECOMPRESS="bash $BUILD_DIR/lzmadec.sh" + test -f "$BUILD_DIR/lzmadec.sh" || cleanup_and_exit 3 "no lzma decoder available in host system" + PAYLOADDECOMPRESS="bash $BUILD_DIR/lzmadec.sh" fi fi if test "$PAYLOADDECOMPRESS" = "xz -d" ; then if ! xz </dev/null >/dev/null 2>&1 ; then - test -f "$BUILD_DIR/xzdec.sh" && PAYLOADDECOMPRESS="bash $BUILD_DIR/xzdec.sh" + test -f "$BUILD_DIR/xzdec.sh" || cleanup_and_exit 3 "no xz decoder available in host system" + PAYLOADDECOMPRESS="bash $BUILD_DIR/xzdec.sh" + fi + fi + if test "$PAYLOADDECOMPRESS" = "zstd -d" ; then + if ! zstd </dev/null >/dev/null 2>&1 ; then + test -f "$BUILD_DIR/zstddec.sh" || cleanup_and_exit 3 "no zstd decoder available in host system" + PAYLOADDECOMPRESS="bash $BUILD_DIR/zstddec.sh fi fi if test "$PAYLOADDECOMPRESS" = cat ; then diff --git a/debian/changelog b/debian/changelog index e16de0a..e3043d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +build (20160629-tizen20201203) unstable; urgency=high + + * update tizen version to tizen20201203 + * Support zstd decompression for old rpm version + * Support zstd arch for tar + + -- Wang Biao <biao716.wang@samsung.com> Tur, 3 Dec 2020 09:30:00 +0800 + build (20160629-tizen20200721) unstable; urgency=high * update tizen version to tizen20200721 diff --git a/debian/control b/debian/control index f8d93d5..5fd7761 100644 --- a/debian/control +++ b/debian/control @@ -13,7 +13,7 @@ Depends: ${perl:Depends}, libcrypt-ssleay-perl (>= 0.64-tizen20130308), binfmt-support, tizen-qemu-arm-static-2020.06.17 -Recommends: rpm2cpio +Recommends: rpm2cpio, zstd Description: A script to build SUSE Linux RPMs This package provides a script for building RPMs for SUSE Linux in a chroot environment. diff --git a/init_buildsystem b/init_buildsystem index 721cd55..68be1b6 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -417,6 +417,7 @@ downloadpkg() { if test "${url:0:7}" == "zypp://" -o "${url:0:7}" == "http://" -o "${url:0:8}" == "https://" -o "${url:0:6}" == "ftp://" -o "${url:0:7}" == "ftps://" ; then cachedir="$(getcachedir "$url")" local name="$(basename "$url")" + name=${name/%.pkg.tar.zst/.arch} name=${name/%.pkg.tar.?z/.arch} SRC="$cachedir/$name" else @@ -745,7 +746,8 @@ else ;; esac fi - SRCSUF=${SRC/%.pkg.tar.?z/.arch} + SRCSUF=${SRC/%.pkg.tar.zst/.arch} + SRCSUF=${SRCSUF/%.pkg.tar.?z/.arch} ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" done < $RPMLIST @@ -775,20 +777,23 @@ else rm -f "$BUILD_ROOT"/.init_b_cache/rpmlist.download2 while read PKG SRC ; do cachepkg="${SRC##*/}" + cachepkg="${cachepkg/%.pkg.tar.zst/.arch}" cachepkg="${cachepkg/%.pkg.tar.?z/.arch}" if test "$SRC" != "${SRC#zypp://}" ; then # for zypp packages also look in the zypp cache cachedir="/var/cache/zypp/packages/${SRC#zypp://}" cachedir="${cachedir%/*}" if can_reuse_cached_package "$cachedir/$cachepkg" ; then - SRCSUF=${SRC/%.pkg.tar.?z/.arch} + SRCSUF=${SRC/%.pkg.tar.zst/.arch} + SRCSUF=${SRCSUF/%.pkg.tar.?z/.arch} ln -s "$cachedir/$cachepkg" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" continue fi fi cachedir="$(getcachedir "$SRC")" if can_reuse_cached_package "$cachedir/$cachepkg" ; then - SRCSUF=${SRC/%.pkg.tar.?z/.arch} + SRCSUF=${SRC/%.pkg.tar.zst/.arch} + SRCSUF=${SRCSUF/%.pkg.tar.?z/.arch} ln -s "$cachedir/$cachepkg" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" continue fi @@ -808,7 +813,8 @@ else progress_step PACKAGES_TO_DOWNLOAD downloadpkg "$SRC" # downloadpkg modified $SRC, so it has a right name for use - SRCSUF=${SRC/%.pkg.tar.?z/.arch} + SRCSUF=${SRC/%.pkg.tar.zst/.arch} + SRCSUF=${SRCSUF/%.pkg.tar.?z/.arch} ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" done < "$BUILD_ROOT"/.init_b_cache/rpmlist.download rm -f "$BUILD_ROOT"/.init_b_cache/rpmlist.download diff --git a/packaging/build.changes b/packaging/build.changes index 2eb038f..76351dc 100644 --- a/packaging/build.changes +++ b/packaging/build.changes @@ -1,4 +1,11 @@ -------------------------------------------------------------------- +Thu Dec 3 09:30:00 CST 2020 - biao716.wang@samsung.com + +- Update tizen version to tizen20201203 +- Support zstd decompression for old rpm version +- Support zstd arch for tar + +-------------------------------------------------------------------- Tue Jul 21 09:30:00 CST 2020 - biao716.wang@samsung.com - Update tizen version to tizen20200721 diff --git a/packaging/build.spec b/packaging/build.spec index 72a2583..9fdb9ec 100644 --- a/packaging/build.spec +++ b/packaging/build.spec @@ -62,6 +62,7 @@ Recommends: perl(Pod::Usage) Recommends: perl(Time::Zone) Recommends: perl(URI) Recommends: bsdtar +Recommends: zstd %endif %if 0%{?suse_version} > 1120 || ! 0%{?suse_version} @@ -71,7 +72,7 @@ Requires: build-mkbaselibs %if 0%{?suse_version} > 1120 || 0%{?mdkversion} Recommends: build-mkdrpms %endif -Provides: tizen-build = 20200721 +Provides: tizen-build = 20201203 %description This package provides a script for building RPMs for SUSE Linux in a chroot environment. @@ -115,7 +116,7 @@ Group: Development/Tools/Building Requires: build BuildRequires: gcc BuildRequires: glibc-devel -Provides: tizen-build-initvm-%{initvm_arch} = 20200721 +Provides: tizen-build-initvm-%{initvm_arch} = 20201203 Obsoletes: build-initvm %if 0%{?suse_version} BuildRequires: glibc-devel-static @@ -193,6 +194,8 @@ test -e default.conf /usr/lib/build/initvm.* %changelog +* Thu Dec 3 2020 biao716.wangn@samsung.com +- update tizen version to tizen20201203 * Tue Jul 21 2020 biao716.wangn@samsung.com - update tizen version to tizen20200721 * Tue May 19 2020 biao716.wangn@samsung.com |