#!/bin/bash # Copyright (c) 2013 The CoreOS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. SCRIPT_ROOT=$(dirname $(readlink -f "$0")) . "${SCRIPT_ROOT}/common.sh" || exit 1 # Default RSYNC options emerge --sync uses RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --timeout=180" DEFINE_string portage "rsync" \ "Path to a local portage tree or 'rsync' or 'cvs' to fetch from remote." DEFINE_string portage_stable "${SRC_ROOT}/third_party/portage-stable" \ "Path to the portage-stable git checkout." DEFINE_string cvsroot ":pserver:anonymous@anoncvs.gentoo.org:/var/cvsroot" \ "CVS location for gentoo-x86 to use with --portage=cvs" DEFINE_string rsync "rsync://rsync.gentoo.org/gentoo-portage" \ "Rsync location for gentoo-portage to use with --portage=rsync" DEFINE_boolean commit ${FLAGS_FALSE} \ "Commit all changes after updating portage-stable." DEFINE_boolean regencache ${FLAGS_TRUE} \ "Regenerate cache for updated ebuilds." # Parse flags FLAGS "$@" || exit 1 eval set -- "${FLAGS_ARGV}" switch_to_strict_mode # Accept arguments from STDIN for batch processing if [[ -z "$*" ]]; then set -- $( profiles/repo_name fi git add -A "$pkg" # Sync up the ebuild metadata cache if [[ $FLAGS_regencache -eq $FLAGS_TRUE && "$pkg" == */* ]]; then egencache --repo=portage-stable --update "$pkg" git add -A "metadata/md5-cache/${pkg}-*" fi done if [[ $FLAGS_commit -eq $FLAGS_TRUE ]]; then if [[ $# -eq 1 ]]; then git commit -e -m "bump($1): sync with upstream" else cat > .git/COMMIT_EDITMSG <