File: r-base-core.postinst

package info (click to toggle)
r-base 4.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 91,904 kB
  • sloc: ansic: 278,374; fortran: 100,299; yacc: 5,491; makefile: 5,221; sh: 5,091; tcl: 4,562; objc: 767; perl: 341; asm: 258; java: 31; sed: 10
file content (72 lines) | stat: -rw-r--r-- 2,586 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
#
# postinst script for the Debian GNU/Linux r-base-core package
# This version originally written by Douglas Bates <bates@stat.wisc.edu>
# and now written and maintained by Dirk Eddelbuettel <edd@debian.org>

set -e

#DEBHELPER#
    
    
case "$1" in
  configure)
    # edd 19 Jun 2004   deal with papersize 
    # edd 22 Jun 2004   make that conditional on paperconf
    # edd 25 Oct 2006   rewritten for R 2.4.0 and R_PAPERSIZE_USER
    # edd 21 Jun 2008   rewritten for R 2.7.1 and ucf input 
    # edd 23 Feb 2013   trying to avoid md5sum issues with help from Andy Beckman
    # edd 26 Feb 2013   correct mode of temp. Renviron file with help from Don Armstrong
    tmpRenviron=$(mktemp)
    chmod 0644 "$tmpRenviron"
    cat /usr/lib/R/etc/Renviron.ucf > "$tmpRenviron"
    #if [ -x /usr/bin/paperconf ]; then
        ## get the value we want from Debian's paperconf utility
        papersize=`paperconf`
	## have perl subst. second expression with $papersize for first
	## uses the x mod. and curlies to denote the usual s|1st|2nd|
	perl -p -i -e "s{^R_PAPERSIZE_USER=\\$\{R_PAPERSIZE\}}
		{R_PAPERSIZE_USER=\\$\{R_PAPERSIZE-'$papersize'\}}x" "$tmpRenviron"
    #fi
    # edd 21 Jun 2008  whether or not Renviron was modified, ucf will handle it, 
    #                  so tell ucf that file Renviron.ucf is the source for 
    #                  conffile in /etc and register it
    ucf "$tmpRenviron" /etc/R/Renviron
    ucfr r-base-core /etc/R/Renviron
    rm -f "$tmpRenviron"
    #
    #if [ -x /usr/bin/update-menus ]; then
    #  update-menus 
    #fi

    # edd 03 Apr 2003  cf Section 10.1.2 of Debian Policy
    # edd 06 Feb 2021  #982069, with a nod to Python's debian/PVER-minimal.postinst.in
    if [ -e /etc/staff-group-for-usr-local ]; then
        perm=2775
        group=staff
    else
        perm=755
        group=root
    fi
    if [ ! -e /usr/local/lib/R ]; then
        mkdir -p /usr/local/lib/R 2> /dev/null || true
        chmod $perm /usr/local/lib/R 2> /dev/null || true
        chown root:$group /usr/local/lib/R 2> /dev/null || true
    fi
    localsitelibrary=/usr/local/lib/R/site-library
    if [ ! -e $localsitelibrary ]; then
        mkdir -p $localsitelibrary 2> /dev/null || true
        chmod $perm $localsitelibrary 2> /dev/null || true
        chown root:$group $localsitelibrary 2> /dev/null || true
    fi

    #if [ -x /usr/bin/mktexlsr ]; then
    #  mktexlsr /usr/share/texmf
    #fi
    ;;
  abort-upgrade|abort-remove|abort-deconfigure)
    ;;
  *)
    echo "postinst called with unknown argument \`$1'" >&2
    ;;
esac