From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PnpOo-00016l-Ix for garchives@archives.gentoo.org; Fri, 11 Feb 2011 09:34:46 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2BA1AE0A5D; Fri, 11 Feb 2011 09:34:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id EC95CE0A5D for ; Fri, 11 Feb 2011 09:34:39 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4CFC01B417E for ; Fri, 11 Feb 2011 09:34:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A46DC8006A for ; Fri, 11 Feb 2011 09:34:38 +0000 (UTC) From: "Dennis Schridde" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Dennis Schridde" Message-ID: Subject: [gentoo-commits] proj/kde:master commit in: Documentation/ X-VCS-Repository: proj/kde X-VCS-Files: Documentation/metadata-mirror-update.sh X-VCS-Directories: Documentation/ X-VCS-Committer: devurandom X-VCS-Committer-Name: Dennis Schridde X-VCS-Revision: b9e5a05733bc2d085a1719a7831569582237ea8f Date: Fri, 11 Feb 2011 09:34:38 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 2b46d6fd136bd0a30fb6693e1ecbfd9f commit: b9e5a05733bc2d085a1719a7831569582237ea8f Author: Dennis Schridde gmx net> AuthorDate: Fri Feb 11 08:23:23 2011 +0000 Commit: Dennis Schridde gmx net> CommitDate: Fri Feb 11 09:34:31 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/kde.git;a=3Dc= ommit;h=3Db9e5a057 [Documentation/metadata-mirror-update.sh] More sophisticated version of t= he script, preserves filetimes for git+svn --- Documentation/metadata-mirror-update.sh | 39 +++++++++++++++++++++++--= ------ 1 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Documentation/metadata-mirror-update.sh b/Documentation/meta= data-mirror-update.sh old mode 100644 new mode 100755 index 6ae9e1b..74f83e3 --- a/Documentation/metadata-mirror-update.sh +++ b/Documentation/metadata-mirror-update.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash =20 # Run this script via cronjob to update your metadata mirror =20 @@ -18,19 +18,38 @@ METADATA_MIRROR_DIR=3D/path/to/your/mirror/dir # portdbapi.auxdbmodule =3D portage.cache.sqlite.database =20 die() { - echo "Usage: $0 " 1>&2 - echo "ERROR: $@" 1>&2 - exit 255 + echo "USAGE: $0 " 1>&2 + echo "ERROR: $@" 1>&2 + exit 255 } =20 [[ "$1" ]] || die 'overlay' overlay=3D"$1" ; shift =20 -case $overlay in - kde) update=3D"cd $METADATA_MIRROR_DIR/kde/repo/ && git pull" ;; - *) die "unknown overlay: $overlay" ;; +if [ -e "$METADATA_MIRROR_DIR/$overlay/repo/.svn" ] ; then + type=3Dsvn +elif [ -e "$METADATA_MIRROR_DIR/$overlay/repo/.git" ] ; then + type=3Dgit +else + die "Unable to determine overlay type for $overlay" +fi + +cd $METADATA_MIRROR_DIR/$overlay/repo || cd "failed to cd to $METADATA_M= IRROR_DIR/$overlay/repo" + +case "$type" in + svn) + if ! grep "^use-commit-times =3D yes" $HOME/.subversion/config ; then + mkdir -p $HOME/.subversion + echo -e "[miscellany]\nuse-commit-times =3D yes" >> $HOME/.subversion= /config || die 'enabling file time preservation failed' + fi + svn cleanup && svn update --force || die 'svn update failed' + ;; + git) + git pull || die 'git update failed' + /usr/local/bin/git-set-file-times || die 'setting file times failed' + ;; + *) + die "Unsupported overlay type '$type' for $overlay" esac =20 -if $update || die 'update failed' ; then - exec egencache --config-root=3D$METADATA_MIRROR_DIR/$overlay/ --cache-d= ir=3D$METADATA_MIRROR_DIR/cache/ --repo=3D$overlay --update -fi +exec egencache --config-root=3D$METADATA_MIRROR_DIR/$overlay/ --cache-di= r=3D$METADATA_MIRROR_DIR/cache/ --repo=3D$overlay --update