File: variables

package info (click to toggle)
playonlinux 4.3.4-5
  • links: PTS, VCS
  • area: contrib
  • in suites: trixie
  • size: 8,252 kB
  • sloc: sh: 5,390; python: 5,150; ansic: 72; makefile: 57; xml: 47
file content (111 lines) | stat: -rwxr-xr-x 3,224 bytes parent folder | download | duplicates (4)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash

# Copyright (C) 2007-2010 PlayOnLinux Team
# Copyright (C) 2011 Pâris Quentin

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

##
## Hack for El Capitain
[ ! "$WRITE_LD" = "" ] && export LD_LIBRARY_PATH="$WRITE_LD"
[ ! "$WRITE_DYLD" = "" ] && export DYLD_LIBRARY_PATH="$WRITE_DYLD"

# This is just a copy of function in playonlinux, but we need it earlier
[ "$POL_OS" = "Mac" ] && export LANG="$RLANG"
POL_Config_pRead (){ cat "$POL_USER_ROOT/playonlinux.cfg" 2> /dev/null | grep "^$1=" | cut -d\= -f2-; }

### Follow symlinks for find
alias find="find -H"

### Security feature
[ "$(which sudo)" ] && sudo -k 2> /dev/null

### Terminal
# User override, must support -T to set title and -e to run a command
# gnome-terminal doesn't support -T, use gnome-terminal.wrapper instead
POL_TERM="$(POL_Config_pRead POL_TERM)"

if [ -z "$POL_TERM" ] || ! type -p "$POL_TERM" >&/dev/null; then
	# Debian
	if type -p x-terminal-emulator >&/dev/null; then
		POL_TERM="x-terminal-emulator"
	fi
	# Add support for more distros or desktop specific mechanisms here
fi

# Fallback
if [ -z "$POL_TERM" ] || ! type -p "$POL_TERM" >&/dev/null; then
	POL_TERM="xterm"
fi
export POL_TERM

### Desktop
[ "$(which xdg-user-dir)" ] && export DESKTOP="$(xdg-user-dir DESKTOP)" || export DESKTOP="$HOME/Desktop"

### Override ~/.wgetrc
export WGETRC="$POL_USER_ROOT/configurations/wgetrc"

### Language
if [ ! "$NOGETTEXT" = "TRUE" ] || [ "$(POL_Config_pRead NOGETTEXT)" = "TRUE" ]
then

[ "$DEBIAN_PACKAGE" = "FALSE" ] && export TEXTDOMAINDIR="$PLAYONLINUX/lang/locale/"
export TEXTDOMAIN="pol"
. gettext.sh
eval_gettext > /dev/null || eval_gettext() { printf "$@"; }
else
	eval_gettext() { printf "$@"; }
fi

which shasum > /dev/null 2> /dev/null || shasum () { sha1sum "$@"; }


if [ "$POL_OS" == "Linux" ]
then
	export POL_LANG="$(echo "$LANG" | cut -d\_ -f 1)"
	export MD5_COMMAND="md5sum"
	export SED="sed"
fi

if [ "$POL_OS" == "Mac" ]
then
	export POL_LANG="$(echo "$RLANG" | cut -d _ -f1)"
	export MD5_COMMAND="md5"
	export SED="sed"
fi

if [ "$POL_OS" == "FreeBSD" ]
then
	export POL_LANG="$(echo "$LANG" | cut -d\_ -f 1)"
	export MD5_COMMAND="md5"
	export SED="gsed"
fi

# Exit codes
EXIT_ERROR=255
EXIT_SUCCES=0

# Default architecture
export POL_USER_ARCH="x86"
export POL_ARCH="$POL_USER_ARCH"

# Miscellaneous stuff
export IGNORE_ICON_DIR="false"
export GNUPGHOME="$REPERTOIRE/gpg"


# Drivers issue
[ "$(POL_Config_pRead FIX_DRI_PATH)" = "TRUE" ] && [ "$POL_OS" = "Linux" ] && export LIBGL_DRIVERS_PATH="/usr/lib/dri/:/usr/lib64/dri/:/usr/lib32/dri/"
unset WINEARCH