From: "Dennis Schridde" <devurandom@gmx.net>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/kde:master commit in: Documentation/maintainers/
Date: Tue, 10 Apr 2012 12:59:51 +0000 (UTC) [thread overview]
Message-ID: <1334062777.8a3b621be420a888eb33355482aa54ab6088d504.devurandom@gentoo> (raw)
commit: 8a3b621be420a888eb33355482aa54ab6088d504
Author: Dennis Schridde <devurandom <AT> gmx <DOT> net>
AuthorDate: Tue Apr 10 12:56:36 2012 +0000
Commit: Dennis Schridde <devurandom <AT> gmx <DOT> net>
CommitDate: Tue Apr 10 12:59:37 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=8a3b621b
[Documentation/maintainers/sync-gentoo-overlay.sh] Bump to a new version
* Be much more automatic (i.e. user friendly)
* Use atomic moves to ensure the rsync dir does not change during a sync
* Ensure the rsync dir does not contain .svn folders and the like
---
Documentation/maintainers/sync-gentoo-overlay.sh | 116 +++++++++++++++++-----
1 files changed, 90 insertions(+), 26 deletions(-)
diff --git a/Documentation/maintainers/sync-gentoo-overlay.sh b/Documentation/maintainers/sync-gentoo-overlay.sh
index ea28c8e..3172dfa 100755
--- a/Documentation/maintainers/sync-gentoo-overlay.sh
+++ b/Documentation/maintainers/sync-gentoo-overlay.sh
@@ -2,20 +2,31 @@
# Run this script via cronjob to update your overlay mirror
-OVERLAY_MIRROR_DIR=/var/gentoo/overlays
+GENTOO_MIRROR_DIR=/var/gentoo
+GENTOO_PORTAGE_DIR=/var/gentoo/portage
-# OVERLAY_MIRROR_DIR must contain:
-# * a folder $overlay/ for each overlay you intent to mirror.
-# * a folder cache/ to store the cache of all overlays.
+# GENTOO_MIRROR_DIR must contain:
+# * a directory overlay-repos/$overlay for each overlay you intend to mirror:
+# It shall contain the checked out overlay repository.
+# Git repositories must be named "overlay-repos/${overlay}.git".
+# SVN repositories must contain a directory "overlay-repos/${overlay}/.svn".
+# Directories and files within OVERLAY_MIRROR_DIR that will be created by this script:
+# * overlays/$overlay/ contains the overlays suitable to sync with rsync.
+# * overlay-etc/$overlay/ contains a portage config necessary to generate the caches.
+# * cache/ to store the intermediate cache of all overlays.
# (so it is not mixed with the cache of your system portage-trees)
-# OVERLAY_MIRROR_DIR/$overlay/ must contain:
-# * a file etc/make.conf with following contents:
-# PORTDIR=/your/portage/directory
-# PORTDIR_OVERLAY=/path/to/your/mirror/dir/$overlay/repo
-# FEATURES="${FEATURES} userpriv userfetch usersandbox usersync metadata-transfer"
-# * a directory repo/ containing the checked out overlay repository
-# For speed reasons it is advisable to have a file etc/portage/modules containing:
-# portdbapi.auxdbmodule = portage.cache.sqlite.database
+# * etc/portage/ containing following files:
+# * etc/portage/make.conf:
+# PORTDIR=/your/portage/directory
+# FEATURES="${FEATURES} userpriv userfetch usersandbox usersync metadata-transfer"
+# NOCOLOR=true
+# * etc/portage/modules:
+# portdbapi.auxdbmodule = portage.cache.sqlite.database
+# (for speed reasons)
+# (files in this directory are not changed if they exist)
+
+PORTAGE_CONFIGROOT="${GENTOO_MIRROR_DIR}"
+PORTAGE_DEPCACHEDIR="${GENTOO_MIRROR_DIR}/cache"
die() {
echo "USAGE: $0 <overlay>" 1>&2
@@ -26,36 +37,84 @@ die() {
[[ "$1" ]] || die 'overlay'
overlay="$1" ; shift
-overlay_name="$(< $OVERLAY_MIRROR_DIR/$overlay/repo/profiles/repo_name)"
-[[ "$overlay_name" ]] || die 'overlay_name'
+overlay_dir="${GENTOO_MIRROR_DIR}/overlays/${overlay}"
+overlay_repo_dir="${GENTOO_MIRROR_DIR}/overlay-repos/${overlay}"
-if [ -e "$OVERLAY_MIRROR_DIR/$overlay/repo/.svn" ] ; then
+if [ -e "${overlay_repo_dir}/.svn" ] ; then
type=svn
-elif [ -e "$OVERLAY_MIRROR_DIR/$overlay/repo/.git" ] ; then
+elif [ -e "${overlay_repo_dir}.git" ] ; then
type=git
+ overlay_repo_dir="${overlay_repo_dir}.git"
else
die "Unable to determine overlay type for $overlay"
fi
-cd $OVERLAY_MIRROR_DIR/$overlay/repo || cd "failed to cd to $OVERLAY_MIRROR_DIR/$overlay/repo"
-
echo 'Updating overlay ...'
case "$type" in
svn)
- [ -e metadata/layout.conf ] && svn revert metadata/layout.conf
- svn cleanup || die 'svn cleanup failed'
- svn update --force --config-option=config:miscellany:use-commit-times=yes || die 'svn update failed'
+ svn cleanup "${overlay_repo_dir}" || die 'svn cleanup failed'
+ svn update --force "${overlay_repo_dir}" || die 'svn update failed'
+ ;;
+ git)
+ git --git-dir="${overlay_repo_dir}" fetch || die 'git update failed'
+ ;;
+ *)
+ die "Unsupported overlay type '$type' for $overlay"
+ ;;
+esac
+
+mkdir -p "${GENTOO_MIRROR_DIR}/overlays" || die 'failed to create overlays/ dir'
+mkdir -p "${GENTOO_MIRROR_DIR}/etc/portage/" || die 'failed to create etc/portage/ dir'
+
+if [ -! -e "${GENTOO_MIRROR_DIR}/etc/portage/make.conf" ] ; then
+ cat <<- EOF > "${GENTOO_MIRROR_DIR}/etc/portage/make.conf"
+ PORTDIR=${GENTOO_PORTAGE_DIR}
+ FEATURES="\${FEATURES} userpriv userfetch usersandbox usersync metadata-transfer"
+ NOCOLOR=true
+ EOF
+fi
+if [ -! -e "${GENTOO_MIRROR_DIR}/etc/portage/modules" ] ; then
+ cat <<- EOF > "${GENTOO_MIRROR_DIR}/etc/portage/modules"
+ portdbapi.auxdbmodule = portage.cache.sqlite.database
+ EOF
+fi
+
+if [ -e "${overlay_dir}.tmp" ] ; then
+ echo 'Removing old export ...'
+ rm -fr "${overlay_dir}.tmp"
+fi
+
+echo 'Exporting overlay ...'
+case "$type" in
+ svn)
+ svn export --force --config-option=config:miscellany:use-commit-times=yes "${overlay_repo_dir}" "${overlay_dir}.tmp" || die 'svn export failed'
;;
git)
- [ -e metadata/layout.conf ] && git checkout metadata/layout.conf
- git pull || die 'git update failed'
- /usr/local/bin/git-set-file-times || die 'setting file times failed'
+ mkdir -p "${overlay_dir}.tmp" || die 'creating export dir failed'
+ git --git-dir="${overlay_repo_dir}" archive master | tar -x -C "${overlay_dir}.tmp" || die 'git export failed'
;;
*)
die "Unsupported overlay type '$type' for $overlay"
+ ;;
esac
-export PORTAGE_CONFIGROOT=$OVERLAY_MIRROR_DIR/$overlay PORTAGE_DEPCACHEDIR=$OVERLAY_MIRROR_DIR/cache
+cd "${overlay_dir}.tmp" || die "failed to cd to ${overlay_dir}.tmp"
+
+overlay_name="$(< profiles/repo_name)"
+[[ "$overlay_name" ]] || die 'overlay_name'
+
+overlay_configroot="${GENTOO_MIRROR_DIR}/overlay-etc/${overlay}"
+mkdir -p "${overlay_configroot}/etc/portage" || die 'creating overlay configroot failed'
+cat <<- EOF > "${overlay_configroot}/etc/portage/make.conf" || die 'creating overlay make.conf failed'
+ source ${PORTAGE_CONFIGROOT}/etc/portage/make.conf
+ PORTDIR_OVERLAY=${overlay_dir}.tmp
+EOF
+ln -sfn "${PORTAGE_CONFIGROOT}/etc/portage/modules" "${overlay_configroot}/etc/portage/" || die 'creating overlay modules symlink failed'
+
+PORTAGE_CONFIGROOT="${overlay_configroot}"
+PORTDIR_OVERLAY="${overlay_dir}.tmp"
+
+export PORTAGE_CONFIGROOT PORTAGE_DEPCACHEDIR PORTDIR_OVERLAY
echo 'Enforcing full manifests ...'
#sed -e 's/^thin-manifests.*/thin-manifests = false/' -i metadata/layout.conf || die 'patching layout.conf failed'
@@ -64,4 +123,9 @@ echo 'Generating manifests ...'
#repoman manifest || die 'generating manifests failed'
echo 'Generating metadata caches ...'
-egencache --config-root=$PORTAGE_CONFIGROOT --cache-dir=$PORTAGE_DEPCACHEDIR --repo=$overlay_name --update
+egencache --config-root="${PORTAGE_CONFIGROOT}" --cache-dir="${PORTAGE_DEPCACHEDIR}" --portdir-overlay="${PORTDIR_OVERLAY}" --repo=$overlay_name --update || die 'generating metadata caches failed'
+
+echo 'Moving export into place ...'
+mv -T "${overlay_dir}" "${overlay_dir}.old"
+mv -T "${overlay_dir}.tmp" "${overlay_dir}" || die 'moving export failed'
+rm -fr "${overlay_dir}.old"
next reply other threads:[~2012-04-10 13:00 UTC|newest]
Thread overview: 118+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-10 12:59 Dennis Schridde [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-02-18 21:05 [gentoo-commits] proj/kde:master commit in: Documentation/maintainers/ Andreas Sturmlechner
2024-10-04 22:21 Andreas Sturmlechner
2024-10-04 22:21 Andreas Sturmlechner
2024-10-01 18:09 Andreas Sturmlechner
2024-10-01 18:09 Andreas Sturmlechner
2024-09-07 12:00 Andreas Sturmlechner
2024-09-07 9:59 Andreas Sturmlechner
2024-09-02 9:31 Andreas Sturmlechner
2024-08-23 19:25 Andreas Sturmlechner
2024-02-24 2:30 Maciej Mrozowski
2024-01-13 16:39 Sam James
2024-01-07 19:10 Andreas Sturmlechner
2024-01-07 17:13 Andreas Sturmlechner
2023-12-16 22:02 Andreas Sturmlechner
2023-11-25 23:25 Andreas Sturmlechner
2023-07-24 13:32 Andreas Sturmlechner
2023-05-25 20:36 Andreas Sturmlechner
2023-05-25 20:36 Andreas Sturmlechner
2023-03-23 22:10 Andreas Sturmlechner
2023-02-07 10:45 Andreas Sturmlechner
2022-12-11 21:24 Andreas Sturmlechner
2022-12-11 17:24 Andreas Sturmlechner
2022-12-05 18:33 Andreas Sturmlechner
2022-11-08 19:27 Andreas Sturmlechner
2022-10-16 11:03 Andreas Sturmlechner
2022-10-03 8:51 Andreas Sturmlechner
2022-07-19 14:24 Andreas Sturmlechner
2022-05-03 22:31 Sam James
2021-08-11 6:10 Andreas Sturmlechner
2021-06-14 8:24 Andreas Sturmlechner
2021-01-24 19:57 Andreas Sturmlechner
2021-01-11 12:38 Andreas Sturmlechner
2020-11-25 18:25 Andreas Sturmlechner
2020-10-09 13:51 Andreas Sturmlechner
2020-06-22 19:53 Andreas Sturmlechner
2020-06-22 19:53 Andreas Sturmlechner
2020-06-22 18:21 Andreas Sturmlechner
2020-06-22 18:21 Andreas Sturmlechner
2020-06-01 10:03 Andreas Sturmlechner
2020-03-19 0:54 Andreas Sturmlechner
2020-03-15 22:27 Andreas Sturmlechner
2020-03-01 12:33 Andreas Sturmlechner
2019-12-23 20:52 Andreas Sturmlechner
2019-12-08 8:56 Andreas Sturmlechner
2018-10-18 21:00 Andreas Sturmlechner
2018-02-22 19:14 Andreas Sturmlechner
2018-02-06 10:15 Andreas Sturmlechner
2017-12-28 13:43 Michael Palimaka
2017-12-28 13:43 Michael Palimaka
2017-12-26 3:27 Michael Palimaka
2017-08-14 18:55 Andreas Sturmlechner
2017-06-14 19:37 Johannes Huber
2017-05-24 20:37 Andreas Sturmlechner
2016-12-04 20:31 Johannes Huber
2016-11-13 17:51 Michael Palimaka
2016-07-31 19:48 Michael Palimaka
2016-07-23 12:03 Johannes Huber
2016-07-13 6:16 Johannes Huber
2016-06-30 20:39 Johannes Huber
2016-06-30 20:39 Johannes Huber
2016-06-30 20:39 Johannes Huber
2016-06-30 20:39 Johannes Huber
2016-06-30 20:39 Johannes Huber
2016-06-06 21:47 Johannes Huber
2016-04-24 12:47 Johannes Huber
2016-04-20 14:48 Michael Palimaka
2016-03-08 16:01 Johannes Huber
2015-08-09 9:00 Johannes Huber
2015-08-09 8:40 Johannes Huber
2015-06-08 10:21 Manuel Rüger
2015-06-08 10:21 Manuel Rüger
2015-06-08 10:14 Manuel Rüger
2015-04-05 19:41 Michael Palimaka
2015-04-05 19:39 Michael Palimaka
2015-04-05 19:04 Michael Palimaka
2015-04-05 18:33 Michael Palimaka
2014-12-14 15:21 Michael Palimaka
2014-11-07 11:23 Manuel Rüger
2014-09-26 17:25 Michael Palimaka
2014-09-26 16:59 Michael Palimaka
2014-09-26 16:03 Michael Palimaka
2014-09-17 16:36 Michael Palimaka
2014-08-24 9:48 Michael Palimaka
2014-08-24 9:48 Michael Palimaka
2014-08-24 8:46 Michael Palimaka
2014-08-12 11:05 Michael Palimaka
2014-07-22 17:52 Michael Palimaka
2014-05-09 17:27 Michael Palimaka
2014-02-12 14:18 Michael Palimaka
2014-02-06 23:26 Andreas Hüttel
2014-01-18 4:34 Robin H. Johnson
2014-01-06 1:25 Chris Reffett
2014-01-06 1:25 Chris Reffett
2013-12-03 23:09 Johannes Huber
2013-11-23 2:05 Maciej Mrozowski
2013-10-09 3:51 Chris Reffett
2013-06-25 16:39 Marc Schiffbauer
2013-04-15 9:50 Michael Palimaka
2012-12-19 22:13 Marc Schiffbauer
2012-11-16 16:54 Alexey Shvetsov
2012-09-11 20:21 Michael Palimaka
2012-08-07 13:20 Johannes Huber
2012-08-02 10:24 Johannes Huber
2012-06-21 22:01 Andreas Hüttel
2012-06-02 22:10 Andreas Hüttel
2012-06-02 22:10 Andreas Hüttel
2012-03-25 13:12 Dennis Schridde
2012-01-20 13:24 Johannes Huber
2011-12-09 14:29 Johannes Huber
2011-11-19 23:29 Alexey Shvetsov
2011-11-02 22:30 Alexey Shvetsov
2011-06-06 9:29 Jorge Manuel B. S. Vicetto
2011-04-28 8:14 Andreas K. Huettel
2011-04-27 18:09 Maciej Mrozowski
2011-04-27 15:48 Andreas K. Huettel
2011-03-05 19:58 Jonathan Callen
2011-02-13 17:32 Dennis Schridde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1334062777.8a3b621be420a888eb33355482aa54ab6088d504.devurandom@gentoo \
--to=devurandom@gmx.net \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox