<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/platform_utils.py, branch v2.19</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.19</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.19'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2021-09-28T16:06:50+00:00</updated>
<entry>
<title>make file removal a bit more robust</title>
<updated>2021-09-28T16:06:50+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2021-09-28T15:27:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=9d96f58f5fcec101c612e61c3e2526ca071d89ea'/>
<id>urn:sha1:9d96f58f5fcec101c612e61c3e2526ca071d89ea</id>
<content type='text'>
Some of the file removal calls are subject to race conditions (if
something else deletes the file), so extend our remove API to have
an option to ignore ENOENT errors.  Then update a bunch of random
call sites to use this new functionality.

Change-Id: I31a9090e135452033135337a202a4fc2dbf8b63c
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319195
Reviewed-by: Sean McAllister &lt;smcallis@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>platform_utils: os.rename exception when src and des on different file system</title>
<updated>2021-09-24T08:20:06+00:00</updated>
<author>
<name>wenchiching</name>
<email>wenchiching@gmail.com</email>
</author>
<published>2021-08-23T02:47:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=366824937c179c0ce7e316f6bbefce99eabab408'/>
<id>urn:sha1:366824937c179c0ce7e316f6bbefce99eabab408</id>
<content type='text'>
Symptom: repo sync exception
Root Cause: os.rename only works when source and destination are on the same file system
Solution: using shutil.move

to save disk usage, I create links for projects and project-objects, link to folder on another disk
lrwxrwxrwx  1 owenwen owenwen   47 Jun  9 16:40 project-objects -&gt; /disk3/AndroidLocalRepos/.repo/project-objects/
lrwxrwxrwx  1 owenwen owenwen   40 Jun  9 16:40 projects -&gt; /disk3/AndroidLocalRepos/.repo/projects/

below are exception I met:
"""
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/disk2/Android11/.repo/repo/subcmds/sync.py", line 550, in _CheckoutOne
    project.Sync_LocalHalf(syncbuf, force_sync=force_sync)
  File "/disk2/Android11/.repo/repo/project.py", line 1251, in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync, submodules=submodules)
  File "/disk2/Android11/.repo/repo/project.py", line 2801, in _InitWorkTree
    self._CheckDirReference(self.gitdir, dotgit, share_refs=True)
  File "/disk2/Android11/.repo/repo/project.py", line 2674, in _CheckDirReference
    platform_utils.rename(dst_path, src_path)
  File "/disk2/Android11/.repo/repo/platform_utils.py", line 127, in rename
    os.rename(src, dst)
OSError: [Errno 18] Invalid cross-device link: '/disk2/Android11/system/libhidl/.git/packed-refs' -&gt; '/disk2/Android11/.repo/projects/system/libhidl.git/packed-refs'
"""

Change-Id: Ifda2f16530cc5a8f280169f482ee858f9e5241d3
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/316002
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>platform_utils: delete unused FileDescriptorStreams APIs</title>
<updated>2021-02-24T01:45:57+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2021-02-16T22:21:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=f0925c482f4bd73aa1c6f8e0816955dedddbc678'/>
<id>urn:sha1:f0925c482f4bd73aa1c6f8e0816955dedddbc678</id>
<content type='text'>
Now that we've converted the few users of this over to subprocess APIs,
we don't need this anymore.  It's been a bit hairy to maintain across
different operating systems, so there's no desire to bring it back.

Using multiprocessing Pool to batch things has been working better in
general anyways.

Change-Id: I10769e96f60ecf27a80d8cc2aa0d1b199085252e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/297682
Reviewed-by: Michael Mortensen &lt;mmortensen@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>drop pyversion &amp; is_python3 checking</title>
<updated>2021-01-06T18:53:58+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2019-06-13T06:24:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=acf63b28928b33d1335dfed1af7e2d8fc6bb5fc4'/>
<id>urn:sha1:acf63b28928b33d1335dfed1af7e2d8fc6bb5fc4</id>
<content type='text'>
We're committed to Python 3 at this point, so purge all the
is_python3 related dynamic checks.

Bug: https://crbug.com/gerrit/10418
Change-Id: I4c8b405d6de359b8b83223c9f4b9c8ffa18ea1a2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/292383
Reviewed-by: Chris Mcdonald &lt;cjmcdonald@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>strip python2-only coding:utf-8 &amp; print_function settings</title>
<updated>2021-01-06T18:53:05+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2021-01-01T13:42:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=784ccfc040dc8efa1a64d3c7d4070b66beb15d08'/>
<id>urn:sha1:784ccfc040dc8efa1a64d3c7d4070b66beb15d08</id>
<content type='text'>
We're committed to Python 3 at this point, so clean up boilerplate.

Bug: https://crbug.com/gerrit/10418
Change-Id: Ib1719ba2eb65c53b94881a1a1bf203ddfcaaafed
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/292382
Reviewed-by: Chris Mcdonald &lt;cjmcdonald@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>Reland "Port _FileDescriptorStreamsNonBlocking to use poll()"</title>
<updated>2020-03-13T17:45:36+00:00</updated>
<author>
<name>Theodore Dubois</name>
<email>tbodt@google.com</email>
</author>
<published>2020-03-12T01:06:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=23d7dafd10e382f42c34618f7c86b3ff1c9d4245'/>
<id>urn:sha1:23d7dafd10e382f42c34618f7c86b3ff1c9d4245</id>
<content type='text'>
Now that repo 2 requires Python 3, we can reland this.

This reverts commit 91d9587e45608a5f95cd842426b43452a60abb5e.

Change-Id: Id5b178ebb53bdba04bfa79cbb5c698ae5080c957
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/258672
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Theodore Dubois &lt;tbodt@google.com&gt;
</content>
</entry>
<entry>
<title>platform_utils: have Windows select stream return "" at EOF</title>
<updated>2020-02-18T19:06:02+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2020-02-16T16:28:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=8f9bf484d816196ec19c859d97a23e9c4592188b'/>
<id>urn:sha1:8f9bf484d816196ec19c859d97a23e9c4592188b</id>
<content type='text'>
This matches *NIX behavior where the last read is '', not None.

Bug: https://crbug.com/gerrit/12329
Change-Id: I48b026b4d1b8d7c6abbce198757b970931869e1a
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255352
Reviewed-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>Fix blank line issues reported by flake8</title>
<updated>2020-02-12T06:36:40+00:00</updated>
<author>
<name>David Pursehouse</name>
<email>dpursehouse@collab.net</email>
</author>
<published>2020-02-12T06:20:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=819827a42ddb364f98c3a1a7eae2536dc54bc4cc'/>
<id>urn:sha1:819827a42ddb364f98c3a1a7eae2536dc54bc4cc</id>
<content type='text'>
- E301 expected 1 blank line
- E302 expected 2 blank lines
- E303 too many blank lines
- E305 expected 2 blank lines after class or function definition
- E306 expected 1 blank line before a nested definition

Fixed automatically with autopep8:

  git ls-files | grep py$ | xargs autopep8 --in-place \
    --select E301,E302,E303,E305,E306

Manually fix issues in project.py caused by misuse of block comments.

Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: David Pursehouse &lt;dpursehouse@collab.net&gt;
</content>
</entry>
<entry>
<title>Revert "Port _FileDescriptorStreamsNonBlocking to use poll()"</title>
<updated>2020-02-03T23:01:07+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2020-02-03T22:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=91d9587e45608a5f95cd842426b43452a60abb5e'/>
<id>urn:sha1:91d9587e45608a5f95cd842426b43452a60abb5e</id>
<content type='text'>
This reverts commit 1e01a7444536b4865feb94c398b68a936a463ddc.

Not all platforms support select.poll() currently it seems.
At least macOS's Python 2 doesn't (while macOS Python 3 does).

Lets back this out for the existing release series and once we
start repo-2 which is Python 3-only, we can put this back in.

Change-Id: I205206b0fa4fe2d755f4fbc6ec683ad125f27cc2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253072
Reviewed-by: Michael Mortensen &lt;mmortensen@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>Fix method signature of platform_utils.FileDescriptorStreams._create_stream()</title>
<updated>2020-01-25T13:29:08+00:00</updated>
<author>
<name>Rostislav Krasny</name>
<email>rostigm@gmail.com</email>
</author>
<published>2020-01-25T12:32:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=ec0ba2777ff94bcec016f7d587bea823d8a99e9f'/>
<id>urn:sha1:ec0ba2777ff94bcec016f7d587bea823d8a99e9f</id>
<content type='text'>
Change-Id: Ib80e4ec5e540d97488e7564703ddbcb74350fdfd
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/251836
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Rostislav Krasny &lt;rostigm@gmail.com&gt;
</content>
</entry>
</feed>
