File: rsync-recommended

package info (click to toggle)
r-base 2.1.0-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 43,944 kB
  • ctags: 23,283
  • sloc: ansic: 200,913; fortran: 68,557; sh: 12,127; perl: 8,510; makefile: 5,810; tcl: 2,953; yacc: 2,077; java: 455; asm: 268; sed: 16
file content (51 lines) | stat: -rwxr-xr-x 1,977 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /bin/sh
#
# ${RHOME}/tools/rsync-recommended

: ${CRAN_RSYNC='cran.r-project.org::CRAN'}

## The intention here is infer TOOLS_DIR from an explicit path.
## but the user might have called it from tools, so test that case
## separately.
TOOLS_DIR=`echo ${0} | sed 's%/[^/][^/]*$%%'`
if test ${TOOLS_DIR} = ${0} ; then
  TOOLS_DIR="."
fi
(cd "${TOOLS_DIR}"/..
  version=`cut -f1 -d' ' VERSION`
  if test "`cut -f2 -d' ' VERSION`" = "Patched"; then
    version=`echo ${version} | sed 's/\.[0-9]*$//'`
    version="${version}-patched"
  fi
  PKGS=`grep '^R_PKGS_RECOMMENDED_SOURCES *=' share/make/vars.mk | \
    sed 's/.*=//'`
  cd src/library/Recommended

  ## 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.
  ## We would like to use '-C' to prevent '--delete' from removing the
  ## CVS subdirectory, but in some versions of rsync this adds the
  ## exclude patterns from .cvsignore without a way to override, so we
  ## try using an exclude pattern.

  rsync -rcIz --verbose --delete --include="*.tar.gz" \
    --exclude=Makefile.in --exclude=Makefile --exclude=".svn" \
    --exclude="CVS*" --exclude=.cvsignore --exclude="*.tgz" \
    "${CRAN_RSYNC}"/src/contrib/${version}/Recommended/ . || \
    (echo "*** rsync failed to update Recommended files ***" && exit 1)

  ## Link each package to a simplified name so that Make has an easier
  ## time.  Notice that as far as Make is concerned, the symlinks have
  ## the same timestamp as the file they point to.  Don't remove the 
  ## existing links until now in case rsync fails.

  echo "Creating links"
  rm -f *.tgz
  for i in ${PKGS} ; do
    ln -s $i*.tar.gz ${i}.tgz
  done
)