Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158891 - dev-util/subversion - 70svn-gentoo.el confuses emacs-cvs libraries
Summary: dev-util/subversion - 70svn-gentoo.el confuses emacs-cvs libraries
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Emacs project
URL:
Whiteboard:
Keywords: REGRESSION
: 185427 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-23 00:43 UTC by Timothy Stotts
Modified: 2007-07-15 18:18 UTC (History)
5 users (show)

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


Attachments
Proposed new 70svn-gentoo.el (70svn-gentoo.el,210 bytes, text/plain)
2007-02-24 01:36 UTC, Ulrich Müller
Details
Proposed patch for subversion-1.4.3.ebuild (diff,579 bytes, patch)
2007-02-24 01:38 UTC, Ulrich Müller
Details | Diff
Proposed patch for subversion-1.4.3.ebuild (take 2) (diff,633 bytes, patch)
2007-02-24 07:40 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Stotts 2006-12-23 00:43:00 UTC
When installing the dev-util/subversion package, Portage generates an auto-load lisp file under /usr/share/emacs/site-lisp/ .

On my machine, the file is:
    /usr/share/emacs/site-lisp/70svn-gentoo.el

Two libraries are prepended to the *front* of the site-wide emacs library path. This means that the emacs libraries in the subversion ebuild is load instead of those included in the emacs installation.

This behavior is wrong. The two libraries are:
    vc-svn
    psvn

The library psvn is not included with Emacs, and so the library path order is irrelevant. No other ebuild contains it (to my knowledge).

However, the library vc-svn included with subversion is a deprecated library. In the comments of the library file, it says that it should not be loaded if your Emacs comes with vc-svn as it is old and obsolete.

Currently the following conflict exists between app-editors/emacs (or -cvs) and dev-util/subversion:

If the installed Emacs version contains vc-svn, it will be ignored in favor of the old and obsolete library. This causes grief and bugs for the user.

The generated autoload could be changed from:

   (setq load-path (cons "/usr/share/emacs/site-lisp/subversion" load-path))

to:

   (setq load-path (append load-path '("/usr/share/emacs/site-lisp/subversion")))


But honestly, this will not solve the issue due to Emacs searching its own libraries last.

The subversion ebuild should do one of the following:
    (1) detect whether app-editor/emacs or app-editor/emacs-cvs is the editor installed; if emacs-cvs, do not install vc-svn.el
    (2) patch the vc-svn.el file to find and load the native vc-svn if it exists (load-file "..."), otherwise continue loading itself.
    (3) provide a use flag to prevent install of old lisp code, perhaps use 'emacs' and 'emacs22' or 'emacs' and 'emacs-cvs' are relevant.
    (4) provide the user with a warning message on how to avoid the issue

Glad to contribute any ideas/elisp patches.
Comment 1 Paul de Vrieze (RETIRED) gentoo-dev 2006-12-30 11:48:06 UTC
I'd prefer your second solution. The vc-svn.el script is a file in the tree so any better version would do (as long as it is compatible)
Comment 2 Ulrich Müller gentoo-dev 2007-02-23 21:02:06 UTC
Another possibility would be to install vc-svn.el* in a different directory (say, ${SITELISP}/${PN}/compat). Then the site-init file could add it to the load-path for Emacs versions < 22 only:

(add-to-list 'load-path "@SITELISP@")
(and (< emacs-major-version 22)
     (add-to-list 'load-path "@SITELISP@/compat"))
Comment 3 Timothy Stotts 2007-02-23 23:45:05 UTC
(In reply to comment #2)
That would be an excellent solution. One caveat though. Emacs 22 appears to recursively search the site-lisp directory for elisp files; so even if the directory is not explicitly add to `load-path', if it is under a directory in the path, it will still be found by `locate-library'.

IMHO, a better solution would be to install `vc-svn.el' at /usr/share/subversion/emacs/ in similar fashion to `clisp' and other portage packages. Then site the load file can conditionally add that directory the `load-path' base on the Emacs major version.
Comment 4 Ulrich Müller gentoo-dev 2007-02-24 01:11:38 UTC
(In reply to comment #3)
> One caveat though. Emacs 22 appears to recursively search the site-lisp 
> directory for elisp files; so even if the directory is not explicitly
> add to `load-path', if it is under a directory in the path, it will still
> be found by `locate-library'.

You are right, load-path is augmented by its subdirs in startup.el (function normal-top-level-add-subdirs-to-load-path). This can be prevented by placing a file ".nosearch" within the subdir.

So in addition to my comment #2, the ebuild should also install an empty file ".nosearch" in the "compat" directory.
Comment 5 Ulrich Müller gentoo-dev 2007-02-24 01:36:52 UTC
Created attachment 111101 [details]
Proposed new 70svn-gentoo.el
Comment 6 Ulrich Müller gentoo-dev 2007-02-24 01:38:23 UTC
Created attachment 111102 [details, diff]
Proposed patch for subversion-1.4.3.ebuild
Comment 7 Ulrich Müller gentoo-dev 2007-02-24 07:40:53 UTC
Created attachment 111111 [details, diff]
Proposed patch for subversion-1.4.3.ebuild (take 2)
Comment 8 Paul de Vrieze (RETIRED) gentoo-dev 2007-02-24 18:32:20 UTC
What is the say of the emacs maintainers on this? It seems to be a sane solution, but I'd like your view on it.
Comment 9 Christian Faulhammer (RETIRED) gentoo-dev 2007-02-25 11:30:14 UTC
(In reply to comment #8)
> What is the say of the emacs maintainers on this? It seems to be a sane
> solution, but I'd like your view on it.

 Ulrich is an Officially Trusted Emacs User(TM).  :)  But I am ok with it, looks fine.  Thanks Ulrich, as always.
Comment 10 Ulrich Müller gentoo-dev 2007-03-02 20:28:54 UTC
While you are at it:
Is there a special reason why pkg_postrm() does:
    has_version virtual/emacs && elisp-site-regen
instead of:
    use emacs && elisp-site-regen
which is used in pkg_postinst() (and is the more usual way)?
Comment 11 Christian Faulhammer (RETIRED) gentoo-dev 2007-03-07 04:46:48 UTC
(In reply to comment #10)
> While you are at it:
> Is there a special reason why pkg_postrm() does:
>     has_version virtual/emacs && elisp-site-regen
> instead of:
>     use emacs && elisp-site-regen
> which is used in pkg_postinst() (and is the more usual way)?

 I fixed that, pauldv, I hope you don't mind.  The rest has been already handled, so this bug can be closed.
Comment 12 Ulrich Müller gentoo-dev 2007-07-15 17:32:54 UTC
Both problems (comment #7 and comment #10) reappeared in 1.4.4-r2, therefore reopening.

Versions 1.4.3 up to 1.4.4-r1 were O.K.
Comment 13 Ulrich Müller gentoo-dev 2007-07-15 17:34:46 UTC
*** Bug 185427 has been marked as a duplicate of this bug. ***
Comment 14 Ulrich Müller gentoo-dev 2007-07-15 18:18:29 UTC
Fixed again in 1.4.4-r3, as discussed with phreak on IRC.