summaryrefslogtreecommitdiffstats
path: root/bin/binhost-snapshot
Commit message (Collapse)AuthorAgeFilesLines
* Migrate from codecs.open() to io.open().Zac Medico2011-07-101-3/+3
| | | | | | | | | | | | | | | | | The io.open() function is the same as the built-in open() function in python3, and its implementation is optimized in python-2.7 and later. In addition to the possible performance improvement, this also allows us to avoid any future compatibility issues with codecs.open() that may arise if it is delegated to the built-in open() function as discussed in PEP 400. The main caveat involved with io.open() is that TextIOWrapper.write() raises TypeError if given raw bytes, unlike the streams returned from codecs.open(). This is mainly an issue for python2 since literal strings are raw bytes. We handle this by wrapping TextIOWrapper.write() arguments with our _unicode_decode() function. Also, the atomic_ofstream class overrides the write() method in python2 so that it performs automatic coercion to unicode when necessary.
* Usage: binhost-snapshot [options] <src_pkg_dir> <snapshot_dir> ↵Zac Medico2010-05-131-0/+142
<snapshot_uri> <binhost_dir> This program will copy src_pkg_dir to snapshot_dir and inside binhost_dir it will create a Packages index file which refers to snapshot_uri. This is intended to solve race conditions on binhosts as described at http://crosbug.com/3225. Required Arguments: src_pkg_dir - the source $PKGDIR snapshot_dir - destination snapshot directory (must not exist) snapshot_uri - URI which refers to snapshot_dir from the client side binhost_dir - directory in which to write Packages index with snapshot_uri Options: -h, --help show this help message and exit --hardlinks=HARDLINKS create hardlinks (y or n, default is y)