Committed by
Gerrit Code Review
use dialect-agnostic regexes in onos scripts
Change-Id: Ifd828fd2bc130598d796ac4d786c77ba31365d8e
Showing
2 changed files
with
4 additions
and
4 deletions
... | @@ -7,7 +7,7 @@ cd $ONOS_ROOT | ... | @@ -7,7 +7,7 @@ cd $ONOS_ROOT |
7 | 7 | ||
8 | projects=$(find $ONOS_ROOT -type f -path '*/src/*' \ | 8 | projects=$(find $ONOS_ROOT -type f -path '*/src/*' \ |
9 | -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \ | 9 | -exec $ONOS_ROOT/tools/dev/bin/onos-build-selective-hook {} \; | \ |
10 | - grep -v -f $ONOS_ROOT/tools/dev/bin/onos-build-selective.exclude | \ | 10 | + egrep -v -f $ONOS_ROOT/tools/dev/bin/onos-build-selective.exclude | \ |
11 | sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \ | 11 | sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \ |
12 | sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g') | 12 | sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g') |
13 | 13 | ||
... | @@ -16,7 +16,7 @@ if [ -n "$projects" ]; then | ... | @@ -16,7 +16,7 @@ if [ -n "$projects" ]; then |
16 | modulesERE="" | 16 | modulesERE="" |
17 | for pd in ${projects//,/ }; do | 17 | for pd in ${projects//,/ }; do |
18 | if [ -f ${pd}/pom.xml ]; then | 18 | if [ -f ${pd}/pom.xml ]; then |
19 | - artifactId=$(grep -E "^ <artifactId>.*</artifactId>$" ${pd}/pom.xml | \ | 19 | + artifactId=$(egrep -E "^ <artifactId>.*</artifactId>$" ${pd}/pom.xml | \ |
20 | sed 's/.[^>]*>//;s/<.*//') | 20 | sed 's/.[^>]*>//;s/<.*//') |
21 | modulesERE="$modulesERE|$artifactId" | 21 | modulesERE="$modulesERE|$artifactId" |
22 | fi | 22 | fi |
... | @@ -26,7 +26,7 @@ if [ -n "$projects" ]; then | ... | @@ -26,7 +26,7 @@ if [ -n "$projects" ]; then |
26 | # Search through staged app.xml files for any apps that require one or | 26 | # Search through staged app.xml files for any apps that require one or |
27 | # more of the modified artifacts. | 27 | # more of the modified artifacts. |
28 | appProjects=$(find $ONOS_ROOT -type f -path '*/target/oar/app.xml' | \ | 28 | appProjects=$(find $ONOS_ROOT -type f -path '*/target/oar/app.xml' | \ |
29 | - xargs grep '<artifact>' | grep -E "/($modulesERE)/" | \ | 29 | + xargs egrep '<artifact>' | egrep -E "/($modulesERE)/" | \ |
30 | cut -d: -f1 | sed 's:/target/oar/.*::g' | \ | 30 | cut -d: -f1 | sed 's:/target/oar/.*::g' | \ |
31 | sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \ | 31 | sort -u | sed "s:$ONOS_ROOT::g" | tr '\n' ',' | \ |
32 | sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g') | 32 | sed 's:/,:,:g;s:,/:,:g;s:^/::g;s:,$::g') | ... | ... |
... | @@ -17,7 +17,7 @@ export STAGE=$(dirname $KARAF_ROOT) | ... | @@ -17,7 +17,7 @@ export STAGE=$(dirname $KARAF_ROOT) |
17 | # Validates the specified IP regular expression against existing adapters. | 17 | # Validates the specified IP regular expression against existing adapters. |
18 | # Excludes local-loopback. | 18 | # Excludes local-loopback. |
19 | function validateIp { | 19 | function validateIp { |
20 | - ifconfig | awk '{ print $2}' | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | grep $1 | 20 | + ifconfig | sed -ne 's:inet[^6][ adr:]*\([0-9.]*\).*:\1: p' | grep $1 |
21 | } | 21 | } |
22 | 22 | ||
23 | # Parse optional arguments | 23 | # Parse optional arguments | ... | ... |
-
Please register or login to post a comment