Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 8540 Details for
Bug 15990
emerge-webrsync redownloads snapshots if no newer snapshots are available
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Another webrsync script
emerge_rsync-2.0 (text/plain), 2.83 KB, created by
Daniel Milne
on 2003-02-20 08:36:47 UTC
(
hide
)
Description:
Another webrsync script
Filename:
MIME Type:
Creator:
Daniel Milne
Created:
2003-02-20 08:36:47 UTC
Size:
2.83 KB
patch
obsolete
>#!/bin/sh ># Copyright 1999-2003 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License v2 ># ># Inspired by : A script by zyta2k of Switzerland, 2 May 2002 (email address not available.) ># See http://forums.gentoo.org/viewtopic.php?t=1556 for original version ># : emerge-webrsync ># ># Author: Dan Milne <daniel.milne@dynexco.com> ># Version 1 : 2 October 2002 ># Version 2 : 19 Feburary 2003 > >NICE=10 >MAXDAYS=15 >PORTAGEZIP= >CURPORTAGE= >SYNCPATH="/var/tmp/emerge-webrsync" > >prepSyncPath() >{ > if [ ! -d ${SYNCPATH} ] ; then > echo -n "Creating /var/tmp/emerge-webrsync..." > mkdir -p ${SYNCPATH} > echo -e "\tDone" > fi > > echo -n "Cleaning ${SYNCPATH}..." > rm -rf ${SYNCPATH}/portage* > echo -e "\tDone" >} > >getMirror() >{ > 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"];'`" >} > >findLatestSnapshot() >{ > echo -n "Searching for snapshots..." > > for ((BACKDAYS=0; BACKDAYS<=MAXDAYS; BACKDAYS++)) > do > DATESTR="now -"`expr ${BACKDAYS} \* 24`" hours" > DAY=`date -d "${DATESTR}" +%Y%m%d` > PORTAGEZIP="portage-${DAY}.tar.bz2" > RESULT=`wget --spider ${GENTOO_MIRRORS}/snapshots/${PORTAGEZIP} 2>&1 | grep "^200 OK"` > if [[ ${RESULT} == "200 OK" ]] ; then > break > fi > done > > echo -e "\tDone" > > echo -e "Latest available snapshot is ${DAY} - ${BACKDAYS} day(s) ago." >} > >dlSnapshot() >{ > echo "Downloading portage snapshot..." > > wget "${GENTOO_MIRRORS}/snapshots/${PORTAGEZIP}" > > if [[ $? == 0 ]] ; > then > echo -n "Untarring snapshot..." > nice -n ${NICE} tar xfj ${PORTAGEZIP} > /dev/null 2>&1 > echo -e "\tDone" > > echo -n "Setting ownership..." > chown -R root:root portage > echo -e "\tDone" > > echo "Syncing local tree..." > # Make sure user and group file ownership is root > cd portage > > rsync -av --progress --stats --delete --delete-after \ > --exclude='distfiles/*' --exclude='packages/*' . /usr/portage > cd .. > > echo -n "Adding timestamp..." > echo ${PORTAGEZIP} > ${SYNCPATH}/.timestamp > echo -e "\tDone" > > echo -n "Cleaning up (in the background)..." > rm -f ${PORTAGEZIP} & > rm -rf portage & > echo -e "\tDone" > > else > echo "Couldn't download the tarball! :-(" > fi >} > >main() >{ > prepSyncPath > > cd ${SYNCPATH} > > getMirror > > findLatestSnapshot > > if [[ -f ${SYNCPATH}/.timestamp ]]; then > CURPORTAGE=`cat ${SYNCPATH}/.timestamp` > fi > > if [[ ${CURPORTAGE} != ${PORTAGEZIP} ]]; then > dlSnapshot > else > echo "No new Snapshot available. ( Latest installed version is ${CURPORTAGE} )" > fi > > cd - >} > > >main $@
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15990
:
8539
| 8540