The sync-repositories utility, usually located at /usr/bin/sync-repositories, is used to synchronise the "live", testing and stable repositories on the build-server.
The sync-repositories utility uses the same configuration file as all the other applications in the buildserver-scripts package which is usually located at /etc/buildspaces on a standard installation. The sections relevant to the sync-repositories utility are highlighted in the example below.
# Path to the directory containing the build-spaces
BUILDSPACEROOT="/mnt/buildspaces"
# List of build-spaces on the same architecture as the host
BUILDSPACESXX="x86-64bit-server x86-64bit-workstation"
# List of build-spaces requiring linux32 to be executed prior to chroot
BUILDSPACES32="x86-32bit-server x86-32bit-workstation"
# Path to the directory containing the repositories
REPOSROOT="/mnt/repositories"
# Gentoo rsync location and options
GENTOORSYNC="rsync.gentoo.org::gentoo-portage"
GENTOORSOPT="--archive --delete --quiet --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
# Should we run layman --sync-all when synchronising the live repository
AUTOLAYMANSYNC="no"
# Should we run auto-patch --sync when synchronising the live repository
# and if so which options we should pass
AUTOPATCHSYNC="no"
AUTOPATCHSYNCOPTS="--quiet --sync"
# Repository rsync options
REPORSOPT="--quiet --archive --no-D --delete-during"
# Should we run auto-patch when synchronising a testing repository
# and if so which options we should pass
AUTOPATCHTEST="no"
AUTOPATCHTESTOPTS="--quiet --copy-files --apply-patches"
# Should we run rebuild-portage-caches inside the build-space when
# synchronising a testing repository.
AUTOREBUILD="yes"
The sync-repositories utility can be used to synchronise the "live", testing or stable repositories. The example below demonstrates synchronising the "live" repository.
Synchronising the "live" portage tree...ok.
Synchronising the layman overlays...ok.
Synchronising the auto-patch patch-sets...ok.
Multiple actions can be combined in a single command. The example below demonstrates synchronising the "live" repository and then the testing repository for a single build-space.
Synchronising the "live" portage tree...ok.
Synchronising the layman overlays...ok.
Synchronising the auto-patch patch-sets...ok.
Synchronising the "live" portage tree to the x86-64bit-server testing repository...ok.
Synchronising the "live" patch-sets to the x86-64bit-server testing repository...ok.
Synchronising the "live" overlays to the x86-64bit-server testing repository...ok.
Running auto-patch-portage on the x86-64bit-server testing repository...ok.
Running rebuild-portage-caches in the x86-64bit-server build-space...ok.
Whenever a build-space name is expected, as in the above example, the special name all can be used instead to operate on all build-spaces. The example below synchronises all the testing repositories to their respective stable repositories.
Synchronising the testing configurations to the x86-64bit-server stable repository...ok.
Synchronising the testing portage tree to the x86-64bit-server stable repository...ok.
Synchronising the testing patch-sets to the x86-64bit-server stable repository...ok.
Synchronising the testing overlays to the x86-64bit-server stable repository...ok.
Synchronising the testing packages to the x86-64bit-server stable repository...ok.
Synchronising the testing kernels to the x86-64bit-server stable repository...ok.
Synchronising the testing configurations to the x86-64bit-workstation stable repository...ok.
Synchronising the testing portage tree to the x86-64bit-workstation stable repository...ok.
Synchronising the testing patch-sets to the x86-64bit-workstation stable repository...ok.
Synchronising the testing overlays to the x86-64bit-workstation stable repository...ok.
Synchronising the testing packages to the x86-64bit-workstation stable repository...ok.
Synchronising the testing kernels to the x86-64bit-workstation stable repository...ok.
Synchronising the testing configurations to the x86-32bit-server stable repository...ok.
Synchronising the testing portage tree to the x86-32bit-server stable repository...ok.
Synchronising the testing patch-sets to the x86-32bit-server stable repository...ok.
Synchronising the testing overlays to the x86-32bit-server stable repository...ok.
Synchronising the testing packages to the x86-32bit-server stable repository...ok.
Synchronising the testing kernels to the x86-32bit-server stable repository...ok.
The x86-32bit-workstation build-space has not been updated since the last --sync-test and --force not specified, skipping.
As you can see from the output of the above example the sync-repositories utility will not synchronise a testing repository to a stable repository until the relevant build-space has successfully produced a complete set of binary packages. If you wish to override this sanity check then the --force or -f option can be used as shown below.
Synchronising the testing configurations to the x86-32bit-workstation stable repository...ok.
Synchronising the testing portage tree to the x86-32bit-workstation stable repository...ok.
Synchronising the testing patch-sets to the x86-32bit-workstation stable repository...ok.
Synchronising the testing overlays to the x86-32bit-workstation stable repository...ok.
Synchronising the testing packages to the x86-32bit-workstation stable repository...ok.
Synchronising the testing kernels to the x86-32bit-workstation stable repository...ok.