aboutsummaryrefslogtreecommitdiff
path: root/linaro-hwpack-install
diff options
context:
space:
mode:
authorGuilherme Salgado <salgado@canonical.com>2010-09-17 15:33:07 -0300
committerGuilherme Salgado <salgado@canonical.com>2010-09-17 15:33:07 -0300
commit85a5b20aac71eed7bc566cde4973ca6c1df23877 (patch)
tree709d23840c3235c9a4b59d6db72ea56f0766e1e4 /linaro-hwpack-install
parent15fa35d12cb16e2c08ec5bc690f4d5b5a515f347 (diff)
Change linaro-hwpack-install to only install the sources.list.d files that have at least one line not present in the existing apt sources
Diffstat (limited to 'linaro-hwpack-install')
-rwxr-xr-xlinaro-hwpack-install12
1 files changed, 6 insertions, 6 deletions
diff --git a/linaro-hwpack-install b/linaro-hwpack-install
index 4acf3d7..694a43f 100755
--- a/linaro-hwpack-install
+++ b/linaro-hwpack-install
@@ -83,15 +83,15 @@ 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
+ should_install=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/* && found=1 && continue
- grep -q "$line" /etc/apt/sources.list && found=1 && continue
+ # Only install files that have at least one line not present in the
+ # existing sources lists.
+ grep -q "$line" /etc/apt/sources.list.d/* /etc/apt/sources.list \
+ || should_install=1
done < $file
- if [ $found -eq 0 ]; then
+ if [ $should_install -eq 1 ]; then
sudo cp $file /etc/apt/sources.list.d/hwpack.$filename
fi
done