From: | Mike Frysinger <vapier@g.o> | ||
---|---|---|---|
To: | gentoo-portage-dev@l.g.o | ||
Subject: | Re: [gentoo-portage-dev] [PATCH v4] Test for read-only filesystems, bail out during preinst if there are any which will be written to and display a useful error message. Fixes bug 378869. | ||
Date: | Tue, 21 Jan 2014 03:32:41 | ||
Message-Id: | 201401202232.39460.vapier@gentoo.org | ||
In Reply to: | [gentoo-portage-dev] [PATCH v4] Test for read-only filesystems, bail out during preinst if there are any which will be written to and display a useful error message. Fixes bug 378869. by Chris Reffett |
1 | On Monday 20 January 2014 19:50:54 Chris Reffett wrote: |
2 | > + # Check for read-only filesystems |
3 | |
4 | please use full sentences. that means putting a period at the end. this |
5 | applies to many additions in this patch. |
6 | |
7 | > + try: |
8 | > + with io.open("/proc/mounts", mode='r', |
9 | encoding=_encodings['content'], |
10 | > + errors='replace') as f: |
11 | > + roregex = re.compile(r'(\A|,)ro(\Z|,)') |
12 | > + for line in f: |
13 | > + if roregex.search(line.split(" ")[3].strip()) is not |
14 | None: |
15 | > + romount = line.split(" ")[1].strip() |
16 | > + ro_filesystems.add(romount) |
17 | |
18 | pretty sure the body of this with block is indented one too many times |
19 | -mike |
File name | MIME type |
---|---|
signature.asc | application/pgp-signature |