From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 64C6B442BBC for ; Mon, 30 Mar 2020 08:38:10 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Mon, 30 Mar 2020 08:38:05 +0300 Message-Id: In-Reply-To: References: In-Reply-To: References: Subject: [Tarantool-patches] [PATCH v1 2/3] Enable script for saving packages in S3 for modules List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Oleg Piskunov , Sergey Bronnikov , Alexander Turenko Cc: tarantool-patches@dev.tarantool.org From: "Alexander.V Tikhonov" Found that modules may have only binaries packages w/o sources packages. Script changed to be able to work with only binaries either sources packages. Follow-up #3380 --- tools/update_repo.sh | 51 +++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/tools/update_repo.sh b/tools/update_repo.sh index ddc44d118..975a76c00 100755 --- a/tools/update_repo.sh +++ b/tools/update_repo.sh @@ -306,20 +306,24 @@ function pack_deb { # debian has special directory 'pool' for packages debdir=pool - # get packages from pointed location - if ! ls $repo/*.deb $repo/*.dsc $repo/*.tar.*z >/dev/null ; then - echo "ERROR: files $repo/*.deb $repo/*.dsc $repo/*.tar.*z not found" - usage - exit 1 - fi - # set the subpath with binaries based on literal character of the product name proddir=$(echo $product | head -c 1) # copy single distribution with binaries packages repopath=$ws/pool/${option_dist}/$component/$proddir/$product $mk_dir ${repopath} - cp $repo/*.deb $repo/*.dsc $repo/*.tar.*z $repopath/. + file_found=0 + for file in $repo/*.deb $repo/*.dsc $repo/*.tar.*z ; do + [ -f $file ] || continue + file_found=1 + cp $file $repopath/. + done + # check that any files found + if [ "$file_found" == "0" ]; then + echo "ERROR: files $repo/*.deb $repo/*.dsc $repo/*.tar.*z not found" + usage + exit 1 + fi pushd $ws # create the configuration file for 'reprepro' tool @@ -395,28 +399,36 @@ EOF continue || echo "Updating dists" # finalize the Packages file - for packages in dists/$loop_dist/$component/binary-*/Packages ; do - mv $packages.saved $packages - done + if [ -f $packages.saved ]; then + for packages in dists/$loop_dist/$component/binary-*/Packages ; do + mv $packages.saved $packages + done + fi # finalize the Sources file - sources=dists/$loop_dist/$component/source/Sources - mv $sources.saved $sources + if [ -f $sources.saved ]; then + sources=dists/$loop_dist/$component/source/Sources + mv $sources.saved $sources + fi # 2(binaries). update Packages file archives for packpath in dists/$loop_dist/$component/binary-* ; do pushd $packpath - sed "s#Filename: $debdir/$component/#Filename: $debdir/$loop_dist/$component/#g" -i Packages - bzip2 -c Packages >Packages.bz2 - gzip -c Packages >Packages.gz + if [ -f Packages ]; then + sed "s#Filename: $debdir/$component/#Filename: $debdir/$loop_dist/$component/#g" -i Packages + bzip2 -c Packages >Packages.bz2 + gzip -c Packages >Packages.gz + fi popd done # 2(sources). update Sources file archives pushd dists/$loop_dist/$component/source - sed "s#Directory: $debdir/$component/#Directory: $debdir/$loop_dist/$component/#g" -i Sources - bzip2 -c Sources >Sources.bz2 - gzip -c Sources >Sources.gz + if [ -f Sources ]; then + sed "s#Directory: $debdir/$component/#Directory: $debdir/$loop_dist/$component/#g" -i Sources + bzip2 -c Sources >Sources.bz2 + gzip -c Sources >Sources.gz + fi popd # 3. update checksums entries of the Packages* files in *Release files @@ -435,6 +447,7 @@ EOF # 'sha1' - at the 2nd and 'sha256' at the 3rd pushd dists/$loop_dist for file in $(grep " $component/" Release | awk '{print $3}' | sort -u) ; do + [ -f $file ] || continue sz=$(stat -c "%s" $file) md5=$(md5sum $file | awk '{print $1}') sha1=$(sha1sum $file | awk '{print $1}') -- 2.17.1