head	1.12;
access;
symbols
	GENTOO_1_4_SNAP_2003010800:1.8;
locks; strict;
comment	@# @;


1.12
date	2003.03.12.17.52.19;	author mholzer;	state dead;
branches;
next	1.11;

1.11
date	2003.02.14.22.05.32;	author vapier;	state Exp;
branches;
next	1.10;

1.10
date	2003.01.22.19.28.35;	author mholzer;	state Exp;
branches;
next	1.9;

1.9
date	2003.01.18.16.14.35;	author mholzer;	state Exp;
branches;
next	1.8;

1.8
date	2003.01.03.20.51.49;	author mholzer;	state Exp;
branches;
next	1.7;

1.7
date	2002.12.06.19.59.03;	author mholzer;	state Exp;
branches;
next	1.6;

1.6
date	2002.11.11.14.40.12;	author mholzer;	state Exp;
branches;
next	1.5;

1.5
date	2002.09.09.15.14.08;	author phoenix;	state Exp;
branches;
next	1.4;

1.4
date	2002.06.24.21.14.19;	author karltk;	state Exp;
branches;
next	1.3;

1.3
date	2002.06.04.23.28.51;	author karltk;	state Exp;
branches;
next	1.2;

1.2
date	2002.06.04.23.04.41;	author karltk;	state Exp;
branches;
next	1.1;

1.1
date	2002.01.24.20.45.57;	author karltk;	state Exp;
branches;
next	;


desc
@@


1.12
log
@removed emerge-webrsync since it's in portage now
@
text
@#!/bin/sh
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/app-admin/gentoolkit/files/scripts/emerge-webrsync,v 1.11 2003/02/14 22:05:32 vapier Exp $
# Author: Karl Trygve Kalleberg <karltk@@gentoo.org>
# Rewritten from the old, Perl-based emerge-webrsync script

if [ -e /usr/bin/spython ]
then
	#1.0_rc6 and earlier
	PYTHON=/usr/bin/spython
else
	#1.0 and later
	PYTHON=/usr/bin/python
fi

GENTOO_MIRRORS="`${PYTHON} -c 'import portage; print portage.settings["GENTOO_MIRRORS"];'`"
syncpath="/var/tmp/emerge-webrsync"

if [ ! -d $syncpath ] ; then
	mkdir -p $syncpath
fi

cd $syncpath

found=0
attempts=0
download=1
if [ "$1" == "-v" ] ; then
	wgetops=
else	
	wgetops=-q
fi

if [ "$1" == "-n" ] ; then
	download=0
fi

sync_local() {
	echo Syncing local tree...
	tar jxf $file
	rm -f $file
	# Make sure user and group file ownership is root
	chown -R root:root portage
	cd portage
	rsync -av --progress --stats --delete --delete-after \
	--exclude='distfiles/*' --exclude='packages/*' . /usr/portage
	cd ..
	rm -rf portage
}

echo "Fetching most recent snapshot"

while (( $attempts <  40 )) ; do

	day=`date -d "-$attempts day" +"%d"`
	month=`date -d "-$attempts day" +"%m"`
	year=`date -d "-$attempts day" +"%Y"`

	file="portage-${year}${month}${day}.tar.bz2"

	if [ -f $file ] && [ $download == 0 ] ; then
		sync_local
		exit 0
	fi

	for i in $GENTOO_MIRRORS ; do 
		url="${i}/snapshots/$file"
		rm -f $file
		
		if (wget $wgetops $url) && [ -s $file ] ; then
			sync_local
			exit 0
		fi
	done
	attempts=$[attempts+1]
done

rm -rf portage

exit 1
@


1.11
log
@update copyright info
@
text
@d4 1
a4 1
# $Header: $
@


1.10
log
@fixed emerge-webrsync
@
text
@d1 4
a4 3
#! /bin/sh

# Copyright(c) 2002 Gentoo Technologies, Inc.
@


1.9
log
@emerge-webrsync should now work as expected and delete old ebuilds
@
text
@d44 1
d46 2
a47 1
	--exclude='distfiles/*' --exclude='packages/*' . /usr
@


1.8
log
@Added -v option to emerge-webrsync to display wget status.
@
text
@d44 2
a45 1
	rsync -av . /usr
@


1.7
log
@ emerge-webrsync now changes user and group to root before rsyncing. Fixes #9306
@
text
@d28 5
a32 1
wgetops=-q
@


1.6
log
@emerge-webrsync fixed
@
text
@d38 2
@


1.5
log
@Fixed emerge-webrsync
@
text
@d61 1
a61 1
		if (wget $wgetops $url) ; then
@


1.4
log
@Fixes #3472.
@
text
@d7 8
a14 1
. /etc/make.conf
d16 1
d60 1
@


1.3
log
@Fixes #2514.
@
text
@d4 1
a4 1
# Author: Karl Trygve Kalleberg
d11 1
a11 1
if [ ! -f $syncpath ] ; then
d18 15
d34 1
a34 1
attempts=0
d44 5
d51 5
a55 6
		echo $url
		wget $url && ( 
			tar xjf $file
			rm $file
			rsync -av . /usr/
			exit 0 )
d61 2
@


1.2
log
@Fixes #2514.
@
text
@d1 1
a1 1
#!/usr/bin/perl -w
d3 3
a5 1
use strict;
d7 1
a7 1
my $tempRsyncPath = "/var/tmp/emerge-webrsync";
d9 1
a9 31
unless(-e $tempRsyncPath)
{
	mkdir($tempRsyncPath);
}

chdir($tempRsyncPath);

my $mytime = time;
my $flag = 1;

while($flag)
{
	my @@date = localtime($mytime);
	my $day = sprintf("%02d", $date[3]);
	++$date[4];
	my $month = sprintf("%02d", $date[4]);
	$date[5] += 1900;
	my $year = sprintf("%04d", $date[5]);
	
	my $file = "portage-".$year.$month.$day.".tar.bz2";
	my $url = "http://www.ibiblio.org/gentoo/snapshots/$file"
	print "Trying to get $url...\n";
	$flag = system "wget $url";
	if(!$flag)
	{
		system "tar xjf $file";
		unlink($file);
		system "rsync -av . /usr/";
	}
	else { $mytime -= 86400; }
}
d11 31
a41 1
system "rm -rf portage";
@


1.1
log
@Initial import of Gentoolkit
@
text
@d27 1
a27 1
	my $url = "http://www.gentoo.org/snapshots/$file";
@

