summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2010-09-03 20:21:00 +0800
committerZhang Le <r0bertz@gentoo.org>2010-09-03 20:21:00 +0800
commit896ac9af5736e51f1672f8e09ce00e5184b9d3eb (patch)
tree3167a651e1bf866fa61915dfce21c2af7fe2dc7c
parentcleaned up xulrunner (diff)
downloadloongson-896ac9af5736e51f1672f8e09ce00e5184b9d3eb.tar.gz
loongson-896ac9af5736e51f1672f8e09ce00e5184b9d3eb.tar.bz2
loongson-896ac9af5736e51f1672f8e09ce00e5184b9d3eb.zip
cvs.eclass: if ECVS_CO_DIR is empty, don't remove it; synced with portage cvs.eclass
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
-rw-r--r--eclass/cvs.eclass36
1 files changed, 26 insertions, 10 deletions
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index 4c8ff31..b6790cf 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.70 2008/04/27 07:00:40 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.74 2010/08/22 20:50:52 vapier Exp $
# @ECLASS: cvs.eclass
# @MAINTAINER:
@@ -35,6 +35,7 @@ inherit eutils
# on the cvs connection. The default of "cvs -q -f -z4" means to be
# quiet, to disregard the ~/.cvsrc config file and to use maximum
# compression.
+[[ -z ${ECVS_CVS_COMMAND} ]] && ECVS_CVS_COMMAND="cvs ${ECVS_CVS_OPTIONS} ${ECVS_CVS_COMPRESS}"
# @ECLASS-VARIABLE: ECVS_CVS_COMPRESS
# @DESCRIPTION:
@@ -46,11 +47,6 @@ inherit eutils
# Additional options to the cvs commands.
[[ -z ${ECVS_CVS_OPTIONS} ]] && ECVS_CVS_OPTIONS="-q -f"
-# @ECLASS-VARIABLE: ECVS_CVS_COMMAND
-# @DESCRIPTION:
-# The cvs command.
-[[ -z ${ECVS_CVS_COMMAND} ]] && ECVS_CVS_COMMAND="cvs ${ECVS_CVS_OPTIONS} ${ECVS_CVS_COMPRESS}"
-
# @ECLASS-VARIABLE: ECVS_UP_OPTS
# @DESCRIPTION:
# CVS options given after the cvs update command. Don't remove "-dP" or things
@@ -62,14 +58,22 @@ inherit eutils
# CVS options given after the cvs checkout command.
[ -z "$ECVS_CO_OPTS" ] && ECVS_CO_OPTS=""
+# @ECLASS-VARIABLE: ECVS_OFFLINE
+# @DESCRIPTION:
+# Set this variable to a non-empty value to disable the automatic updating of
+# a CVS source tree. This is intended to be set outside the cvs source
+# tree by users.
+: ${ECVS_OFFLINE:=${ESCM_OFFLINE}}
# @ECLASS-VARIABLE: ECVS_LOCAL
+# @DEFAULT_UNSET
# @DESCRIPTION:
# If this is set, the CVS module will be fetched non-recursively.
# Refer to the information in the CVS man page regarding the -l
# command option (not the -l global option).
# @ECLASS-VARIABLE: ECVS_LOCALNAME
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Local name of checkout directory
#
@@ -81,7 +85,10 @@ inherit eutils
# some such, things will break because the ebuild won't expect it and
# have e.g. a wrong $S setting.
-# ECVS_CO_DIR -- the name of the directory actually checked out.
+# @ECLASS-VARIABLE: ECVS_CO_DIR
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The name of the directory actually checked out.
#
# This is useful when server doesn't allow -d option of co, e.g. binutils
# After the module is checked out, we will "mv ECVS_CO_DIR ECVS_LOCALNAME"
@@ -105,6 +112,7 @@ inherit eutils
[ -z "$ECVS_SERVER" ] && ECVS_SERVER="offline"
# @ECLASS-VARIABLE: ECVS_MODULE
+# @REQUIRED
# @DESCRIPTION:
# The name of the CVS module to be fetched
#
@@ -114,6 +122,7 @@ inherit eutils
#[ -z "$ECVS_MODULE" ] && die "$ECLASS: error: ECVS_MODULE not set, cannot continue"
# @ECLASS-VARIABLE: ECVS_BRANCH
+# @DEFAULT_UNSET
# @DESCRIPTION:
# The name of the branch/tag to use
#
@@ -150,6 +159,7 @@ inherit eutils
[ -z "$ECVS_PASS" ] && ECVS_PASS=""
# @ECLASS-VARIABLE: ECVS_SSH_HOST_KEY
+# @DEFAULT_UNSET
# @DESCRIPTION:
# If SSH is used for `ext' authentication, use this variable to
# specify the host key of the remote server. The format of the value
@@ -159,11 +169,13 @@ inherit eutils
# remote host key will not be verified.
# @ECLASS-VARIABLE: ECVS_CLEAN
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Set this to get a clean copy when updating (passes the
# -C option to cvs update)
# @ECLASS-VARIABLE: ECVS_RUNAS
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Specifies an alternate (non-root) user to use to run cvs. Currently
# b0rked and wouldn't work with portage userpriv anyway without
@@ -177,7 +189,7 @@ inherit eutils
# add cvs to deps
# ssh is used for ext auth
# sudo is used to run as a specified user
-DEPEND="dev-util/cvs"
+DEPEND="dev-vcs/cvs"
[ -n "$ECVS_RUNAS" ] && DEPEND="$DEPEND app-admin/sudo"
@@ -289,7 +301,7 @@ cvs_fetch() {
# This is required for binutils, if the initial co were interrupted, we need
# to start over again.
- if [ -d "$ECVS_TOP_DIR/$ECVS_CO_DIR" ]; then
+ if [ -n "$ECVS_CO_DIR" ] && [ -d "$ECVS_TOP_DIR/$ECVS_CO_DIR" ]; then
rm -rf "$ECVS_TOP_DIR/$ECVS_CO_DIR"
fi
@@ -529,7 +541,7 @@ cvs_src_unpack() {
local sanitized_pn=$(echo "${PN}" | LC_ALL=C sed -e 's:[^A-Za-z0-9_]:_:g')
local offline_pkg_var="ECVS_OFFLINE_${sanitized_pn}"
- if [ "${!offline_pkg_var}" == "1" -o "$ECVS_OFFLINE" == "1" -o "$ECVS_SERVER" == "offline" ]; then
+ if [[ -n ${!offline_pkg_var}${ECVS_OFFLINE} ]] || [[ "$ECVS_SERVER" == "offline" ]] ; then
# We're not required to fetch anything; the module already
# exists and shouldn't be updated.
if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then
@@ -563,6 +575,10 @@ cvs_src_unpack() {
cp -Rf "$ECVS_TOP_DIR/$ECVS_LOCALNAME" "$WORKDIR/$ECVS_LOCALNAME/.."
fi
+ # Not exactly perfect, but should be pretty close #333773
+ export ECVS_VERSION=$(find "$ECVS_TOP_DIR/$ECVS_LOCALNAME/" -ipath '*/CVS/Entries' -exec cat {} + | sort | sha1sum | awk '{print $1}')
+ export ESCM_VERSION=${ECVS_VERSION}
+
# If the directory is empty, remove it; empty directories cannot
# exist in cvs. This happens when, for example, kde-source
# requests module/doc/subdir which doesn't exist. Still create