FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 12-15-2009, 08:39 AM
Ulrich Mueller
 
Default changes to bzr.eclass

Hi,

bzr.eclass currently uses "bzr export" for copying from
${DISTDIR}/bzr-src to ${WORKDIR} in src_unpack. Unfortunately,
"bzr export" accesses the remote repository for lightweight checkouts
(which are the eclass's default), so it cannot be used off-line.

Besides, it is very slow: In my test (GNU Emacs BZR repo, 2 Mbit/s
connection) bzr export took 54 minutes, whereas the initial checkout
took only 11 minutes.

The patch included below fixes this problem by using "rsync" instead
of "bzr export" in most cases. Additionally, a problem with updating
of non-lightweight checkouts is fixed, and restoring of the
SANDBOX_WRITE variable is made more robust.

Please review.

Ulrich


--- bzr.eclass 9 Dec 2009 10:04:16 -0000 1.6
+++ bzr.eclass 14 Dec 2009 20:54:27 -0000
@@ -189,10 +189,11 @@

if [[ ! -d ${EBZR_STORE_DIR} ]] ; then
debug-print "${FUNCNAME}: initial branch. Creating bzr directory"
+ local save_sandbox_write=${SANDBOX_WRITE}
addwrite /
mkdir -p "${EBZR_STORE_DIR}"
|| die "${EBZR}: can't mkdir ${EBZR_STORE_DIR}."
- export SANDBOX_WRITE="${SANDBOX_WRITE%%:/}"
+ SANDBOX_WRITE=${save_sandbox_write}
fi

pushd "${EBZR_STORE_DIR}" > /dev/null || die "${EBZR}: can't chdir to ${EBZR_STORE_DIR}"
@@ -209,7 +210,8 @@
# an older version of bzr.eclass)
if [[ ! -d ${EBZR_BRANCH_DIR} ]] ; then
bzr_initial_fetch "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}"
- elif [[ -d "${EBZR_BRANCH_DIR}"/.bzr/repository/ ]]; then
+ elif [[ ${EBZR_FETCH_CMD} == *lightweight*
+ && -d ${EBZR_BRANCH_DIR}/.bzr/repository ]]; then
einfo "Re-fetching the branch to save space..."
rm -rf "${EBZR_BRANCH_DIR}"
bzr_initial_fetch "${EBZR_REPO_URI}" "${EBZR_BRANCH_DIR}"
@@ -220,18 +222,18 @@
cd "${EBZR_BRANCH_DIR}"

einfo "exporting ..."
- ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} "${WORKDIR}/${P}"
- || die "${EBZR}: export failed"

- local revision
- if [[ -n "${EBZR_REVISION}" ]]; then
- revision="${EBZR_REVISION}"
- else
- revision=$(${EBZR_REVNO_CMD} "${EBZR_BRANCH_DIR}")
+ if [[ -z ${EBZR_REVISION} ]]; then
+ rsync -rlpgo --exclude=".bzr/" . "${WORKDIR}/${P}"
+ || die "${EBZR}: export failed"
+ else
+ # revisions of a lightweight checkout are only available when online
+ [[ -z ${EBZR_OFFLINE} || -d ${EBZR_BRANCH_DIR}/.bzr/repository ]]
+ || die "${EBZR}: No support for revisions when off-line"
+ ${EBZR_EXPORT_CMD} -r "${EBZR_REVISION}" "${WORKDIR}/${P}"
+ || die "${EBZR}: export failed"
fi

- einfo "Revision ${revision} is now in ${WORKDIR}/${P}"
-
popd > /dev/null
}
 
Old 12-15-2009, 04:52 PM
Peter Volkov
 
Default changes to bzr.eclass

В Втр, 15/12/2009 в 10:39 +0100, Ulrich Mueller пишет:
> bzr.eclass currently uses "bzr export" for copying from
> ${DISTDIR}/bzr-src to ${WORKDIR} in src_unpack. Unfortunately,
> "bzr export" accesses the remote repository for lightweight checkouts
> (which are the eclass's default), so it cannot be used off-line.

After you wrote this I've pinged upstream. Could you try attached patch
(suggested in https://bugs.launchpad.net/bugs/343218 ) and tell us here
or in upstream bug if this fixes the problem? I'm not against eclass
modifications but fixing bzr looks like a better long-term approach.

--
Peter.
 
Old 12-15-2009, 07:32 PM
Ulrich Mueller
 
Default changes to bzr.eclass

>>>>> On Tue, 15 Dec 2009, Peter Volkov wrote:

> After you wrote this I've pinged upstream. Could you try attached
> patch (suggested in https://bugs.launchpad.net/bugs/343218 ) and
> tell us here or in upstream bug if this fixes the problem?

I've answered in the upstream bug tracker.

Basically, it still re-fetches everything from the remote repo when
exporting, which I think is not acceptable in the context of a live
ebuild. It is much slower, and it puts unnecessary load on the
upstream servers.

Ulrich
 
Old 12-18-2009, 06:14 AM
Ulrich Mueller
 
Default changes to bzr.eclass

>>>>> On Tue, 15 Dec 2009, Ulrich Mueller wrote:

> The patch included below fixes this problem by using "rsync" instead
> of "bzr export" in most cases. Additionally, a problem with updating
> of non-lightweight checkouts is fixed, and restoring of the
> SANDBOX_WRITE variable is made more robust.

Committed (with some cosmetic fixes in comments and whitespace).
Thanks to everyone who answered.

Ulrich
 

Thread Tools




All times are GMT. The time now is 09:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org