Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185970 - subversion.eclass should support offline mode (patch attached)
Summary: subversion.eclass should support offline mode (patch attached)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Akinori Hattori
URL:
Whiteboard:
Keywords:
: 188408 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-20 10:58 UTC by Christian Schmidt
Modified: 2008-02-21 13:44 UTC (History)
5 users (show)

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


Attachments
Patch for subversion.eclass to support offline mode (subversion.eclass.patch,1.32 KB, patch)
2007-07-20 10:59 UTC, Christian Schmidt
Details | Diff
Patch for subversion.eclass to support offline mode - now with -n (subversion.eclass.patch,1.32 KB, patch)
2007-07-20 13:43 UTC, Christian Schmidt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Schmidt 2007-07-20 10:58:51 UTC
Sometimes, sources have to be rebuild without having network connectivity (e.g. for me the SVN-Madwifi driver). It would be good for such cases to have an offline mode for the subversion eclass similar to the one of the cvs eclass. Patch is attached.

Reproducible: Always
Comment 1 Christian Schmidt 2007-07-20 10:59:38 UTC
Created attachment 125445 [details, diff]
Patch for subversion.eclass to support offline mode
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-07-20 13:26:04 UTC
-n is better than ! -z.
Comment 3 Christian Schmidt 2007-07-20 13:42:35 UTC
(In reply to comment #2)
> -n is better than ! -z.

True, a leftover of one change or the other. Updated patch attached.

Comment 4 Christian Schmidt 2007-07-20 13:43:28 UTC
Created attachment 125454 [details, diff]
Patch for subversion.eclass to support offline mode - now with -n
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-08-10 22:20:49 UTC
*** Bug 188408 has been marked as a duplicate of this bug. ***
Comment 6 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-08-22 10:43:25 UTC
Suggested implementation is incomplete. It may produce incorrect results, when an ebuild requests specified revision. Comparison of revisions is necessary.
Comment 7 Christian Schmidt 2007-08-22 20:08:46 UTC
(In reply to comment #6)
While your comment is valid, I do not think it is necessary to do so.
First of all, features like this will require very experienced users, as it is not publicly documented. Such users are likely to know and understand requirements like this.
Second, this feature will likely only be used in networkless situations, or (in my case) when repeatedly trying out ebuilds that add patches. In the first case, getting it to work "somehow" might be better than not at all, in the second you obviously have the right version.
The equivalent feature for CVS also does not support specific versions. Checking for a version is also not possible afaik, as specifying a version for checkout is not supported by the SVN eclass itself. ebuilds that want specific versions override ESVN_UPDATE_CMD (at least in the one case I know about), which is not within the scope.
Comment 8 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-08-22 20:27:17 UTC
(In reply to comment #7)
> First of all, features like this will require very experienced users

It can be done by ebuild developers.

> The equivalent feature for CVS also does not support specific versions.

Because CVS is stupid and don't have repository-wide revisions.

> Checking for a version is also not possible afaik, as specifying a version
> for checkout is not supported by the SVN eclass itself.

A hack with ESVN_OPTION is commonly used for this purpose.

The best solution is to introduce ESVN_REVISION, which will be implemented similarly to current hack with ESVN_OPTION.
Comment 9 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-08-22 20:28:22 UTC
(In reply to comment #8)

s/ESVN_OPTION/ESVN_OPTIONS/g
Comment 10 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-08-27 06:04:21 UTC
(In reply to comment #7)
> While your comment is valid, I do not think it is necessary to do so.
> First of all, features like this will require very experienced users, as it
> is not publicly documented.

Even mythtv.eclass uses ESVN_OPTIONS to set specified revision.

The only advantage of ESVN_REVISION is that it would be easier to parse. The implementation is very simple.
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2008-01-14 11:48:32 UTC
(In reply to comment #6)
> Suggested implementation is incomplete. It may produce incorrect results, when
> an ebuild requests specified revision. Comparison of revisions is necessary.

I really don't understand how's that related? If you are offline, then you are basically offline and can't fetch anything, need a way to tell the eclass to not fetch anything and use the existing checkout.

If you want more toys to play with, then file a new bug with a patch. Meanwhile, this should be committed because I'm tired of patching the eclass locally everytime I need this.
Comment 12 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2008-01-14 16:10:45 UTC
(In reply to comment #11)
> (In reply to comment #6)
> > Suggested implementation is incomplete. It may produce incorrect results, 
> > when an ebuild requests specified revision. Comparison of revisions is 
> > necessary.
> 
> I really don't understand how's that related? If you are offline, then you are
> basically offline and can't fetch anything, need a way to tell the eclass to
> not fetch anything and use the existing checkout.

If user has sources of mythtv r15014 in ${DISTDIR}/svn-src/mythtv/trunk and he/she invokes `ESVN_OFFLINE=1 emerge media-tv/mythtv`, then with this patch Portage would reinstall the same revision, but user would think that he/she updated =media-tv/mythtv-0.21_pre15014 to =media-tv/mythtv-0.21_pre15362.

> If you want more toys to play with, then file a new bug with a patch.
> Meanwhile, this should be committed because I'm tired of patching the eclass
> locally everytime I need this.

I will create a patch.
It should be similar to this code:
if [[ -n "${ESVN_OFFLINE}" && -n "${ESVN_REVISION}" ]] ; then
   pushd "${wc_path}"
   [[ "$(svnversion)" != "${ESVN_REVISION}" ]] && die "Revision mismatch"
   popd
fi

I will place this code somewhere in the eclass.
I have already implemented handling of ESVN_REVISION.
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2008-01-14 21:53:57 UTC
Yeah of course portage would reinstall the same revision, because you are offline. That's what you requested.

Plus, there's no need to reinvent the wheel... https://www2.mailstation.de/gitweb/?p=genkde4svn-dev.git;a=blob_plain;f=eclass/subversion.eclass;hb=HEAD
Comment 14 Bo Ørsted Andresen (RETIRED) gentoo-dev 2008-02-21 13:44:07 UTC
I believe this bug is fixed now. Reopen if you disagree.