Sasha, could you please remove comments about Vanilla packages structure.
For the rest - LGTM
 
Regards,
Oleg
 
Вторник, 18 февраля 2020, 10:47 +03:00 от Alexander V. Tikhonov <avtikhon@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 | 73 +++++++++++++++++++++++++++++++-------------
 1 file changed, 51 insertions(+), 22 deletions(-)

diff --git a/tools/update_repo.sh b/tools/update_repo.sh
index 65a977187..ec6146514 100755
--- a/tools/update_repo.sh
+++ b/tools/update_repo.sh
@@ -405,42 +405,68 @@ 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 ! ls $repo/$pack_pattern >/dev/null ; then
+ if [ "$pack_pattern" == "*.noarch.rpm" ]; then
+ pack_patterns=$(echo "$pack_patterns" | sed "s#$pack_pattern##g")
+ continue
+ fi
+ 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 +573,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 +591,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
 
 
 
--
Oleg Piskunov