Merge lp:~jamesodhunt/ubiquity/bug-944191 into lp:ubiquity

Proposed by James Hunt
Status: Superseded
Proposed branch: lp:~jamesodhunt/ubiquity/bug-944191
Merge into: lp:ubiquity
Diff against target: 52 lines (+20/-2) (has conflicts)
2 files modified
debian/changelog (+10/-1)
scripts/install.py (+10/-1)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~jamesodhunt/ubiquity/bug-944191
Reviewer Review Type Date Requested Status
Colin Watson Pending
Review via email: mp+98489@code.launchpad.net

This proposal supersedes a proposal from 2012-03-20.

This proposal has been superseded by a proposal from 2012-03-20.

Description of the change

  * scripts/install.py: Ignore mkdir failure if directory does (now)
    exist to accommodate update-apt-cache running in parallel with
    copy_all() (LP: #944191).

(Updated with Colins feedback).

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote : Posted in a previous version of this proposal

The style in ubiquity is to check specifically for OSError, rather than for the more general EnvironmentError. Doing so is safe in this case; you aren't going to get anything else from os.mkdir.

I don't think you need to recheck os.path.isdir; simply having got EEXIST from os.mkdir implies that. I would just write this as 'if e.errno != errno.EEXIST'.

review: Needs Fixing
lp:~jamesodhunt/ubiquity/bug-944191 updated
5282. By James Hunt

scripts/install.py: Ignore mkdir failure if directory does (now)
exist to accommodate update-apt-cache running in parallel with
copy_all() (LP: #944191).

Revision history for this message
Evan (ev) wrote : Posted in a previous version of this proposal

Make sure you have:

DEBCHANGE_RELEASE_HEURISTIC=changelog
DEBCHANGE_MULTIMAINT_MERGE=yes

in ~/.devscripts so that dch -U does the right thing.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-03-20 19:18:34 +0000
3+++ debian/changelog 2012-03-20 19:26:18 +0000
4@@ -1,9 +1,10 @@
5-ubiquity (2.9.31) UNRELEASED; urgency=low
6+ubiquity (2.9.31ubuntu1) UNRELEASED; urgency=low
7
8 [ Colin Watson ]
9 * Fix misc.set_indicator_keymaps to handle ll_CC forms of lang, and also
10 to avoid crashing on unknown languages in general (LP: #960047).
11
12+<<<<<<< TREE
13 [ Oliver Grawert ]
14 * add support for automatic-oem-config kernel commandline option to the
15 oem-config startup scripts to switch oem-config into automatic mode for
16@@ -13,6 +14,14 @@
17 * Properly mark the quit dialog as a child of ubiquity. (LP: #960375)
18
19 -- Stéphane Graber <stgraber@ubuntu.com> Tue, 20 Mar 2012 15:15:31 -0400
20+=======
21+ [ James Hunt ]
22+ * scripts/install.py: Ignore mkdir failure if directory does (now)
23+ exist to accommodate update-apt-cache running in parallel with
24+ copy_all() (LP: #944191).
25+
26+ -- James Hunt <james.hunt@ubuntu.com> Tue, 20 Mar 2012 14:26:00 +0000
27+>>>>>>> MERGE-SOURCE
28
29 ubiquity (2.9.30) precise; urgency=low
30
31
32=== modified file 'scripts/install.py'
33--- scripts/install.py 2012-02-16 02:47:22 +0000
34+++ scripts/install.py 2012-03-20 19:26:18 +0000
35@@ -423,7 +423,16 @@
36 os.symlink(linkto, targetpath)
37 elif stat.S_ISDIR(st.st_mode):
38 if not os.path.isdir(targetpath):
39- os.mkdir(targetpath, mode)
40+ try:
41+ os.mkdir(targetpath, mode)
42+ except OSError, e:
43+ # there is a small window where update-apt-cache
44+ # can race with us since it creates
45+ # "/target/var/cache/apt/...". Hence, ignore
46+ # failure if the directory does now exist where
47+ # brief moments before it didn't.
48+ if e.errno != errno.EEXIST:
49+ raise
50 elif stat.S_ISCHR(st.st_mode):
51 os.mknod(targetpath, stat.S_IFCHR | mode, st.st_rdev)
52 elif stat.S_ISBLK(st.st_mode):

Subscribers

People subscribed via source and target branches

to status/vote changes: