From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 A0ED9469719 for ; Tue, 18 Feb 2020 10:12:35 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Tue, 18 Feb 2020 10:12:32 +0300 Message-Id: Subject: [Tarantool-patches] [PATCH v1 1/2] Make S3 paths the same to Tarantool documented List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Oleg Piskunov Cc: tarantool-patches@dev.tarantool.org Changed the Vanilla paths of the packages in S3 to the Tarantool documented on its web site, to give the ability to Tarantool users to continue use it w/o changes. Also moved the RPM sources packages to the standalone path. Follows up #3380 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-3380-rpm-packages-paths-full-ci Issue: https://github.com/tarantool/tarantool/issues/3380 tools/update_repo.sh | 70 ++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/tools/update_repo.sh b/tools/update_repo.sh index 65a977187..e129f7d60 100755 --- a/tools/update_repo.sh +++ b/tools/update_repo.sh @@ -405,42 +405,65 @@ EOF } # The 'pack_rpm' function especialy created for RPM packages. It works -# with RPM packing OS like Centos, Fedora. It is based on globaly known +# with RPM packing OS like CentOS, Fedora. It is based on globaly known # tool 'createrepo' from: -# https://linux.die.net/man/8/createrepo +# https://linux.die.net/man/8/createrepo # This tool works with single distribution of the given OS. -# Result of the routine is the rpm package for YUM repository with -# file structure equal to the Centos/Fedora: -# http://mirror.centos.org/centos/7/os/x86_64/Packages/ -# http://mirrors.kernel.org/fedora/releases/30/Everything/x86_64/os/Packages/t/ +# +# Vanilla RPM packages structure for YUM repositories looks like: +# CentOS: +# Binaries: http://mirror.centos.org/centos/7/os/x86_64/Packages/ +# Sources: http://vault.centos.org/8.1.1911/BaseOS/Source/SPackages/ +# Fedora: +# Binaries: http://mirrors.kernel.org/fedora/releases/30/Everything/x86_64/os/Packages/t/ +# Sources: http://mirrors.kernel.org/fedora/releases/30/Everything/source/tree/Packages/t/ +# Decided to have back port capability at Tarantool links: +# CentOS: +# Tarantool: https://www.tarantool.io/en/download/os-installation/rhel-centos/ +# Changed Vanila -> MCS S3: +# centos/7/os/x86_64/Packages -> centos/7/x86_64/Packages +# 8.1.1911/BaseOS/Source/SPackages -> centos/8.1.1911/SRPMS/Packages +# Fedora: +# Tarantool: https://www.tarantool.io/en/download/os-installation/fedora/ +# Changed Vanila -> MCS S3: +# fedora/releases/30/Everything/x86_64/os/Packages -> fedora/30/x86_64/Packages +# fedora/releases/30/Everything/source/tree/Packages -> fedora/30/SRPMS/Packages function pack_rpm { - if ! ls $repo/*.rpm >/dev/null ; then - echo "ERROR: Current '$repo' path doesn't have RPM packages in path" - usage - exit 1 - fi + pack_subdir=$1 + pack_patterns=$2 + + for pack_pattern in $pack_patterns ; do + if [ "$pack_pattern" == "*.noarch.rpm" ]; then continue ; fi + if ! ls $repo/$pack_pattern >/dev/null ; then + echo "ERROR: Current '$repo' path doesn't have $pack_pattern packages in path" + usage + exit 1 + fi + done # prepare the workspace prepare_ws ${os}_${option_dist} # copy the needed package binaries to the workspace - cp $repo/*.rpm $ws/. + for pack_pattern in $pack_patterns ; do + cp $repo/$pack_pattern $ws/. + done pushd $ws # set the paths - if [ "$os" == "el" ]; then - repopath=$option_dist/os/x86_64 - rpmpath=Packages - elif [ "$os" == "fedora" ]; then - repopath=releases/$option_dist/Everything/x86_64/os - rpmpath=Packages/$proddir + repopath=$option_dist/$pack_subdir + rpmpath=Packages + if [ "$os" == "fedora" ]; then + rpmpath=$rpmpath/$proddir fi packpath=$repopath/$rpmpath # prepare local repository with packages $mk_dir $packpath - mv *.rpm $packpath/. + for pack_pattern in $pack_patterns ; do + mv $pack_pattern $packpath/. + done cd $repopath # copy the current metadata files from S3 @@ -547,8 +570,10 @@ EOF gpg --detach-sign --armor repodata/repomd.xml # copy the packages to S3 - for file in $rpmpath/*.rpm ; do - $aws_cp_public $file "$bucket_path/$repopath/$file" + for pack_pattern in $pack_patterns ; do + for file in $rpmpath/$pack_pattern ; do + $aws_cp_public $file "$bucket_path/$repopath/$file" + done done # update the metadata at the S3 @@ -563,7 +588,8 @@ EOF if [ "$os" == "ubuntu" -o "$os" == "debian" ]; then pack_deb elif [ "$os" == "el" -o "$os" == "fedora" ]; then - pack_rpm + pack_rpm x86_64 "*.x86_64.rpm *.noarch.rpm" + pack_rpm SRPMS "*.src.rpm" else echo "USAGE: given OS '$os' is not supported, use any single from the list: $alloss" usage -- 2.17.1