5 |
|
|
6 |
# timeout in seconds |
# timeout in seconds |
7 |
LYNX_CONNECT_TIMEOUT=10 |
LYNX_CONNECT_TIMEOUT=10 |
8 |
|
LYNX_READ_TIMEOUT=10 |
9 |
|
|
10 |
## only for tests -> normally in /etc/rc.d/init.d/functions |
## only for tests -> normally in /etc/rc.d/init.d/functions |
11 |
COLRED="\033[1;6m\033[31m" |
COLRED="\033[1;6m\033[31m" |
78 |
lasttarball() |
lasttarball() |
79 |
{ |
{ |
80 |
local suffix=bz2 |
local suffix=bz2 |
81 |
|
local seperator="-" |
82 |
[[ ! -z $1 ]] && suffix="$1" |
[[ ! -z $1 ]] && suffix="$1" |
83 |
|
|
84 |
|
[[ ! -z ${UP2SEPERATOR} ]] && seperator="${UP2SEPERATOR}" |
85 |
|
[[ ${UP2SEPERATOR} = NULL ]] && seperator="" |
86 |
|
|
87 |
case ${suffix} in |
case ${suffix} in |
88 |
tbz2|tgz) |
tbz2|tgz) |
89 |
if [[ ! -z ${UP2EXCLUDE} ]] |
if [[ ! -z ${UP2EXCLUDE} ]] |
90 |
then |
then |
91 |
grep "\(\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed -n "s/.*-\(.*\)\(\.${suffix}\).*/\1/;$ p" |
grep "\(\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed -n "s/.*${seperator}\(.*\)\(\.${suffix}\).*/\1/;$ p" |
92 |
else |
else |
93 |
grep "\(\.${suffix}\)\(\$\|\#\)" | sed -n "s/.*-\(.*\)\(\.${suffix}\).*/\1/;$ p" |
grep "\(\.${suffix}\)\(\$\|\#\)" | sed -n "s/.*${seperator}\(.*\)\(\.${suffix}\).*/\1/;$ p" |
94 |
fi |
fi |
95 |
;; |
;; |
96 |
*) |
*) |
97 |
if [[ ! -z ${UP2EXCLUDE} ]] |
if [[ ! -z ${UP2EXCLUDE} ]] |
98 |
then |
then |
99 |
grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed -n "s/.*-\(.*\)\(\.tar\.${suffix}\).*/\1/;$ p" |
grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed -n "s/.*${seperator}\(.*\)\(\.tar\.${suffix}\).*/\1/;$ p" |
100 |
else |
else |
101 |
grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | sed -n "s/.*-\(.*\)\(\.tar\.${suffix}\).*/\1/;$ p" |
grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | sed -n "s/.*${seperator}\(.*\)\(\.tar\.${suffix}\).*/\1/;$ p" |
102 |
fi |
fi |
103 |
;; |
;; |
104 |
esac |
esac |
107 |
firsttarball() |
firsttarball() |
108 |
{ |
{ |
109 |
local suffix=bz2 |
local suffix=bz2 |
110 |
|
local seperator="-" |
111 |
[[ ! -z $1 ]] && suffix="$1" |
[[ ! -z $1 ]] && suffix="$1" |
112 |
|
|
113 |
|
[[ ! -z ${UP2SEPERATOR} ]] && seperator="${UP2SEPERATOR}" |
114 |
|
[[ ${UP2SEPERATOR} = NULL ]] && seperator="" |
115 |
|
|
116 |
case ${suffix} in |
case ${suffix} in |
117 |
tbz2|tgz) |
tbz2|tgz) |
118 |
if [[ ! -z ${UP2EXCLUDE} ]] |
if [[ ! -z ${UP2EXCLUDE} ]] |
119 |
then |
then |
120 |
grep "\(\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed "s/.*-\(.*\)\(\.${suffix}\).*/\1/;q" |
grep "\(\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed "s/.*${seperator}\(.*\)\(\.${suffix}\).*/\1/;q" |
121 |
else |
else |
122 |
grep "\(\.${suffix}\)\(\$\|\#\)" | sed "s/.*-\(.*\)\(\.${suffix}\).*/\1/;q" |
grep "\(\.${suffix}\)\(\$\|\#\)" | sed "s/.*${seperator}\(.*\)\(\.${suffix}\).*/\1/;q" |
123 |
fi |
fi |
124 |
;; |
;; |
125 |
*) |
*) |
126 |
if [[ ! -z ${UP2EXCLUDE} ]] |
if [[ ! -z ${UP2EXCLUDE} ]] |
127 |
then |
then |
128 |
grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed "s/.*-\(.*\)\(\.tar\.${suffix}\).*/\1/;q" |
grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed "s/.*${seperator}\(.*\)\(\.tar\.${suffix}\).*/\1/;q" |
129 |
else |
else |
130 |
grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | sed "s/.*-\(.*\)\(\.tar\.${suffix}\).*/\1/;q" |
grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | sed "s/.*${seperator}\(.*\)\(\.tar\.${suffix}\).*/\1/;q" |
131 |
fi |
fi |
132 |
;; |
;; |
133 |
esac |
esac |
139 |
local useragent |
local useragent |
140 |
[[ ! -z ${UP2USERAGENT} ]] && useragent="-useragent '${UP2USERAGENT}'" |
[[ ! -z ${UP2USERAGENT} ]] && useragent="-useragent '${UP2USERAGENT}'" |
141 |
|
|
142 |
uppver=$(lynx -connect_timeout=${LYNX_CONNECT_TIMEOUT} -dump "${useragent}" $@) |
uppver=$(lynx -connect_timeout=${LYNX_CONNECT_TIMEOUT} -read_timeout=${LYNX_READ_TIMEOUT} -dump "${useragent}" $@) |
143 |
if [[ $? -ne 0 ]] |
if [[ $? -ne 0 ]] |
144 |
then |
then |
145 |
echo "Error connecting '$@'" |
echo "Error connecting '$@'" |
565 |
[[ ! -z ${UP2TARBALL} ]] && tarballname="${UP2TARBALL}" |
[[ ! -z ${UP2TARBALL} ]] && tarballname="${UP2TARBALL}" |
566 |
|
|
567 |
# exclude rc versions! |
# exclude rc versions! |
568 |
updatecmd "http://${pname}.freedesktop.org/releases${subdir}" | grep ${tarballname}- | grep -v rc[0-9] | lasttarball "${archive}" |
updatecmd "http://${pname}.freedesktop.org/releases${subdir}?C=M;O=A" | grep ${tarballname}- | grep -v rc[0-9] | lasttarball "${archive}" |
569 |
} |
} |
570 |
|
|
571 |
updatecmd_xorg() |
updatecmd_xorg() |