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

Proposed by James Hunt on 2012-03-20
Status: Superseded
Proposed branch: lp:~jamesodhunt/ubiquity/bug-944191
Merge into: lp:ubiquity
Diff against target: 43 lines (+18/-3)
2 files modified
debian/changelog (+8/-2)
scripts/install.py (+10/-1)
To merge this branch: bzr merge lp:~jamesodhunt/ubiquity/bug-944191
Reviewer Review Type Date Requested Status
Colin Watson 2012-03-20 Needs Fixing on 2012-03-20
Review via email: mp+98435@code.launchpad.net

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).

To post a comment you must log in.
Colin Watson (cjwatson) wrote :

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 on 2012-03-20
5282. By James Hunt on 2012-03-20

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

Evan (ev) wrote :

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 13:29:02 +0000
3+++ debian/changelog 2012-03-20 15:36:22 +0000
4@@ -1,9 +1,15 @@
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- -- Colin Watson <cjwatson@ubuntu.com> Tue, 20 Mar 2012 13:28:02 +0000
13+ [ James Hunt ]
14+ * scripts/install.py: Ignore mkdir failure if directory does (now)
15+ exist to accommodate update-apt-cache running in parallel with
16+ copy_all() (LP: #944191).
17+
18+ -- James Hunt <james.hunt@ubuntu.com> Tue, 20 Mar 2012 14:26:00 +0000
19
20 ubiquity (2.9.30) precise; urgency=low
21
22
23=== modified file 'scripts/install.py'
24--- scripts/install.py 2012-02-16 02:47:22 +0000
25+++ scripts/install.py 2012-03-20 15:36:22 +0000
26@@ -423,7 +423,16 @@
27 os.symlink(linkto, targetpath)
28 elif stat.S_ISDIR(st.st_mode):
29 if not os.path.isdir(targetpath):
30- os.mkdir(targetpath, mode)
31+ try:
32+ os.mkdir(targetpath, mode)
33+ except EnvironmentError, e:
34+ # there is a small window where update-apt-cache
35+ # can race with us since it creates
36+ # "/target/var/cache/apt/...". Hence, ignore
37+ # failure if the directory does now exist where
38+ # brief moments before it didn't.
39+ if not (e.errno == errno.EEXIST and os.path.isdir(targetpath)):
40+ raise
41 elif stat.S_ISCHR(st.st_mode):
42 os.mknod(targetpath, stat.S_IFCHR | mode, st.st_rdev)
43 elif stat.S_ISBLK(st.st_mode):

Subscribers

People subscribed via source and target branches

to status/vote changes: