Merge lp:~salgado/linaro-image-tools/bug-637419 into lp:linaro-image-tools/11.11

Proposed by Guilherme Salgado
Status: Merged
Approved by: James Westby
Approved revision: 72
Merged at revision: 76
Proposed branch: lp:~salgado/linaro-image-tools/bug-637419
Merge into: lp:linaro-image-tools/11.11
Diff against target: 57 lines (+12/-9)
1 file modified
linaro-hwpack-install (+12/-9)
To merge this branch: bzr merge lp:~salgado/linaro-image-tools/bug-637419
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+35453@code.launchpad.net

Description of the change

Make sure the packages contained in the hwpack take precedence over the ones coming from other sources. Also fixes handling of the --install-latest argument.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

Looks good.

Thanks,

James

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'linaro-hwpack-install'
2--- linaro-hwpack-install 2010-09-13 14:47:36 +0000
3+++ linaro-hwpack-install 2010-09-14 18:15:55 +0000
4@@ -25,8 +25,9 @@
5 LOCKFILE="/var/lock/hwpack"
6 TEMP_DIR=$(mktemp -d)
7 HWPACK_DIR="${TEMP_DIR}/unpacked"
8-HWPACK_PKGS_SOURCE=/etc/apt/sources.list.d/hwpack-pkgs.list
9-INSTALL_LATEST=0
10+INSTALL_LATEST="no"
11+SOURCES_LIST_FILE="${TEMP_DIR}/sources.list"
12+APT_GET_OPTIONS="Dir::Etc::SourceList=${SOURCES_LIST_FILE}"
13
14 die() {
15 echo -e "$@"
16@@ -42,7 +43,7 @@
17 if [ $1 != "--install-latest" ]; then
18 die "Unknown argument: $1 \n$usage_msg"
19 fi
20- INSTALL_LATEST=$1
21+ INSTALL_LATEST="yes"
22 HWPACK_TARBALL=$2
23 else
24 die $usage_msg
25@@ -57,7 +58,6 @@
26 # Ensure our temp dir and apt sources are removed.
27 echo -n "Cleaning up ..."
28 rm -rf $TEMP_DIR
29- sudo rm -f $HWPACK_PKGS_SOURCE
30 sudo apt-get update -qq
31 echo "Done"
32 }
33@@ -99,16 +99,19 @@
34 sudo apt-key add $file
35 done
36
37-# Add one extra apt source for the packages included in the hwpack.
38-sudo sh -c "echo deb file:${HWPACK_DIR}/pkgs ./ > $HWPACK_PKGS_SOURCE"
39+# Add one extra apt source for the packages included in the hwpack and make
40+# sure it's the first on the list of sources so that it gets precedence over
41+# the others.
42+echo "deb file:${HWPACK_DIR}/pkgs ./" > "$SOURCES_LIST_FILE"
43+cat /etc/apt/sources.list >> "$SOURCES_LIST_FILE"
44
45-sudo apt-get update -qq
46+sudo apt-get -o "$APT_GET_OPTIONS" update -qq
47
48 echo -n "Installing packages ..."
49-if [ $INSTALL_LATEST -ne 0 ]; then
50+if [ "$INSTALL_LATEST" == "no" ]; then
51 packages=`sed 's/=.*//' "${HWPACK_DIR}"/manifest`
52 else
53 packages=`cat "${HWPACK_DIR}"/manifest`
54 fi
55-sudo apt-get install $packages
56+sudo apt-get -o "$APT_GET_OPTIONS" install $packages
57 echo "Done"

Subscribers

People subscribed via source and target branches