summaryrefslogtreecommitdiff
path: root/bin/sources_test
diff options
authorShih-Yuan Lee (FourDollars) <sylee@canonical.com>2020-05-14 16:07:58 +0800
committerShih-Yuan Lee (FourDollars) <sylee@canonical.com>2020-05-14 16:07:58 +0800
commita53f8be38b7ddbde49ea7cac57af669c5574fb9c (patch)
tree432c33bf7bdfb1d99deaaf785adfbdf743a6d487 /bin/sources_test
parent8d51069b072be77dc95d8492bf9be0b3cc2a14b8 (diff)
bin/sources_test: check the boundary of source list.
Diffstat (limited to 'bin/sources_test')
-rwxr-xr-xbin/sources_test8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/sources_test b/bin/sources_test
index a63c5b9..3d4f695 100755
--- a/bin/sources_test
+++ b/bin/sources_test
@@ -11,16 +11,16 @@ if [ -z "$sources_list" ]; then
fi
if [ -z "$repositories" ]; then
- echo "Must provide list of repositories to check for, e.g. 'deb http://gb.archive.ubuntu.com/ubuntu/ precise multiverse, deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse'"
+ echo "Must provide list of repositories to check for, e.g. 'deb http://gb.archive.ubuntu.com/ubuntu/ precise multiverse,deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse'"
exit 1
fi
IFS=$','
for repository in $repositories; do
- if grep -q "$repository" "$sources_list"; then
- echo "$repository found in $sources_list"
+ if grep -q "^$repository$" "$sources_list"; then
+ echo "'$repository' found in $sources_list"
else
- echo "$repository not found in $sources_list"
+ echo "'$repository' not found in $sources_list"
result=1
fi
done