From 85a5b20aac71eed7bc566cde4973ca6c1df23877 Mon Sep 17 00:00:00 2001 From: Guilherme Salgado Date: Fri, 17 Sep 2010 15:33:07 -0300 Subject: 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 --- linaro-hwpack-install | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'linaro-hwpack-install') 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 -- cgit v1.2.3