~jocave/checkbox/hybrid-amd-gpu-mods

« back to all changes in this revision

Viewing changes to checkbox-old/scripts/sources_test

  • Committer: Tarmac
  • Author(s): Brendan Donegan
  • Date: 2013-06-03 11:12:58 UTC
  • mfrom: (2154.2.1 bug1185759)
  • Revision ID: tarmac-20130603111258-1b3m5ydvkf1accts
"[r=zkrynicki][bug=1185759][author=brendan-donegan] automatic merge by tarmac"

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
result=0
 
4
 
 
5
sources_list=$1
 
6
repositories=$2
 
7
 
 
8
if [ -z "$sources_list" ]; then
 
9
    echo "Must provide sources list location, e.g. /etc/apt/sources.list"
 
10
    exit 1
 
11
fi
 
12
 
 
13
if [ -z "$repositories" ]; then
 
14
    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'"
 
15
    exit 1
 
16
fi
 
17
 
 
18
IFS=$','
 
19
for repository in $repositories; do
 
20
    if grep -q "$repository" "$sources_list"; then
 
21
        echo "$repository found in $sources_list"
 
22
    else
 
23
        echo "$repository not found in $sources_list"
 
24
        result=1
 
25
    fi
 
26
done
 
27
 
 
28
exit $result