Merge lp:~notnownikki/offspring/retry-apt-get into lp:offspring

Proposed by Nicola Heald
Status: Merged
Approved by: Timothy R. Chavez
Approved revision: 162
Merged at revision: 161
Proposed branch: lp:~notnownikki/offspring/retry-apt-get
Merge into: lp:offspring
Diff against target: 23 lines (+11/-2)
1 file modified
lib/offspring/build/wrappers/lb.sh (+11/-2)
To merge this branch: bzr merge lp:~notnownikki/offspring/retry-apt-get
Reviewer Review Type Date Requested Status
Offspring Committers Pending
Review via email: mp+163860@code.launchpad.net

Description of the change

Tries the apt-get command up to 5 times.

To post a comment you must log in.
Revision history for this message
Kevin McDermott (bigkevmcd) wrote :

Am not sure this actually does what the card indicates it should do.

I think it should check for the lock, and continue (bonus points for use of lockfile to wait for it to be ready to go).

Revision history for this message
Nicola Heald (notnownikki) wrote :

Then we need to discuss it again, as this was the fix we agreed on when then card was moved into not started.

162. By Nicola Heald

10 retries, 30 second delay

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/offspring/build/wrappers/lb.sh'
2--- lib/offspring/build/wrappers/lb.sh 2012-05-10 01:08:54 +0000
3+++ lib/offspring/build/wrappers/lb.sh 2013-05-15 13:02:26 +0000
4@@ -8,8 +8,17 @@
5
6 TARGETFS="${IBS_WORK_DIR}/${PROJECT}/chroot"
7
8- sudo apt-get update -o Acquire::http::No-Cache=True
9- ERROR=$?
10+ for APT_GET_TRIES in 1 2 3 4 5 6 7 8 9 10
11+ do
12+ sudo apt-get update -o Acquire::http::No-Cache=True
13+ ERROR=$?
14+ if [ "${ERROR}" != "0" ]; then
15+ Info "Retrying apt-get update in preperation of getting latest live-build"
16+ sleep 30
17+ else
18+ break;
19+ fi
20+ done
21 if [ "${ERROR}" != "0" ]; then
22 Error "Error running apt-get update in preperation of getting latest live-build"
23 Die

Subscribers

People subscribed via source and target branches