From f61e01f1dd13c326c6888e9fdf6899c928ca447d Mon Sep 17 00:00:00 2001 From: Albert Hopkins Date: Mon, 16 Feb 2015 18:03:44 +0000 Subject: [PATCH] sync_stage3: Use a helper script The Makefile logic was lousy and broken. Add a more robust helper script. --- Makefile | 3 +-- scripts/sync-stage3.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 scripts/sync-stage3.sh diff --git a/Makefile b/Makefile index 7fd1a06..35794ce 100644 --- a/Makefile +++ b/Makefile @@ -149,8 +149,7 @@ stage3-$(ARCH)-latest.tar.bz2: @exit 1 sync_stage3: - rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/latest-stage3.txt latest-stage3.txt - rsync --no-motd $(RSYNC_MIRROR)/releases/$(ARCH)/autobuilds/$$(grep stage3-$$(echo $(ARCH)|sed 's/x86/i686/')-[0-9]*\.tar\.bz2 latest-stage3.txt) stage3-$(ARCH)-latest.tar.bz2 + ./scripts/sync-stage3.sh $(ARCH) stage3: stage3-$(ARCH)-latest.tar.bz2 diff --git a/scripts/sync-stage3.sh b/scripts/sync-stage3.sh new file mode 100755 index 0000000..4131dd7 --- /dev/null +++ b/scripts/sync-stage3.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e +RSYNC_MIRROR=${RSYNC_MIRROR:-rsync://mirrors.rit.edu/gentoo/} +arch=$1 +g_arch=$(echo ${arch}|sed 's/i.86/x86/') +rsync="rsync --no-motd" +echo -n ${arch}: + +latest=/releases/${g_arch}/autobuilds/latest-stage3.txt + +${rsync} ${RSYNC_MIRROR}${latest} latest-stage3.txt +file=$(egrep -v 'nomultilib|hardened|uclibc|^#' latest-stage3.txt \ + | grep ${arch}|head -n 1 \ + | cut -d ' ' -f 1) + +file=/releases/${g_arch}/autobuilds/${file} +echo ${file} +${rsync} ${RSYNC_MIRROR}${file} stage3-${arch}-latest.tar.bz2