Magellan Linux

Diff of /trunk/pkgtools/up2date.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2017 by niro, Thu Jan 3 10:02:24 2013 UTC revision 2111 by niro, Mon May 13 11:40:55 2013 UTC
# Line 4  source /usr/lib/mage/mage4.functions.sh Line 4  source /usr/lib/mage/mage4.functions.sh
4  source /usr/lib/mage/smage2.functions.sh  source /usr/lib/mage/smage2.functions.sh
5    
6  # timeout in seconds  # timeout in seconds
7  LYNX_CONNECT_TIMEOUT=30  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"
# Line 77  urlencode() Line 78  urlencode()
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   grep "\(\.${suffix}\)\(\$\|\#\)" | sed -n "s/.*-\(.*\)\(\.${suffix}\).*/\1/;$ p"   if [[ ! -z ${UP2EXCLUDE} ]]
90     then
91     grep "\(\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed -n "s/.*${seperator}\(.*\)\(\.${suffix}\).*/\1/;$ p"
92     else
93     grep "\(\.${suffix}\)\(\$\|\#\)" | sed -n "s/.*${seperator}\(.*\)\(\.${suffix}\).*/\1/;$ p"
94     fi
95   ;;   ;;
96   *)   *)
97   grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | sed -n "s/.*-\(.*\)\(\.tar\.${suffix}\).*/\1/;$ p"   if [[ ! -z ${UP2EXCLUDE} ]]
98     then
99     grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed -n "s/.*${seperator}\(.*\)\(\.tar\.${suffix}\).*/\1/;$ p"
100     else
101     grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | sed -n "s/.*${seperator}\(.*\)\(\.tar\.${suffix}\).*/\1/;$ p"
102     fi
103   ;;   ;;
104   esac   esac
105  }  }
# Line 92  lasttarball() Line 107  lasttarball()
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   grep "\(\.${suffix}\)\(\$\|\#\)" | sed "s/.*-\(.*\)\(\.${suffix}\).*/\1/;q"   if [[ ! -z ${UP2EXCLUDE} ]]
119     then
120     grep "\(\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed "s/.*${seperator}\(.*\)\(\.${suffix}\).*/\1/;q"
121     else
122     grep "\(\.${suffix}\)\(\$\|\#\)" | sed "s/.*${seperator}\(.*\)\(\.${suffix}\).*/\1/;q"
123     fi
124   ;;   ;;
125   *)   *)
126   grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | sed "s/.*-\(.*\)\(\.tar\.${suffix}\).*/\1/;q"   if [[ ! -z ${UP2EXCLUDE} ]]
127     then
128     grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | grep -v -- "${UP2EXCLUDE}" | sed "s/.*${seperator}\(.*\)\(\.tar\.${suffix}\).*/\1/;q"
129     else
130     grep "\(\.tar\.${suffix}\)\(\$\|\#\)" | sed "s/.*${seperator}\(.*\)\(\.tar\.${suffix}\).*/\1/;q"
131     fi
132   ;;   ;;
133   esac   esac
134  }  }
# Line 110  updatecmd() Line 139  updatecmd()
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 '$@'"
# Line 536  updatecmd_freedesktop() Line 565  updatecmd_freedesktop()
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()

Legend:
Removed from v.2017  
changed lines
  Added in v.2111