[BACK]Return to update_openbsd CVS log [TXT][DIR] Up to [local] / openbsd / update_openbsd

Diff for /openbsd/update_openbsd/update_openbsd between version 1.15 and 1.16

version 1.15, 2008/11/19 23:02:38 version 1.16, 2009/01/13 21:47:49
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 # $RedRiver: update_openbsd,v 1.14 2008/11/19 22:38:00 andrew Exp $  # $RedRiver: update_openbsd,v 1.15 2008/11/19 23:02:38 andrew Exp $
   
 installed_sets() {  installed_sets() {
     local misc=/usr/share/doc/README      local misc=/usr/share/doc/README
Line 25 
Line 25 
     done      done
 }  }
   
 sets_exist () {  version_in() {
         local _proto=${FTP%%://*}          local _proto=${FTP%%://*}
           local _file
   
         if [ X"ftp" == X"${_proto}" ]; then          if [ X"ftp" == X"${_proto}" ]; then
             echo "ls base*.tgz" | ${FTP_CMD} ${FTP}/ | awk '{ print $9 }'              local _list=`echo "ls base*.tgz" | ${FTP_CMD} ${FTP}/`
               _file=`echo ${_list} | awk '/base[0-9][0-9].tgz/ { print $9 }'`
   
         elif [ X"http" == X"${_proto}" ]; then          elif [ X"http" == X"${_proto}" ]; then
             ${FTP_CMD} -V -o - ${FTP}/ |              local _list=`${FTP_CMD} -V -o - ${FTP}/`
                 awk '/[^x]base[0-9][0-9]*\.tgz/ {              _file=`echo ${_list} | awk '/[^x]base[0-9][0-9]*\.tgz/ {
                     sub("^.*base","base");                      sub("^.*base","base");
                     sub("\.tgz.*",".tgz");                      sub("\.tgz.*",".tgz");
                     print $0;                      print $0;
                 }'                  }'`
   
         elif [ X"scp" == X"${_proto}" ]; then          elif [ X"scp" == X"${_proto}" ]; then
             echo SCP is not yet supported >&2              echo SCP is not yet supported >&2
Line 48 
Line 50 
             return 2              return 2
   
         fi          fi
   
           local _v=${_file##*base}
           _v=${_v%.tgz*}
           echo $_v
 }  }
   
 set_version() {  set_version() {
Line 92 
Line 98 
         fi          fi
         FTP=${MIRROR}/${_dir}/`machine`          FTP=${MIRROR}/${_dir}/`machine`
   
         _file=`sets_exist`          _v=`version_in`
   
         if [ X"" == X"${_file}" ]; then          if [ X"" == X"${_v}" ]; then
             if [ X"No" != X"$FORCE_DIR" ]; then              if [ X"No" != X"$FORCE_DIR" ]; then
                 echo No sets in forced [${FTP}] >&2                  echo No sets in forced [${FTP}] >&2
                 return 2                  return 2
Line 104 
Line 110 
             _dir=${NEW_VER}              _dir=${NEW_VER}
             FTP=${MIRROR}/${_dir}/`machine`              FTP=${MIRROR}/${_dir}/`machine`
   
             _file=`sets_exist`              _v=`version_in`
             if [ X"" == X"${_file}" ]; then  
                 echo No sets in [${FTP}] >&2  
                 return 2  
             fi  
         fi          fi
   
         _v=${_file##*base}  
         _v=${_v%.tgz*}  
   
         if [ X"" == X"${_v}" ]; then          if [ X"" == X"${_v}" ]; then
             echo No version in file [$_file] >&2              echo No sets in [${FTP}] >&2
             return 2              return 2
         elif [ X"${_cv}" == X"${_v}" ]; then          elif [ X"${_cv}" == X"${_v}" ]; then
             NEW_VER=$CUR_VER              NEW_VER=$CUR_VER

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>