Hi Eric,
>>>Perhaps the `common' directory could just be called `cedet' and mark
>>>it as the location for miscellaneous bits not large enough to warrant
>>>a project directory, but still quite specific to CEDET.
>>
>>[...]
>>
>>I agree with that (I thought to it too). An advantage is that the
>>library cedet.el already exists, and provide the cedet-version
>>info. needed by inversion (IMO it makes sense that the cedet version
>>serve as reference for common stuff).
>>
>>Is there a simple way to do that renaming in CVS? Or should we create
>>the new cedet directory then add the content of the common directory
>>into it, and finally remove the common directory from the repository.
>
> [ ... ]
>
> The only way to do this CVS change in one pass is if you have access
> to the CVS repository file system. (ie, we could download a
> repository backup, make the change, and request an upload via the
> sourceforge system administrators... Ick!)
>
> A description of doing it via CVS commands is in the CVS info pages
> and is pretty easy too. If you intend to do this, that would be
> great.
I finally found a better solution which doesn't require to rename the
common subdirectory. The name "common" is really better than "cedet"
which can confuse people, because cedet is already used for the main
project directory.
In fact it was relatively easy. I just modified a little
`inversion-add-to-load-path' to actually use the INSTALLDIR optional
argument, so that it is now possible to have a package in a
subdirectory with a different name.
I also changed cedet.el to take into account that.
In conclusion, common stuff are handled in a "pseudo" cedet package
hosted in the "common" subdirectory.
Of course, there is no more common*.el files, they are now cedet.el,
cedet-load.el and the generated cedet-loaddefs.el.
You will find the new files in the attached tarball. Here is the
patch for existing files.
Thoughts?
Index: Makefile
===================================================================
RCS file: /cvsroot/cedet/cedet/Makefile,v
retrieving revision 1.2
diff -c -r1.2 Makefile
*** Makefile 17 Sep 2003 08:54:34 -0000 1.2
--- Makefile 23 Sep 2003 10:48:10 -0000
***************
*** 29,34 ****
--- 29,35 ----
## The CEDET's packages installed
CEDET_PACKAGES=\
+ common \
ede \
speedbar \
eieio \
***************
*** 46,54 ****
#RM = rm -f
############### Internal part of the Makefile ###############
- __LOADDEFS=$(patsubst %,%-loaddefs.el,$(CEDET_PACKAGES))
__BUILD_AUTOLOADS=$(patsubst %,%-autoloads,$(CEDET_PACKAGES))
! __CLEAN_AUTOLOADS=$(patsubst %,clean-%,$(__LOADDEFS))
__DOMAKE=$(MAKE) $(MFLAGS) EMACS="$(EMACS)" SHELL="$(SHELL)"
## Build
--- 47,54 ----
#RM = rm -f
############### Internal part of the Makefile ###############
__BUILD_AUTOLOADS=$(patsubst %,%-autoloads,$(CEDET_PACKAGES))
! __CLEAN_AUTOLOADS=$(patsubst %,clean-%,$(__BUILD_AUTOLOADS))
__DOMAKE=$(MAKE) $(MFLAGS) EMACS="$(EMACS)" SHELL="$(SHELL)"
## Build
***************
*** 82,88 ****
.PHONY: $(__CLEAN_AUTOLOADS)
$(__CLEAN_AUTOLOADS):
! $(RM) $(CEDET_HOME)/$(word 2,$(subst -, ,$@))/$(subst clean-,,$@)
.PHONY: clean-grammars
clean-grammars:
--- 82,90 ----
.PHONY: $(__CLEAN_AUTOLOADS)
$(__CLEAN_AUTOLOADS):
! $(FIND) $(CEDET_HOME)/$(word 2,$(subst -, ,$@)) -type f \
! -name "*-loaddefs.el" \
! -print -exec $(RM) {} \;
.PHONY: clean-grammars
clean-grammars:
Index: common/cedet.el
===================================================================
RCS file: /cvsroot/cedet/cedet/common/cedet.el,v
retrieving revision 1.3
diff -c -r1.3 cedet.el
*** common/cedet.el 17 Sep 2003 08:56:12 -0000 1.3
--- common/cedet.el 23 Sep 2003 10:48:11 -0000
***************
*** 76,92 ****
(eval-when-compile
(require 'cl))
! (defconst cedet-version "1.0"
"Current version of CEDET.")
(defconst cedet-packages
! '(
! ;;PACKAGE MIN-VERSION
! (cogre "0.4" )
! (ede "1.0beta3" )
! (eieio "0.18" )
! (semantic "2.0beta1" )
! (speedbar "0.15beta1" )
)
"Table of CEDET packages to install.")
--- 76,93 ----
(eval-when-compile
(require 'cl))
! (defconst cedet-version "1.0beta1"
"Current version of CEDET.")
(defconst cedet-packages
! `(
! ;;PACKAGE MIN-VERSION INSTALLDIR
! (cedet ,cedet-version "common" )
! (cogre "0.4" )
! (ede "1.0beta3" )
! (eieio "0.18" )
! (semantic "2.0beta1" )
! (speedbar "0.15beta1" )
)
"Table of CEDET packages to install.")
***************
*** 102,115 ****
(require 'inversion)
;; Go up to the parent "<INSTALL-DIR>/cedet" directory.
! (let ((default-directory (expand-file-name "..")))
;; Add the CEDET packages subdirectories to the `load-path' if
;; necessary, and do specific setup.
! (dolist (package cedet-packages)
! (inversion-add-to-load-path (car package) (cadr package))
(condition-case err
! (require (intern (format "%s-load" (car package))))
(error
(message "%s" (error-message-string err)))))
))
--- 103,122 ----
(require 'inversion)
;; Go up to the parent "<INSTALL-DIR>/cedet" directory.
! (let ((default-directory (expand-file-name ".."))
! package min-version installdir)
;; Add the CEDET packages subdirectories to the `load-path' if
;; necessary, and do specific setup.
! (dolist (package-spec cedet-packages)
! (setq package (nth 0 package-spec)
! min-version (nth 1 package-spec)
! installdir (nth 2 package-spec))
! (when installdir
! (setq installdir (expand-file-name installdir)))
! (inversion-add-to-load-path package min-version installdir)
(condition-case err
! (require (intern (format "%s-load" package)))
(error
(message "%s" (error-message-string err)))))
))
Index: common/inversion.el
===================================================================
RCS file: /cvsroot/cedet/cedet/common/inversion.el,v
retrieving revision 1.19
diff -c -r1.19 inversion.el
*** common/inversion.el 6 Sep 2003 19:41:41 -0000 1.19
--- common/inversion.el 23 Sep 2003 10:48:11 -0000
***************
*** 359,386 ****
"Add the PACKAGE path to `load-path' if necessary.
MINIMUM is the minimum version requirement of PACKAGE.
Optional argument INSTALLDIR is the base directory where PACKAGE is
! installed. It defaults to `default-directory'.
! SUBDIRS are PACKAGE sub-directories to add to `load-path', following
! the main INSTALLDIR/PACKAGE path."
(let ((ver (inversion-find-version package)))
;; If PACKAGE not found or a bad version already in `load-path',
;; prepend the new PACKAGE path, so it will be loaded first.
(when (or (not ver)
(inversion-check-version (car ver) (cdr ver) minimum))
! (let* ((default-directory (or installdir default-directory))
! (path (expand-file-name (format "./%s" package)))
! subpath)
! (when (file-directory-p path)
;; Add SUBDIRS
(while subdirs
! (setq subpath (format "%s/%s" path (car subdirs))
subdirs (cdr subdirs))
! (when (file-directory-p subpath)
! (message "%S added to `load-path'" subpath)
! (add-to-list 'load-path subpath)))
;; Add the main path
! (message "%S added to `load-path'" path)
! (add-to-list 'load-path path))))))
;;; Inversion tests
;;
--- 359,387 ----
"Add the PACKAGE path to `load-path' if necessary.
MINIMUM is the minimum version requirement of PACKAGE.
Optional argument INSTALLDIR is the base directory where PACKAGE is
! installed. It defaults to `default-directory'/PACKAGE.
! SUBDIRS are sub-directories to add to `load-path', following the main
! INSTALLDIR path."
(let ((ver (inversion-find-version package)))
;; If PACKAGE not found or a bad version already in `load-path',
;; prepend the new PACKAGE path, so it will be loaded first.
(when (or (not ver)
(inversion-check-version (car ver) (cdr ver) minimum))
! (let* ((default-directory
! (or installdir
! (expand-file-name (format "./%s" package))))
! subdir)
! (when (file-directory-p default-directory)
;; Add SUBDIRS
(while subdirs
! (setq subdir (expand-file-name (car subdirs))
subdirs (cdr subdirs))
! (when (file-directory-p subdir)
! (message "%S added to `load-path'" subdir)
! (add-to-list 'load-path subdir)))
;; Add the main path
! (message "%S added to `load-path'" default-directory)
! (add-to-list 'load-path default-directory))))))
;;; Inversion tests
;;
|