diff options
author | Guilherme Salgado <salgado@canonical.com> | 2010-09-16 12:11:29 -0300 |
---|---|---|
committer | Guilherme Salgado <salgado@canonical.com> | 2010-09-16 12:11:29 -0300 |
commit | 15fa35d12cb16e2c08ec5bc690f4d5b5a515f347 (patch) | |
tree | 430cefd09b2397a4472986d41a20d59170b232cb /linaro-hwpack-install | |
parent | 7527e8ca96a8dcc18c6aeaf4bf89fb006dc6f8f4 (diff) |
Make sure we don't add duplicate apt sources when installing a hardware pack
Diffstat (limited to 'linaro-hwpack-install')
-rwxr-xr-x | linaro-hwpack-install | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/linaro-hwpack-install b/linaro-hwpack-install index d730de2..4acf3d7 100755 --- a/linaro-hwpack-install +++ b/linaro-hwpack-install @@ -83,14 +83,17 @@ HWPACK_ARCH=`grep ARCHITECTURE "${HWPACK_DIR}/metadata" | cut -d "=" -f2` # Install the apt sources that contain the packages we need. for filename in $(ls "${HWPACK_DIR}"/sources.list.d/); do file="${HWPACK_DIR}"/sources.list.d/$filename + found=0 while read line; do # Skip any files that contain lines that are already present in the apt # configuration. - grep -q "$line" /etc/apt/sources.list.d/* && continue - grep -q "$line" /etc/apt/sources.list && continue + grep -q "$line" /etc/apt/sources.list.d/* && found=1 && continue + grep -q "$line" /etc/apt/sources.list && found=1 && continue done < $file - sudo cp $file /etc/apt/sources.list.d/hwpack.$filename + if [ $found -eq 0 ]; then + sudo cp $file /etc/apt/sources.list.d/hwpack.$filename + fi done # Import the OpenPGP keys for the files installed above. |