Files
scst/scripts/rhel-rpm-functions
Yan Burman 457dfaaf3e Merged revisions 5822-5826,5828,5830 via svnmerge from
svn+ssh://yanb123@svn.code.sf.net/p/scst/svn/branches/3.0.x

........
  r5822 | bvassche | 2014-10-03 13:51:13 +0200 (Fri, 03 Oct 2014) | 1 line
  
  scripts/rebuild-rhel-kernel-rpm: Enable put_page_callback patch for RHEL 7 (merge r5817 from trunk)
........
  r5823 | bvassche | 2014-10-03 13:59:39 +0200 (Fri, 03 Oct 2014) | 1 line
  
  scripts: Merge r5533:5821 from trunk except rebuild-rhel-kernel-rpm
........
  r5824 | bvassche | 2014-10-03 14:07:17 +0200 (Fri, 03 Oct 2014) | 2 lines
  
  scripts/rebuild-rhel-kernel-rpm: Move code for downloading a RHEL (clone) RPM into a separate file (merge r5672 from trunk)
........
  r5825 | bvassche | 2014-10-03 14:08:24 +0200 (Fri, 03 Oct 2014) | 1 line
  
  scripts/rebuild-rhel-kernel-rpm: Add RHEL 7 support (merge r5712 from trunk)
........
  r5826 | bvassche | 2014-10-03 14:10:28 +0200 (Fri, 03 Oct 2014) | 1 line
  
  scripts/rebuild-rhel-kernel-rpm: Fix for invocation from current directory (merge r5744 from trunk)
........
  r5828 | bvassche | 2014-10-03 14:24:27 +0200 (Fri, 03 Oct 2014) | 1 line
  
  scripts/generate-kernel-patch: Only generate scst_itf_ver.h if needed (merge r5827 from trunk)
........
  r5830 | bvassche | 2014-10-03 14:27:30 +0200 (Fri, 03 Oct 2014) | 2 lines
  
  scst_mem: Fix a memory leak triggered by the scst_user driver (merge r5829 from trunk)
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x-iser@5831 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-10-05 06:10:20 +00:00

99 lines
3.3 KiB
Bash

# -*- mode: shell-script -*-
# Shell functions for downloading and extracting a RHEL or RHEL clone RPM
# Arguments:
# $1: Linux distribution name
# $2: Linux distribution version (major.minor)
# $3: architecture
function get_srpm_urls() {
local arch distro releasever releasevermajor releaseverminor
distro="$1"
releasever="$2"
arch="$3"
IFS=.
set -- "$2"
unset IFS
releasevermajor="$1"
releaseverminor="$2"
case "$distro" in
"CentOS"*)
case $releasever in
5.*|6.[01])
echo "http://vault.centos.org/${releasever}/os/SRPMS http://vault.centos.org/${releasever}/updates/SRPMS";;
[67].*)
echo "http://vault.centos.org/${releasever}/os/Source/SPackages http://vault.centos.org/${releasever}/updates/Source/SPackages";;
esac
;;
"Red Hat Enterprise Linux"*)
case $releasever in
[56].*)
echo "http://ftp.redhat.com/pub/redhat/linux/enterprise/${releasevermajor}Server/en/os/SRPMS http://ftp.redhat.com/redhat/rhel/rc/7/Server/source/tree/Packages";;
esac
;;
"Oracle Linux Server")
echo "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/${releaseverminor}/base/${arch}/getPackageSource http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/latest/${arch}/getPackageSource http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/UEK/latest/${arch}/getPackageSource"
;;
"Scientific Linux")
case $releasever in
5.*)
echo "http://ftp.scientificlinux.org/linux/scientific/$releasevermajor$releaseverminor/SRPMS/vendor";;
6.*)
echo "http://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/vendor";;
esac
;;
*)
echo "Unknown type of distribution: $distro" >&2
return 1
;;
esac
}
# Arguments:
# $1: Linux distribution name
# $2: Linux distribution version (major.minor)
# $3: architecture
function get_rpm_urls() {
local arch distro releasever releasevermajor releaseverminor
distro="$1"
releasever="$2"
arch="$3"
IFS=.
set -- "$2"
unset IFS
releasevermajor="$1"
releaseverminor="$2"
case "$distro" in
"CentOS"*)
case $releasever in
5.*)
echo "http://vault.centos.org/${releasever}/os/${arch}/CentOS http://vault.centos.org/${releasever}/updates/${arch}/RPMS";;
6.[01])
echo "http://vault.centos.org/${releasever}/os/${arch}/Packages http://vault.centos.org/${releasever}/updates/${arch}/Packages";;
[67].*)
echo "http://vault.centos.org/${releasever}/os/${arch}/Packages http://vault.centos.org/${releasever}/updates/${arch}/Packages";;
esac
;;
"Red Hat Enterprise Linux"*)
echo "";;
"Oracle Linux Server")
echo "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/${releaseverminor}/base/${arch}/getPackageSource http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/latest/${arch}/getPackageSource http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/UEK/latest/${arch}/getPackageSource"
;;
"Scientific Linux")
case $releasever in
5.*)
echo "http://ftp.scientificlinux.org/linux/scientific/$releasevermajor$releaseverminor/SRPMS/vendor";;
6.*)
echo "http://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/vendor";;
esac
;;
*)
echo "Unknown distribution type: $distro" >&2
return 1
;;
esac
}