[arch-releng] [RFC] [PATCH] [configs/releng] Replace wget with pacman for make_core_repo()
Fix: FS#18959 - download_repos.sh does not report tcp timeouts and such * Always use pacman cache. Previously pacman cache was used if package already exists on it, now is also used to download pkg on it. Finally copy all packages from cache with cp and make core.db. * Using pacman, we can sure that package integrity is right. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- configs/releng/build.sh | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/configs/releng/build.sh b/configs/releng/build.sh index fa7d13c..0273aca 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -121,22 +121,18 @@ make_usr_share() { # Make [core] repository, keep "any" pkgs in a separate fs (makes more "dual-iso" friendly) make_core_repo() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - local _url _urls _pkg_name _cached_pkg _dst + local _url _urls _pkg_name _cached_pkg _dst _pkgs mkdir -p ${work_dir}/repo-core-any mkdir -p ${work_dir}/repo-core-${arch} pacman -Sy - _urls=$(pacman -Sddp $(comm -2 -3 <(pacman -Sql core | sort ) <(grep -v ^# ${script_path}/core.exclude.${arch} | sort))) + _pkgs=$(comm -2 -3 <(pacman -Sql core | sort ) <(grep -v ^# ${script_path}/core.exclude.${arch} | sort)) + _urls=$(pacman -Sddp ${_pkgs}) + pacman -Swdd --noconfirm ${_pkgs} for _url in ${_urls}; do _pkg_name=${_url##*/} _cached_pkg=/var/cache/pacman/pkg/${_pkg_name} _dst=${work_dir}/repo-core-${arch}/${_pkg_name} - if [[ ! -e ${_dst} ]]; then - if [[ -e ${_cached_pkg} ]]; then - cp -v "${_cached_pkg}" "${_dst}" - else - wget -nv "${_url}" -O "${_dst}" - fi - fi + cp "${_cached_pkg}" "${_dst}" repo-add -q ${work_dir}/repo-core-${arch}/core.db.tar.gz ${work_dir}/repo-core-${arch}/${_pkg_name} if [[ ${_pkg_name} =~ any.pkg ]]; then mv "${_dst}" ${work_dir}/repo-core-any/${_pkg_name} -- 1.7.6.1
Fix: FS#18959 - download_repos.sh does not report tcp timeouts and such * Always use pacman cache. Previously pacman cache was used if package already exists on it, now is also used to download pkg on it. Finally copy all packages from cache with cp and make core.db. * Using pacman, we can sure that package integrity is right. (RFCv2) * Always get a [core] package, in case of [testing] enabled. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- configs/releng/build.sh | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-) diff --git a/configs/releng/build.sh b/configs/releng/build.sh index fa7d13c..9723d0f 100755 --- a/configs/releng/build.sh +++ b/configs/releng/build.sh @@ -121,26 +121,23 @@ make_usr_share() { # Make [core] repository, keep "any" pkgs in a separate fs (makes more "dual-iso" friendly) make_core_repo() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then - local _url _urls _pkg_name _cached_pkg _dst + local _url _urls _pkg_name _cached_pkg _dst _pkgs mkdir -p ${work_dir}/repo-core-any mkdir -p ${work_dir}/repo-core-${arch} pacman -Sy - _urls=$(pacman -Sddp $(comm -2 -3 <(pacman -Sql core | sort ) <(grep -v ^# ${script_path}/core.exclude.${arch} | sort))) + _pkgs=$(comm -2 -3 <(pacman -Sql core | sort | sed 's@^@core/@') \ + <(grep -v ^# ${script_path}/core.exclude.${arch} | sort | sed 's@^@core/@')) + _urls=$(pacman -Sddp ${_pkgs}) + pacman -Swdd --noconfirm ${_pkgs} for _url in ${_urls}; do _pkg_name=${_url##*/} _cached_pkg=/var/cache/pacman/pkg/${_pkg_name} _dst=${work_dir}/repo-core-${arch}/${_pkg_name} - if [[ ! -e ${_dst} ]]; then - if [[ -e ${_cached_pkg} ]]; then - cp -v "${_cached_pkg}" "${_dst}" - else - wget -nv "${_url}" -O "${_dst}" - fi - fi - repo-add -q ${work_dir}/repo-core-${arch}/core.db.tar.gz ${work_dir}/repo-core-${arch}/${_pkg_name} + cp ${_cached_pkg} ${_dst} + repo-add -q ${work_dir}/repo-core-${arch}/core.db.tar.gz ${_dst} if [[ ${_pkg_name} =~ any.pkg ]]; then - mv "${_dst}" ${work_dir}/repo-core-any/${_pkg_name} - ln -sf ../any/${_pkg_name} ${work_dir}/repo-core-${arch}/${_pkg_name} + mv ${_dst} ${work_dir}/repo-core-any/${_pkg_name} + ln -sf ../any/${_pkg_name} ${_dst} fi done : > ${work_dir}/build.${FUNCNAME} -- 1.7.6.1
Am 30.08.2011 17:00, schrieb Gerardo Exequiel Pozzi:
Fix: FS#18959 - download_repos.sh does not report tcp timeouts and such
* Always use pacman cache. Previously pacman cache was used if package already exists on it, now is also used to download pkg on it. Finally copy all packages from cache with cp and make core.db.
* Using pacman, we can sure that package integrity is right.
(RFCv2) * Always get a [core] package, in case of [testing] enabled.
Also, wget file:///path -> Unsupported scheme `file'.
On 08/30/2011 01:00 PM, Thomas Bächler wrote:
Am 30.08.2011 17:00, schrieb Gerardo Exequiel Pozzi:
Fix: FS#18959 - download_repos.sh does not report tcp timeouts and such
* Always use pacman cache. Previously pacman cache was used if package already exists on it, now is also used to download pkg on it. Finally copy all packages from cache with cp and make core.db.
* Using pacman, we can sure that package integrity is right.
(RFCv2) * Always get a [core] package, in case of [testing] enabled. Also, wget file:///path -> Unsupported scheme `file'.
true true :) -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (2)
-
Gerardo Exequiel Pozzi
-
Thomas Bächler