Permalink
Browse files

updated mechanism re. recommended packages

git-svn-id: https://svn.r-project.org/R/trunk@21216 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent 3a53484 commit 49dde0933f3a5a111f4b69c5eef7edcad6238a4e pd committed Sep 8, 2002
Showing with 48 additions and 34 deletions.
  1. +3 −3 Makefile.in
  2. +21 −25 src/library/Recommended/Makefile.in
  3. +24 −6 tools/rsync-recommended
View
@@ -73,8 +73,8 @@ help html latex examples: FORCE
-@(cd src/library && $(MAKE) $@)
FORCE:
-stamp-recommended: FORCE
- -@(cd src/library/Recommended && $(MAKE) $@)
+stamp-recommended: R docs
+ -@(cd src/library/Recommended && $(MAKE) )
install: installdirs
@for d in $(SUBDIRS); do \
@@ -120,7 +120,7 @@ maintainer-clean: distclean
dist: dist-unix
dist-unix: distdir
-chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chzf $(distdir).tar.gz $(distdir)
+ GZIP=$(GZIP) $(TAR) czf $(distdir).tar.gz $(distdir)
rm -rf $(distdir)
dist-win:
distdir: $(DISTFILES)
@@ -14,36 +14,32 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = Makefile.in .cvsignore
R = $(top_builddir)/bin/R
-CLEANFILES = Timestamp
+# foo.ts is the timestamp for package foo
+# foo_tgz is a symlink to foo_x.y-z.tar.gz in the source dir
+
+# For developers: A shell script, tools/rsync-recommended, updates
+# packages from the CRAN master directory.
+
+.SUFFIXES: _tgz .ts
+OBJECTS=$(R_PKGS_RECOMMENDED:=.ts)
+
+CLEANFILES = $(OBJECTS)
DISTCLEANFILES = Makefile
-all: Makefile @USE_RECOMMENDED_PACKAGES_TRUE@ stamp-recommended
+all: Makefile R @USE_RECOMMENDED_PACKAGES_TRUE@ $(OBJECTS)
+
+_tgz.ts:
+ $(R) CMD INSTALL $<
+ touch $@
+
+# survival needs to be installed before boot
+boot.ts: survival.ts boot_tgz
+ $(R) CMD INSTALL $(srcdir)/boot_tgz
+ touch $@
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-## <FIXME>
-## This should have more error checking: in particular, that for each
-## recommended package we have *exactly* one corresponding .tar.gz.
-stamp-recommended: Timestamp
- @for pkg in $(R_PKGS_RECOMMENDED); do \
- for file in $(srcdir)/$${pkg}_*.tar.gz; do \
- if test $${file} -nt Timestamp ; then \
- R_LIBS= $(R) CMD INSTALL $${file} || exit 1; \
- fi; \
- done; \
- done
- @touch Timestamp
-## </FIXME>
-## <FIXME>
-## Do we still need this?
-## If not, then in the above change the final line to '@touch $@'.
-Timestamp:
- @touch $@
- @sleep 1
- @find $(srcdir) -name '*.tar.gz' -exec touch {} . \;
-## </FIXME>
-
R docs:
install: installdirs
@@ -60,7 +56,7 @@ distclean: clean
maintainer-clean: distclean
distdir: $(DISTFILES)
- @for f in $(DISTFILES) `cd $(srcdir) && ls *.tar.gz`; do \
+ @for f in $(DISTFILES) `cd $(srcdir) && ls *.tar.gz *_tgz`; do \
test -f $(distdir)/$${f} \
|| ln $(srcdir)/$${f} $(distdir)/$${f} 2>/dev/null \
|| cp -p $(srcdir)/$${f} $(distdir)/$${f}; \
@@ -2,16 +2,34 @@
#
# ${RHOME}/tools/rsync-recommended
+
: ${CRAN_RSYNC='cran.r-project.org::CRAN'}
TOOLS_DIR=`echo ${0} | sed 's%/[^/][^/]*$%%'`
(cd "${TOOLS_DIR}"/..
version=`cut -f1 -d' ' VERSION`
+ PKGS=`grep '^R_PKGS_RE' Makeconf.in | sed 's/.*=//'`
cd src/library/Recommended
- ## Notice that if we can't use -t on rsync because that defeats the
- ## purpose of the Timestamp... The -c (checksum first) is also
- ## necessary because otherwise all the files get the mtime changed.
- ## Sigh.
+
+ ## The purpose of the rsync options is to get the timestamps on the
+ ## downloaded files to reflect time of download.
+ ## We can't use -t because then we could download a changed file that
+ ## was older the last build and therefore would not be installed.
+ ## The -c (checksum first) is necessary because otherwise all the
+ ## files get their mtime changed whether updated or not.
+ ## -C prevents --delete from removing the CVS subdirectory.
+
rsync -rcIzC --delete \
- --exclude=Makefile.in --exclude=Makefile --exclude=Timestamp \
- "${CRAN_RSYNC}"/src/contrib/${version}/Recommended/ .)
+ --exclude=Makefile.in --exclude=Makefile --exclude=.cvsignore \
+ "${CRAN_RSYNC}"/src/contrib/${version}/Recommended/ .
+
+ ## Link all each package to a simplified name so that Make has an
+ ## easier time. Notice that we cannot use pkgname.tgz because of
+ ## the way R CMD INSTALL works, but pkgname_tgz works OK.
+ ## Notice that as far as Make is concerned, the symlinks have the same
+ ## timestamp as the file they point to.
+
+ for i in ${PKGS} ; do
+ ln -s $i*.tar.gz ${i}_tgz
+ done
+)

0 comments on commit 49dde09

Please sign in to comment.