From 14d27be6552b694826a5170394b6227c6a25d0cf Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 12 Jan 2014 19:58:00 +0100 Subject: [PATCH] autoport: find_requirements(): fix parsing for 'is needed by' --- autoport | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/autoport b/autoport index 032865b..daedbba 100755 --- a/autoport +++ b/autoport @@ -198,25 +198,18 @@ function find_requirements() { local OUTFILE=$1 if [ "`grep " is needed by " $OUTFILE`" ]; then - grep " is needed by " $OUTFILE | while read line; do - set -- $line - if [ "$2" = "=" -o "$2" = ">=" ]; then - awk '{ print $1#$3 }' | sort -u > $tf1 - else - awk '{ print $1 }' | sort -u > $tf1 - fi - done + grep " is needed by " $OUTFILE | awk '{ print $1 }' | tr -d \' > $tf1 elif [ "`grep " matches no packages" $OUTFILE`" ]; then - grep " matches no packages" $OUTFILE | awk '{ print $2 }' | tr -d \' | sort -u > $tf1 + grep " matches no packages" $OUTFILE | awk '{ print $2 }' | tr -d \' > $tf1 elif [ "`grep " no package provides " $OUTFILE`" ]; then - grep " no package provides " $OUTFILE | sed "s|.* no package provides ||" | sort -u > $tf1 + grep " no package provides " $OUTFILE | sed "s|.* no package provides ||" > $tf1 fi [ `stat -c %s $tf1` -gt 0 ] && { echo -n " | missing requirements: " > $tf - cat $tf1 | while read line; do - REQ=`find_source_by_provide $PORT_REPOSITORY $line` + sort -u $tf1 | while read line; do + REQ=`find_source_by_provide $PORT_REPOSITORY ${line}` [ "$REQ" ] && \ echo "${REQ}" >> $tf || \ echo -n "$line(unresolved) "