summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2011-01-30 17:48:07 +0100
committerTomas Chvatal <scarabeus@gentoo.org>2011-01-30 17:48:07 +0100
commitdd9b7d6134c0f9bc285e9d0dc625dd7c6346184c (patch)
tree2d00ce8420d257246b97266819e7d6d84ce1ce3b
parentb3a4c757884440d9a199c25206b132bf5feb7e50 (diff)
downloadkde-dd9b7d6134c0f9bc285e9d0dc625dd7c6346184c.tar.gz
kde-dd9b7d6134c0f9bc285e9d0dc625dd7c6346184c.tar.bz2
kde-dd9b7d6134c0f9bc285e9d0dc625dd7c6346184c.zip
[eclasses] Use git-ng and make some git unpacking less magical.
-rw-r--r--eclass/git-ng.eclass18
-rw-r--r--eclass/kde4-base.eclass74
-rw-r--r--eclass/kde4-meta.eclass12
3 files changed, 38 insertions, 66 deletions
diff --git a/eclass/git-ng.eclass b/eclass/git-ng.eclass
index b9f47243092..243e8db006d 100644
--- a/eclass/git-ng.eclass
+++ b/eclass/git-ng.eclass
@@ -96,13 +96,6 @@ git-ng_init_variables() {
esac
fi
- # @ECLASS-VARIABLE: ESCM_PROJECT
- # @DESCRIPTION:
- # Project name, it must be unique across ESCM_STORE_DIR.
- # Git eclass will check out the git repository into ${ESCM_STORE_DIR}/${ESCM_PROJECT}/${ESCM_REPO_URI##*/}
- # Default is ${PN}.
- : ${ESCM_PROJECT:=${PN}}
-
# @ECLASS-VARIABLE: ESCM_OFFLINE
# @DESCRIPTION:
# Set this variable to a non-empty value to disable the automatic updating of
@@ -208,10 +201,9 @@ git-ng_fetch() {
# nicely with sandbox
if [[ ! -d ${ESCM_STORE_DIR} ]] ; then
debug-print "${FUNCNAME}: initial clone. creating git directory"
- addwrite /
+ addwrite ${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
mkdir -p "${ESCM_STORE_DIR}" \
|| die "${ESCM}: can't mkdir ${ESCM_STORE_DIR}."
- export SANDBOX_WRITE="${SANDBOX_WRITE%%:/}"
fi
cd -P "${ESCM_STORE_DIR}" || die "Can't chdir to ${ESCM_STORE_DIR}"
@@ -220,7 +212,7 @@ git-ng_fetch() {
addwrite "${ESCM_STORE_DIR}"
# calculate the proper store dir for data
[[ -z ${ESCM_REPO_URI##*/} ]] && ESCM_REPO_URI="${ESCM_REPO_URI%/}"
- ESCM_CLONE_DIR="${ESCM_PROJECT}/${ESCM_REPO_URI##*/}"
+ ESCM_CLONE_DIR="${ESCM_REPO_URI##*/}"
GIT_DIR="${ESCM_STORE_DIR}/${ESCM_CLONE_DIR}"
debug-print "${FUNCNAME}: Storing the repo into \"${GIT_DIR}\"."
@@ -255,7 +247,7 @@ git-ng_fetch() {
cursha1=$(git rev-parse ${upstream_branch})
${elogcmd} " at the commit: ${cursha1}"
- git_submodules
+ git-ng_submodules
popd &> /dev/null
elif [[ -n ${ESCM_OFFLINE} ]] ; then
pushd "${GIT_DIR}" &> /dev/null
@@ -327,9 +319,9 @@ git-ng_fetch() {
fi
pushd "${SOURCE}" &> /dev/null
- git_branch
+ git-ng_branch
# submodules always reqire net (thanks to branches changing)
- [[ -z ${ESCM_OFFLINE} ]] && git_submodules
+ [[ -z ${ESCM_OFFLINE} ]] && git-ng_submodules
popd &> /dev/null
echo ">>> Unpacked to ${SOURCE}"
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass
index 3af82697fd4..eafbb7f5ac5 100644
--- a/eclass/kde4-base.eclass
+++ b/eclass/kde4-base.eclass
@@ -32,7 +32,7 @@ get_build_type
if [[ ${BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
svn) inherit subversion ;;
- git) inherit git ;;
+ git) inherit git-ng ;;
esac
fi
@@ -213,8 +213,7 @@ esac
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
-# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1...
-# 4.6.0 for 4.4, 4.6.3 for 4.5, and 4.7.0 for 4.6 and later
+# Determine version of qt we enforce as minimal for the package.
if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then
QT_MINIMAL="${QT_MINIMAL:-4.7.0}"
else
@@ -572,28 +571,32 @@ _calculate_live_repo() {
[[ ${KDEBASE} = kde-base || ${KDEBASE} = koffice ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
;;
git)
- # @ECLASS-VARIABLE: EGIT_MIRROR
+ local _kmname
+ # @ECLASS-VARIABLE: ESCM_MIRROR
# @DESCRIPTION:
# This variable allows easy overriding of default kde mirror service
# (anongit) with anything else you might want to use.
- EGIT_MIRROR=${EGIT_MIRROR:=git://anongit.kde.org/}
+ ESCM_MIRROR=${ESCM_MIRROR:=git://anongit.kde.org}
+ # @ECLASS-VARIABLE: ESCM_REPONAME
+ # @DESCRIPTION:
+ # This variable allows overriding of default repository
+ # name. Specify only if this differ from PN and KMNAME.
+ if [[ -n ${ESCM_REPONAME} ]]; then
+ # the repository and kmname different
+ _kmname=${ESCM_REPONAME}
+ elif [[ -n ${KMNAME} ]]; then
+ _kmname=${KMNAME}
+ else
+ _kmname=${PN}
+ fi
+
+ # default branching
case ${PV} in
- 9999*)
- # master
- # @ECLASS-VARIABLE: EGIT_PROJECT_SUFFIX
- # @DESCRIPTION
- # Suffix appended to EGIT_PROJECT depending on fetched branch.
- # Defaults is empty (for -9999 = master), and "-${PV}" otherwise.
- EGIT_PROJECT_SUFFIX=""
- ;;
+ 9999*) ;;
*)
- # branch: prefix empty because we use bare git repo
- EGIT_PROJECT_SUFFIX=""
-
- # set EGIT_BRANCH and EGIT_COMMIT to ${SLOT}
- EGIT_BRANCH="KDE/${SLOT}"
- EGIT_COMMIT="${EGIT_BRANCH}"
+ # set ESCM_BRANCH and ESCM_COMMIT to ${SLOT}
+ ESCM_BRANCH="KDE/${SLOT}"
;;
esac
@@ -603,40 +606,16 @@ _calculate_live_repo() {
kdepim|kdepim-runtime)
case ${PV} in
4.6.9999)
- EGIT_BRANCH="master"
- EGIT_COMMIT="${EGIT_BRANCH}"
+ ESCM_BRANCH="master"
;;
*.9999)
- EGIT_BRANCH="${SLOT}"
- EGIT_COMMIT="${EGIT_BRANCH}"
+ ESCM_BRANCH="${SLOT}"
;;
esac
;;
esac
- if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
- KMMODULE="${PN}"
- fi
- if [[ -n ${KMNAME} ]]; then
- EGIT_PROJECT="${KMNAME}${EGIT_PROJECT_SUFFIX}"
- if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
- KMMODULE="${PN}"
- fi
- fi
- case ${KDEBASE} in
- kdevelop)
- EGIT_REPO_URI="${EGIT_MIRROR}/${KMMODULE}"
- ;;
- *)
- case ${KMNAME} in
- kdepim|kdepim-runtime)
- EGIT_REPO_URI="${EGIT_MIRROR}${KMNAME}"
- ;;
- *)
- EGIT_REPO_URI="${EGIT_MIRROR}/${PN}"
- ;;
- esac
- esac
+ ESCM_REPO_URI="${ESCM_MIRROR}/${_kmname}"
;;
esac
}
@@ -724,7 +703,7 @@ kde4-base_src_unpack() {
subversion_src_unpack
;;
git)
- git_src_unpack
+ git-ng_src_unpack
;;
esac
else
@@ -757,7 +736,6 @@ kde4-base_src_prepare() {
if [[ ${BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
svn) subversion_src_prepare ;;
- git) git_src_prepare ;;
esac
fi
diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass
index e60ab982a27..6267bcd7dfd 100644
--- a/eclass/kde4-meta.eclass
+++ b/eclass/kde4-meta.eclass
@@ -155,9 +155,7 @@ kde4-meta_src_unpack() {
subversion_wc_info
subversion_bootstrap
elif [[ "${KDE_SCM}" == "git" ]]; then
- S="${WORKDIR}/${P}"
- mkdir -p "${S}"
- git_src_unpack
+ git-ng_src_unpack
fi
kde4-meta_src_extract
else
@@ -207,14 +205,18 @@ kde4-meta_src_extract() {
|| die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
done
;;
- *) ;;
+ git)
+ # if we have different ESCM_REPONAME we want not to obey KMNAME KMMODULE, reset them for now
+ KMNAME="${ESCM_REPONAME}"
+ KMMODULE="./"
+ KMNOMODULE="yes"
+ ;;
esac
if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
"${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
fi
-
else
local abort tarball tarfile f extractlist moduleprefix postfix