summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2022-09-20 14:51:36 +0900
committerbiao716.wang <biao716.wang@samsung.com>2022-09-20 14:51:36 +0900
commitc6193365f6c02d6bfcb08fed978649d1b650f3e9 (patch)
tree7ac151da9f31fe8fc3e0f083de207d494075e2a1
parentfc25bd30d0fd85d0e68d194e8754ce8006b5be33 (diff)
parent48d2be133255c2e5bc05e99cf9cbd7962ce4e8bf (diff)
downloadbuild-c6193365f6c02d6bfcb08fed978649d1b650f3e9.tar.gz
build-c6193365f6c02d6bfcb08fed978649d1b650f3e9.tar.bz2
build-c6193365f6c02d6bfcb08fed978649d1b650f3e9.zip
Change-Id: I03b5f1ec747d2e61c184fb1d7dfa6749b87bcbe0
-rw-r--r--debian/changelog8
-rwxr-xr-xdownload2
-rwxr-xr-xinit_buildsystem71
-rwxr-xr-xorder9
-rw-r--r--packaging/build.changes7
-rw-r--r--packaging/build.spec4
6 files changed, 85 insertions, 16 deletions
diff --git a/debian/changelog b/debian/changelog
index e0f2dfa..f72e75e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+build (20160629-tizen20220803) unstable; urgency=high
+
+ * Update tizen version to tizen20220803
+ * Always retry 3 times to download if download fail.
+ * Add logic to re-downloading packages in reorder step if some packages is missed!
+
+ -- Wang Biao <biao716.wang@samsung.com> Wed, 03 Aug 2022 09:30:00 +0800
+
build (20160629-tizen20220705) unstable; urgency=high
* Update tizen version to tizen20220705
diff --git a/download b/download
index 9297e30..6b374d3 100755
--- a/download
+++ b/download
@@ -96,7 +96,7 @@ for my $url (@ARGV) {
my $res = $ua->mirror($url, $dest);
last if $res->is_success;
# if it's a redirect we probably got a bad mirror and should just retry
- die "reqesting " . hide_passwd($original) . " failed: ".$res->status_line."\n" unless $retry && $res->previous;
+ die "reqesting " . hide_passwd($original) . " failed: ".$res->status_line."\n" unless $retry;
warn "retrying " . hide_passwd($original) . "\n";
}
rename($dest, "$dir/".basename($url->path));
diff --git a/init_buildsystem b/init_buildsystem
index 6876514..dfab8e3 100755
--- a/init_buildsystem
+++ b/init_buildsystem
@@ -270,15 +270,6 @@ run_pkg_scripts() {
done
}
-reorder() {
- test -z "$*" && return
- rm -f "$BUILD_ROOT"/.init_b_cache/order.manifest
- for PKG in "$@" ; do
- echo "$PKG" >> "$BUILD_ROOT"/.init_b_cache/order.manifest
- done
- $BUILD_DIR/order --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR --manifest "$BUILD_ROOT"/.init_b_cache/order.manifest "$BUILD_ROOT"/.init_b_cache/rpms || touch "$BUILD_ROOT"/exit
- rm -f "$BUILD_ROOT"/.init_b_cache/order.manifest
-}
create_devs() {
local com file mode arg
@@ -445,7 +436,9 @@ downloadpkg() {
local destdir="$cachedir/tmp_$$"
mkdir -p "$destdir"
- echo "downloading $url ... ";
+ if [ ! -f "$BUILD_ROOT"/exit ] ; then
+ echo "downloading $url ... ";
+ fi
$BUILD_DIR/download "$destdir" "$url" || cleanup_and_exit 1
local destfile="$destdir/${url##*/}"
if test ! -e "$destfile" ; then
@@ -468,6 +461,61 @@ downloadpkg() {
rm -rf $destdir
}
+reorder() {
+ test -z "$*" && return
+ rm -f "$BUILD_ROOT"/.init_b_cache/order.manifest
+ for PKG in "$@" ; do
+ echo "$PKG" >> "$BUILD_ROOT"/.init_b_cache/order.manifest
+ done
+
+ #NOTICE: in reorder, you can't print any logs, or it will treate the logs as pacakges outside
+ #Change: If reorder failed because of missing packages, add logic to re-download the missed packages.
+ touch "$BUILD_ROOT"/missedPKG
+ echo "" > "$BUILD_ROOT"/missedPKG
+ while true
+ do
+ #remove exit file, it will create exit file if reorder fail.
+ rm -f "$BUILD_ROOT"/exit
+ #call order operation
+ $BUILD_DIR/order --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR --manifest "$BUILD_ROOT"/.init_b_cache/order.manifest "$BUILD_ROOT"/.init_b_cache/rpms "$BUILD_ROOT"/missedPKG || touch "$BUILD_ROOT"/exit
+
+ #order operation OK, exit reorder funciton
+ if [ ! -f "$BUILD_ROOT"/exit ]; then
+ #after reorder again, if reorder is normal, should delete tmp file.
+ rm -f "$BUILD_ROOT"/missedPKG
+ rm -f "$BUILD_ROOT"/.init_b_cache/rpmlist_reorder_check.download
+ break
+ fi
+ #order operation failed!
+ if [ -f "$BUILD_ROOT"/exit ]; then
+ #fail reason: binary not found. To try to download packages again.
+ if test -s "$BUILD_ROOT"/missedPKG; then
+ for line in `cat "$BUILD_ROOT"/missedPKG`; do
+ while read PKG SRC; do
+ if [ "$PKG" = "$line" ]; then
+ downloadpkg "$SRC"
+ # downloadpkg missed packages
+ SRCSUF=${SRC/%.pkg.tar.?z/.arch}
+ #remove the soft link that already existed.
+ rm -f "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}"
+ ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}"
+ break
+ fi
+ done < "$BUILD_ROOT"/.init_b_cache/rpmlist_reorder_check.download
+ done
+ #clear file. use it next loop if needed.
+ echo "" > "$BUILD_ROOT"/missedPKG
+ #Other fail reason. Exit!
+ else
+ rm -f "$BUILD_ROOT"/missedPKG
+ rm -f "$BUILD_ROOT"/.init_b_cache/rpmlist_reorder_check.download
+ break
+ fi
+ fi
+ done
+ rm -f "$BUILD_ROOT"/.init_b_cache/order.manifest
+}
+
getcachedir() {
local url=$1
for repo in "${repos[@]}" ; do
@@ -838,6 +886,7 @@ else
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
+ cp "$BUILD_ROOT"/.init_b_cache/rpmlist.download "$BUILD_ROOT"/.init_b_cache/rpmlist_reorder_check.download
rm -f "$BUILD_ROOT"/.init_b_cache/rpmlist.download
echo
fi
@@ -973,7 +1022,7 @@ if ! test -e "$BUILD_ROOT"/.build/init_buildsystem.data ; then
echo -n 'reordering...'
PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`
check_exit
- echo 'done'
+ echo 'reordering done'
fi
#
diff --git a/order b/order
index a3c9d8e..398c8ab 100755
--- a/order
+++ b/order
@@ -57,7 +57,7 @@ while (@ARGV) {
die("usage: order [--manifest manifest] cachedir [packages...]\n") unless @ARGV;
my $cachedir = shift @ARGV;
-
+my $missedpkgfile = shift @ARGV;
my @p;
if ($manifest) {
if ($manifest eq '-') {
@@ -92,7 +92,12 @@ for my $p (@p) {
delete $q->{'filelist'};
last;
}
- die("binary not found: $p\n") unless $q;
+ unless ($q) {
+ open(MISS, ">$missedpkgfile");
+ print MISS "$p";
+ close(MISS);
+ die("binary not found: $p, try to download it again!\n");
+ }
$deps{$p} = $q;
}
diff --git a/packaging/build.changes b/packaging/build.changes
index aa9312e..a718ad3 100644
--- a/packaging/build.changes
+++ b/packaging/build.changes
@@ -1,4 +1,11 @@
--------------------------------------------------------------------
+Wed Aug 03 09:30:00 CST 2022 - biao716.wang@samsung.com
+
+- Update tizen version to tizen20220803
+- Always retry 3 times to download if download fail.
+- Add logic to re-downloading packages in reorder step if some packages is missed!
+
+--------------------------------------------------------------------
Thu Jul 05 09:30:00 CST 2022 - biao716.wang@samsung.com
- update tizen version to tizen20220705
diff --git a/packaging/build.spec b/packaging/build.spec
index 302008c..c8c7a55 100644
--- a/packaging/build.spec
+++ b/packaging/build.spec
@@ -72,7 +72,7 @@ Requires: build-mkbaselibs
%if 0%{?suse_version} > 1120 || 0%{?mdkversion}
Recommends: build-mkdrpms
%endif
-Provides: tizen-build = 20220705
+Provides: tizen-build = 20220803
%description
This package provides a script for building RPMs for SUSE Linux in a
chroot environment.
@@ -116,7 +116,7 @@ Group: Development/Tools/Building
Requires: build
BuildRequires: gcc
BuildRequires: glibc-devel
-Provides: tizen-build-initvm-%{initvm_arch} = 20220705
+Provides: tizen-build-initvm-%{initvm_arch} = 20220803
Obsoletes: build-initvm
%if 0%{?suse_version}
BuildRequires: glibc-devel-static