Changeset 8506de1f


Ignore:
Timestamp:
12/10/13 12:47:26 (11 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
3fdf640
Parents:
d2087999
Message:

Remove some of the old download_cache_package functionality, since it
has been obsoleted by newer PKGNG. Will be implementing a newer method
of communicating with GUI front-ends shortly.

Location:
src-sh
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-sh/libsh/functions.sh

    r2b62dde r8506de1f  
    77 
    88PCBSD_ETCCONF="/usr/local/etc/pcbsd.conf" 
    9  
    10 download_cache_packages() 
    11 { 
    12   if [ ! -e "/usr/local/etc/pkg.conf" ] ; then 
    13     exit_err "No /usr/local/etc/pkg.conf!" 
    14   fi 
    15  
    16   # Tickle pkg update first 
    17   pkg-static update 
    18   local ARCH="`uname -m`" 
    19  
    20   ${1} > /tmp/.pkgUpList.$$ 
    21  
    22   while read line 
    23   do 
    24      lTag=`echo $line | awk '{print $1}'`  
    25      case $lTag in 
    26     Upgrading|Downgrading) pkgList="`echo $line | awk '{print $2}' | sed 's|:||g'`-`echo $line | awk '{print $5}'`.txz $pkgList" ;; 
    27  Reinstalling) pkgList="`echo $line | awk '{print $2}'`.txz $pkgList" ;; 
    28    Installing) pkgList="`echo $line | awk '{print $2}' | sed 's|:||g'`-`echo $line | awk '{print $3}'`.txz $pkgList" ;; 
    29                     *) continue ;; 
    30      esac 
    31  
    32   done < /tmp/.pkgUpList.$$ 
    33   rm /tmp/.pkgUpList.$$ 
    34  
    35   # Get the PKG_CACHEDIR 
    36   PKG_CACHEDIR="/var/cache/pkg" 
    37   cat /usr/local/etc/pkg.conf | grep -q "^PKG_CACHEDIR:" 
    38   if [ $? -eq 0 ] ; then 
    39     PKG_CACHEDIR="`grep '^PKG_CACHEDIR:' /usr/local/etc/pkg.conf | awk '{print $2}'`" 
    40   fi 
    41   if [ -z "$PKG_CACHEDIR" ] ; then 
    42      exit_err "Failed getting PKG_CACHEDIR" 
    43   fi 
    44   export PKG_CACHEDIR 
    45  
    46   # Where are the packages on our mirrors? 
    47   cat /usr/local/etc/pkg.conf | grep -q "^packagesite:" 
    48   if [ $? -ne 0 ] ; then 
    49      exit_err "Failed getting packagesite:" 
    50   fi 
    51   pkgUrl="`grep '^packagesite:' /usr/local/etc/pkg.conf | awk '{print $2}' | sed 's|pkg+||g'`" 
    52  
    53   if [ ! -d "$PKG_CACHEDIR/All" ] ; then 
    54      mkdir -p ${PKG_CACHEDIR}/All 
    55   fi 
    56  
    57   for i in $pkgList 
    58   do 
    59     # Does the package already exist? 
    60     if [ -e "${PKG_CACHEDIR}/All/${i}" ] ; then  
    61         # Once bapt gives us a working rquery string, we can add a check here to skip 
    62         # re-downloading already valid files 
    63         #pName=`echo $i | sed 's|.txz$||g'` 
    64         # Check the sizes 
    65         #eSize=`pkg rquery "%sb" $pName` 
    66         #dSize=`ls -al ` 
    67         #rm ${PKG_CACHEDIR}/All/${i} ;  
    68     fi 
    69     get_file "${pkgUrl}/All/${i}" "${PKG_CACHEDIR}/All/${i}" 
    70     if [ $? -ne 0 ] ; then 
    71       echo "Failed downloading: ${pkgUrl}/All/${i}" 
    72       return 1 
    73     fi 
    74   done 
    75   return 0 
    76 } 
    779 
    7810get_mirror() { 
  • src-sh/pc-metapkgmanager/pc-metapkgmanager

    r565a343 r8506de1f  
    7575        fi 
    7676 
    77         # Lets pre-download all packages 
    78         download_cache_packages "pkg-static install -U -n $pkgName" 
    79  
    8077        # Lets check for any conflicts doing this install 
    8178        check_pkg_conflicts "install -FUy $pkgName" 
     
    304301   done 
    305302 
    306    # Lets pre-download all packages 
    307    download_cache_packages "pkg $op $flags" 
    308  
    309303   # Lets check for any conflicts doing this install 
    310304   check_pkg_conflicts "${op} -FUy $flags" 
     
    316310   pkg $fullopts  
    317311   result=$? 
     312 
     313   # Set PKG_CACHEDIR 
     314   PKG_CACHEDIR="`pkg config PKG_CACHEDIR`" 
    318315 
    319316   # Nobody likes a litter bug 
  • src-sh/pc-updatemanager/pc-updatemanager

    rd04f1ac8 r8506de1f  
    428428  fi 
    429429 
    430   # Lets pre-download all packages 
    431   echo "Downloading updated packages..." 
    432   download_cache_packages "pkg-static upgrade -fn" 
    433   if [ $? -ne 0 ] ; then 
    434      echo "Warning: Failed running 'pkg-static upgrade -fn'" 
    435      echo "Press ENTER to continue" 
    436      read tmp 
    437   fi 
    438  
    439430  # Now its time to force a pkg-update of all packages to their new FreeBSD compiled versions 
    440   SKIP_CACHE_PKGS="YES" ; export SKIP_CACHE_PKGS 
    441431  pc-updatemanager pkgupdate -f 
    442432  if [ $? -ne 0 ] ; then 
     
    590580  fi 
    591581 
    592   # If we aren't instructed to skip the package cache process 
    593   if [ -z "$SKIP_CACHE_PKGS" ] ; then 
    594     # Lets pre-download all the packages 
    595     download_cache_packages "pkg-static upgrade -U -n $1" 
    596   fi 
    597  
    598582  check_pkg_conflicts "upgrade -FUy $1" 
    599583  if [ $? -ne 0 ] ; then 
Note: See TracChangeset for help on using the changeset viewer.