Changeset e01392dc


Ignore:
Timestamp:
03/08/14 12:15:53 (9 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
5a917f1
Parents:
cdfb605
Message:

Fix a bug detecting a second type of package conflict, which of course uses a *different*
syntax than the first...

File:
1 edited

Legend:

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

    rcdfb605 re01392dc  
    457457  pkg-static ${1} 2>&1| tee /tmp/.pkgConflicts.$$ 
    458458 
    459   cat /tmp/.pkgConflicts.$$ | grep -q "WARNING: locally installed" 
     459  cat /tmp/.pkgConflicts.$$ | grep -q -e "WARNING: locally installed" -e "Conflict found" 
    460460  if [ $? -ne 0 ] ; then rm /tmp/.pkgConflicts.$$ ; return ; fi 
    461461 
     
    466466  # Nice ugly sed line, sure this can be neater 
    467467  cat /tmp/.pkgConflicts.$$ | grep 'WARNING: locally installed' \ 
    468         | sed 's|.*installed ||g' | sed 's| conflicts.*||g' | sort | uniq \ 
    469         > /tmp/.pkgConflicts.$$.2 
     468        | sed 's|.*installed ||g' | sed 's| conflicts.*||g' > /tmp/.pkgConflicts.$$.2 
     469 
     470  # Grab other style conflicts 
     471  cat /tmp/.pkgConflicts.$$ | grep "Conflict found on path" | cut -d ')' -f 2 | cut -d '(' -f 1 | awk '{print $2}' >> /tmp/.pkgConflicts.$$.2 
     472 
     473  # Get a sorted unique list 
     474  cat /tmp/.pkgConflicts.$$.2 | sort | uniq > /tmp/.pkgConflicts.$$.3 
    470475 
    471476  # Check how many conflicts we found 
    472   found=`wc -l /tmp/.pkgConflicts.$$.2 | awk '{print $1}'` 
     477  found=`wc -l /tmp/.pkgConflicts.$$.3 | awk '{print $1}'` 
    473478  if [ "$found" = "0" ] ; then 
    474479     rm /tmp/.pkgConflicts.$$ 
    475480     rm /tmp/.pkgConflicts.$$.2 
     481     rm /tmp/.pkgConflicts.$$.3 
    476482     return 0 
    477483  fi 
     
    480486  do 
    481487    cList="$line $cList" 
    482   done < /tmp/.pkgConflicts.$$.2 
    483   rm /tmp/.pkgConflicts.$$.2  
     488  done < /tmp/.pkgConflicts.$$.3 
     489  rm /tmp/.pkgConflicts.$$.3 
     490  rm /tmp/.pkgConflicts.$$.2 
    484491  rm /tmp/.pkgConflicts.$$ 
    485492 
     
    518525     # If EVENT_PIPE is set, unset it, seems to cause some weird crash in pkgng 1.2.3 
    519526     if [ -n "$EVENT_PIPE" ] ; then 
    520         oEP="$EVENT_PIPE" 
    521527        unset EVENT_PIPE 
    522528     fi 
     
    525531     pkg delete -q -y -f ${bPkg} 
    526532 
    527      # Reset EVENT_PIPE if we need to 
    528      if [ -n "$oEP" ] ; then 
    529         EVENT_PIPE="$oEP"; export EVENT_PIPE 
    530         unset oEP 
    531      fi 
    532533  done 
    533534 
Note: See TracChangeset for help on using the changeset viewer.