Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 194676 - subversion.eclass should try harder when ESVN_REPO_URI changes
Summary: subversion.eclass should try harder when ESVN_REPO_URI changes
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Akinori Hattori
URL:
Whiteboard:
Keywords:
: 188081 200052 269771 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-04 05:03 UTC by Charles Duffy
Modified: 2010-04-10 09:57 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch implementing previously-discussed logic (subversion_eclass_wc_relocation_support.diff,3.60 KB, patch)
2007-11-25 18:12 UTC, Charles Duffy
Details | Diff
Patch implementing previously-discussed logic, revised (subversion_eclass_wc_relocation_support-r2.diff,3.66 KB, patch)
2008-01-15 18:01 UTC, Charles Duffy
Details | Diff
simpler: just add relocate option, maybe as first step to committing the previously attached patch (subversion-eclass-add-repository-relocation-support.patch,1.19 KB, patch)
2009-09-17 10:30 UTC, Marcel Partap
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Duffy 2007-10-04 05:03:01 UTC
I'm trying to use subversion.eclass in a context where unconditionally failing out when ESVN_REPO_URI changes is problematic. Something akin to the following logic might be more appropriate:

 - After a checkout or successful update, retrieve and store the repository root and UUID.
 - When attempting to do an update and the repository URI is different...
    - If the UUID has changed, delete the tree and do a new checkout.
    - If the UUID has not changed but the repository root has changed, do a "svn switch --relocate ${OLD_REPOSITORY_ROOT} ${NEW_REPOSITORY_ROOT}".
    - If the UUID has not changed and the repository root has not changed (or the repository root has changed and a switch --relocate to update the base URIs has not completely resolved the issue), do a "svn switch ${ESVN_REPO_URI}".

Does this logic make sense? If so, would you accept a patch implementing it, were I to develop one, or would you prefer to write such a patch yourself? (I'm moderately handy with shell, but not familiar with the conventions associated with building an eclass).

Thank you!
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-10-04 07:31:21 UTC
Just attach the patch if you have one. :)
Comment 2 Charles Duffy 2007-10-04 08:03:33 UTC
I don't have a patch yet -- trying to determine if I need to make the effort, at this point. I'm inexperienced enough with building code for use in eclasses that someone more experienced could get a better job done faster (I don't know the local conventions for finding an appropriate place to store state, for instance) -- but if me doing it is the way it'll get done, me doing it it'll be.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-11-23 08:35:21 UTC
*** Bug 200052 has been marked as a duplicate of this bug. ***
Comment 4 Charles Duffy 2007-11-25 18:12:51 UTC
Created attachment 136995 [details, diff]
Patch implementing previously-discussed logic

All use cases excepting the fall-through failure case (where URIs don't match even after relocation efforts) have been tested.
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2008-01-14 11:57:49 UTC
[a-z][A-Z] sucks, locale-specific thing. You should use tr '[:lower:]' '[:upper:]' instead...
Comment 6 Charles Duffy 2008-01-15 18:01:13 UTC
Created attachment 140996 [details, diff]
Patch implementing previously-discussed logic, revised

Changed tr usage, not only in subversion__to_varname, but also in subversion__to_upper_case() [a previously-existing function from which it was derived].
Comment 7 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2008-01-20 18:14:24 UTC
(In reply to comment #5)
> [a-z][A-Z] sucks, locale-specific thing. You should use tr '[:lower:]'
> '[:upper:]' instead...

It won't work for tr_TR.
http://en.wikipedia.org/wiki/Turkish_dotted_and_dotless_I

$ LC_ALL="tr_TR.UTF-8"
$ [[ "REVISION" == "$(echo revision | tr [:lower:] [:upper:])" ]] && echo TRUE
$ 
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2008-01-27 16:54:40 UTC
*** Bug 188081 has been marked as a duplicate of this bug. ***
Comment 9 michael@smith-li.com 2008-02-15 01:33:27 UTC
The only thing I don't like about the patch is that it totally nukes the previous checkout. It should probably move it.

I think a better solution altogether is to somehow incorporate the ESVN_WC_URL (or a hash, as you like) into the local WC, so like 0.20.2_p15634 might checkout to "${DISTDIR}/svn-src/mythtv/release-0-20-fixes/mythtv"

and 0.21_pre15718 would checkout to

"${DISTDIR}/svn-src/mythtv/trunk/mythtv"

That would allow us to program the eclass to dynamically choose the appropriate name for whatever path comes out of the svn info URL variable.

That way it could never be a mismatch.


(In reply to comment #7)
> $ LC_ALL="tr_TR.UTF-8"
> $ [[ "REVISION" == "$(echo revision | tr [:lower:] [:upper:])" ]] && echo TRUE

$ [[ "REVISION" == "$(echo revision | tr [:lower:] [:upper:])" ]] && echo TRUE
TRUE

One of us has another bug to report...

Comment 10 Doug Goldstein (RETIRED) gentoo-dev 2008-02-15 20:12:10 UTC
I personally think this whole eclass is overly complicated and tries to do too much stuff for no good reason.
Comment 11 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2008-02-15 20:22:38 UTC
(In reply to comment #10)
> I personally think this whole eclass is overly complicated

Exactly where?
Comment 12 Doug Goldstein (RETIRED) gentoo-dev 2008-02-19 20:26:33 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > I personally think this whole eclass is overly complicated
> 
> Exactly where?
> 

It duplicates the functionality of epatch in eutils.eclass unnecessarily. It's trying to provide one huge src_unpack() to rule them all, that needs to be trimmed down.
Comment 13 Doug Goldstein (RETIRED) gentoo-dev 2008-02-20 20:21:12 UTC
subversion__to_upper_case() is gone completely. Basic svn switch support is there. but no svn switch --reloate.
Comment 14 Elmar Vonlanthen 2008-02-21 10:56:09 UTC
Hello all,

I think there is a little bug in the subversion.eclass.
I have a little ebuild which uses subversion to install. The variable ESVN_REPO_URI is set.
Yesterday, the ebuild was working, but today it doesn't work anymore.

Sorry, if I post to the wrong Bug, but maybe the issue is related to this one, because of the ESVN_REPO_URI.

This is the output of emerge:

>>> Merging net-firewall/gateway-5.1.0 to /root/gateway/rootfs/
 *
 * ERROR: net-firewall/gateway-5.1.0 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called pkg_preinst
 *             environment, line 1910:  Called subversion_pkg_preinst
 *             environment, line 2281:  Called subversion_wc_info
 *             environment, line 2302:  Called subversion__get_repository_uri 'pkg_preinst'
 *             environment, line 2124:  Called die
 * The specific snippet of code:
 *           die "${ESVN}: ESVN_REPO_URI (or specified URI) is empty.";
 *  The die message:
 *   subversion: ESVN_REPO_URI (or specified URI) is empty.
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-firewall/gateway-5.1.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-firewall/gateway-5.1.0/temp/environment'.

There seems to be a missing argument in the function _pkg_preinst:
subversion_wc_info() {
    local repo_uri="$(subversion__get_repository_uri "${1}")"
    local wc_path="$(subversion__get_wc_path "${repo_uri}")"
...
...
subversion_pkg_preinst() {
    local pkgdate=$(date "+%Y%m%d %H:%M:%S")
    subversion_wc_info
                    ^^^^^

${1} in subversion_wc_info would be empty in this case.

Best regards
Elmar
Comment 15 Bo Ørsted Andresen (RETIRED) gentoo-dev 2008-02-21 13:53:57 UTC
(In reply to comment #14)
> Sorry, if I post to the wrong Bug, but maybe the issue is related to this
> one, because of the ESVN_REPO_URI.

It is the wrong bug but nonetheless thanks for reporting. It should be fixed now.
Comment 16 Sebastian Luther (few) 2009-05-14 15:34:51 UTC
*** Bug 269771 has been marked as a duplicate of this bug. ***
Comment 17 Marcel Partap 2009-09-17 10:30:18 UTC
Created attachment 204402 [details, diff]
simpler: just add relocate option, maybe as first step to committing the previously attached patch
Comment 18 Marcel Partap 2009-11-17 07:19:19 UTC
(In reply to comment #17)
> Created an attachment (id=204402) [details]
> simpler: just add relocate option, maybe as first step to committing the
> previously attached patch
Has anyone reviewed this? It's very simple and should not break anything - can't this be just committed, saving zillions of Bytes being uselessly retransmitted because fellow gento0ers don't know about --relocate nor how to patch subversion.eclass with it so they end up deleting the full repo and redownloading it?