Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 210313 Details for
Bug 269491
git.eclass Invent some robust yet fast way to clone from ${DISTDIR} to ${S}
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
diff
git.eclass.patch (text/plain), 3.96 KB, created by
Nikoli
on 2009-11-15 14:12:50 UTC
(
hide
)
Description:
diff
Filename:
MIME Type:
Creator:
Nikoli
Created:
2009-11-15 14:12:50 UTC
Size:
3.96 KB
patch
obsolete
>--- /usr/portage/eclass/git.eclass 2009-10-20 14:36:11.000000000 +0400 >+++ /usr/local/portage/eclass/git.eclass 2009-11-15 16:27:55.000000000 +0300 >@@ -47,12 +47,12 @@ > # @ECLASS-VARIABLE: EGIT_FETCH_CMD > # @DESCRIPTION: > # Command for cloning the repository. >-: ${EGIT_FETCH_CMD:="git clone --bare"} >+: ${EGIT_FETCH_CMD:="git clone"} > > # @ECLASS-VARIABLE: EGIT_UPDATE_CMD > # @DESCRIPTION: > # Git fetch command. >-EGIT_UPDATE_CMD="git fetch -f -u" >+EGIT_UPDATE_CMD="git pull" > > # @ECLASS-VARIABLE: EGIT_DIFFSTAT_CMD > # @DESCRIPTION: >@@ -145,6 +145,14 @@ > # @FUNCTION: git_fetch > # @DESCRIPTION: > # Gets repository from EGIT_REPO_URI and store it in specified EGIT_STORE_DIR >+ >+git_modules() { >+ einfo "git submodule init" >+ git submodule init >+ einfo "git submodule update" >+ git submodule update >+} >+ > git_fetch() { > debug-print-function ${FUNCNAME} "$@" > >@@ -192,32 +200,36 @@ > addwrite "${EGIT_STORE_DIR}" > > [[ -z ${EGIT_REPO_URI##*/} ]] && EGIT_REPO_URI="${EGIT_REPO_URI%/}" >- EGIT_CLONE_DIR="${EGIT_PROJECT}" >+ EGIT_CLONE_DIR="${PN}" > > debug-print "${FUNCNAME}: EGIT_OPTIONS = \"${EGIT_OPTIONS}\"" > >- export GIT_DIR="${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" >- >- # we also have to remove all shallow copied repositories >+ # we also have to remove all shallow and bare copied repositories > # and fetch them again > if [[ -e "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}/shallow" ]]; then > rm -rf "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" > einfo "The ${EGIT_CLONE_DIR} was shallow copy. Refetching." > fi >+ [[ -d "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}/.git" ]]||\ >+ (rm -rf "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" >+ einfo "The ${EGIT_CLONE_DIR} was bare copy or not a git repository. Refetching.") > > if [[ ! -d ${EGIT_CLONE_DIR} ]] ; then > # first clone > ${elogcmd} "GIT NEW clone -->" > ${elogcmd} " repository: ${EGIT_REPO_URI}" >- >- ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_PROJECT} \ >+ einfo "${EGIT_FETCH_CMD} ${EGIT_OPTIONS} ${EGIT_REPO_URI} ${EGIT_CLONE_DIR}" >+ ${EGIT_FETCH_CMD} ${EGIT_OPTIONS} "${EGIT_REPO_URI}" ${EGIT_CLONE_DIR} \ > || die "${EGIT}: can't fetch from ${EGIT_REPO_URI}." > >+ cd ${EGIT_CLONE_DIR} > cursha1=$(git rev-parse ${EGIT_BRANCH}) >+ >+ git_modules >+ > ${elogcmd} " at the commit: ${cursha1}" >- # We use --bare cloning, so git doesn't do this for us. >- git config remote.origin.url "${EGIT_REPO_URI}" > elif [[ -n ${EGIT_OFFLINE} ]] ; then >+ cd ${EGIT_CLONE_DIR} > cursha1=$(git rev-parse ${EGIT_BRANCH}) > ${elogcmd} "GIT offline update -->" > ${elogcmd} " repository: ${EGIT_REPO_URI}" >@@ -230,12 +242,15 @@ > ${elogcmd} "GIT update -->" > ${elogcmd} " repository: ${EGIT_REPO_URI}" > >+ cd ${EGIT_CLONE_DIR} > oldsha1=$(git rev-parse ${EGIT_BRANCH}) > > ${elogcmd} ${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} origin ${EGIT_BRANCH}:${EGIT_BRANCH} > ${EGIT_UPDATE_CMD} ${EGIT_OPTIONS} origin ${EGIT_BRANCH}:${EGIT_BRANCH} \ > || die "${EGIT}: can't update from ${EGIT_REPO_URI}." > >+ git_modules >+ > cursha1=$(git rev-parse ${EGIT_BRANCH}) > > # write out message based on the revisions >@@ -272,27 +287,7 @@ > ${elogcmd} " storage directory: \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\"" > > # unpack to the ${S} >- unset GIT_DIR >- debug-print "git clone -l -s -n \"${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}\" \"${S}\"" >- git clone -l -s -n "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}" "${S}" >- >- # set correct branch and the tree ebuild specified >- pushd "${S}" > /dev/null >- local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH} >- if [[ ${EGIT_TREE} != ${EGIT_BRANCH} ]]; then >- branchname=tree-${EGIT_TREE} >- src=${EGIT_TREE} >- fi >- debug-print "git checkout -b ${branchname} ${src}" >- git checkout -b ${branchname} ${src} 2>&1 > /dev/null >- debug-print "git submodule init" >- git submodule init 2>&1 > /dev/null >- debug-print "git submodule update" >- git submodule update 2>&1 > /dev/null >- popd > /dev/null >- >- unset branchname src >- >+ rsync -rlpgo "${EGIT_STORE_DIR}/${EGIT_CLONE_DIR}/" "${S}/" || die "${ESVN}: can't export to ${S}." > echo ">>> Unpacked to ${S}" > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 269491
:
198718
|
210312
|
210313
|
210322
|
217009