Albrecht Gebhardt
1998-Jan-19 13:37 UTC
R-beta: updating the library index / overriding compile options
Would it be possible to include a new command in the ${RHOME}/etc path, which
updates the Library index (Rd and html) via "R LIBINDEX".
I need it because I use RPM to manage three different R installations (at home,
at the institute and in the seminar rooms). I put all libraries into several
packages, so it is easy for me to update a single library at all these
different places.
But after installation or removal of a library via rpm the help indices have to
be updated. A call like "R INSTALL +help" in the post/pre
install/uninstall
script calls also "make" in the library source trees, which is
unnecessary (and
may even fail, e.g. because of a missing Fortran compiler).
The following script does exactly what I want (I don't know if it will work
for library directories other then $RHOME/library):
##############################################################################
#! /bin/sh
# ${RHOME}/etc/LIBINDEX for updating the library index
# Usage:
# R LIBINDEX [lib]
#
lib=${1:-${RHOME}/library}
test -d ${lib} || exit 1;
lib=`cd ${lib}; pwd`
rm -f ${lib}/LibIndex
echo updating LibIndex ...
for pkg in `ls -d ${lib}/*`; do
if test -d ${pkg}; then
if test -f ${pkg}/TITLE; then
# echo " adding entry for library" ${pkg##*/}
cat ${pkg}/TITLE >> ${lib}/LibIndex 2> /dev/null
fi
fi
done
echo updating HTML index ...
${RHOME}/etc/build-htmlpkglist
echo "DONE"
##############################################################################
It would also be good, if some of the compile options could be overridden in
a "R INSTALL ..." call. Especially I'm using GNU Fortran when
compiling the base
R disribution, that means $src is set to "src". But g77 fails on some
of the
libraries. So I want to do "R INSTALL +docs src-c libname" for this
library
which sets $dir to "src-c".
I would propose the following patch to includes these two options
("src" or "src-c") into "R INSTALL":
##############################################################################
--- etc/INSTALL.in
+++ etc/INSTALL.in 1997/12/10 09:16:00
@@ -3,7 +3,7 @@
# ${RHOME}/etc/INSTALL for installing add-on packages
# Usage:
# R INSTALL [(+|-)debug] [-help/+help] [-html/+html] [-latex/+latex]
-# [+docs/-docs] pkg [lib]
+# [+docs/-docs] [src/src-c] pkg [lib]
IHELP=y
IHTML=y
@@ -33,6 +33,10 @@
ILATEX="y"
fi
+if [ "$1" = "src" ]; then shift; src=src; fi
+if [ "$1" = "src-c" ]; then shift; src=src-c; fi
+if [ ! "$src" ]; then src=@LIBSRC@; fi
+
if [ "$1" ]
then
pkg=$1
@@ -53,7 +57,6 @@
test -d ${lib}/${pkg} || mkdir ${lib}/${pkg} || exit 1;
-src=@LIBSRC@
cd ${pkg}
pkg=`basename ${pkg}`
############################################################################
I'm not sure if this is the best way. Any other ideas?
Albrecht
-------------------------------------------------------------------------------
Albrecht Gebhardt email : albrecht.gebhardt at uni-klu.ac.at
Institut fuer Mathematik Tel. : (++43 463) 2700/837
Universitaet Klagenfurt Fax : (++43 463) 2700/834
Villacher Str. 161
A-9020 Klagenfurt, Austria
-------------------------------------------------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Douglas Bates
1998-Jan-19 15:19 UTC
R-beta: updating the library index / overriding compile options
Albrecht Gebhardt <agebhard at zidsrv.sci.uni-klu.ac.at> writes:> Would it be possible to include a new command in the ${RHOME}/etc path, which > updates the Library index (Rd and html) via "R LIBINDEX". > > I need it because I use RPM to manage three different R installations (at home, > at the institute and in the seminar rooms). I put all libraries into several > packages, so it is easy for me to update a single library at all these > different places. > > But after installation or removal of a library via rpm the help indices have to > be updated. A call like "R INSTALL +help" in the post/pre install/uninstall > script calls also "make" in the library source trees, which is unnecessary (and > may even fail, e.g. because of a missing Fortran compiler). > > The following script does exactly what I want (I don't know if it will work > for library directories other then $RHOME/library): > ############################################################################## > #! /bin/sh > > # ${RHOME}/etc/LIBINDEX for updating the library index > # Usage: > # R LIBINDEX [lib] > # > > > > lib=${1:-${RHOME}/library} > test -d ${lib} || exit 1; > lib=`cd ${lib}; pwd` > > rm -f ${lib}/LibIndex > > echo updating LibIndex ... > for pkg in `ls -d ${lib}/*`; do > if test -d ${pkg}; then > if test -f ${pkg}/TITLE; then > # echo " adding entry for library" ${pkg##*/} > cat ${pkg}/TITLE >> ${lib}/LibIndex 2> /dev/null > fi > fi > done > > echo updating HTML index ... > > ${RHOME}/etc/build-htmlpkglist > > echo "DONE" > ##############################################################################I'm not sure if the facility is available in RPM but the Debian packages for R include "post-install", "pre-remove", and "post-remove" scripts (thanks to Kurt Hornig). They are similar to your script above #!/bin/sh # # postinst script for the Debian GNU/Linux r-cran package # This version written by Douglas Bates <bates at stat.wisc.edu> set -e case "$1" in configure) (cd /usr/lib/R/library; cat */TITLE > LibIndex; ../etc/build-htmlpkglist) # ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 ;; esac If, as you suggest, a LIBINDEX script was created, these could be shortened. Can you incorporate this type of code into your RPM packages? -- Douglas Bates bates at stat.wisc.edu Statistics Department 608/262-2598 University of Wisconsin - Madison http://www.stat.wisc.edu/~bates/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Douglas Bates
1998-Jan-19 15:26 UTC
R-beta: updating the library index / overriding compile options
Albrecht Gebhardt <agebhard at zidsrv.sci.uni-klu.ac.at> writes:> It would also be good, if some of the compile options could be overridden in > a "R INSTALL ..." call. Especially I'm using GNU Fortran when compiling the base > R disribution, that means $src is set to "src". But g77 fails on some of the > libraries. So I want to do "R INSTALL +docs src-c libname" for this library > which sets $dir to "src-c". > > I would propose the following patch to includes these two options > ("src" or "src-c") into "R INSTALL":On the topic of Fortran compilers, has anyone attempted a compilation using eg77. This is the version of g77 to accompany egcs, the experimental GNU compiler system. Now that gcc-2.8.0 is out I guess that there won't be as much interest in egcc. I understand though that a version of g77 to accompany gcc-2.8.0 is still in the works. eg77 Description: The EGCS experimental Fortran compiler. This is the EGCS experimental version of the g77 Fortran compiler. Like the standard FSF release, it uses the gcc backend to generate code. It requires the egcc package to be installed in order to work. -- Douglas Bates bates at stat.wisc.edu Statistics Department 608/262-2598 University of Wisconsin - Madison http://www.stat.wisc.edu/~bates/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._