summaryrefslogtreecommitdiffstats
path: root/pym/portage/util/_async
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-09 06:38:16 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-09 09:09:44 -0800
commit12c795d81251b03f3d33d02696dc8db1299dee78 (patch)
tree9e3a3983bb2fb65064f5b1a056ac4c36280a9e5d /pym/portage/util/_async
parent97e8df7eaa171d68da6b3e111c419e2a16dfaf4c (diff)
downloadportage-12c795d81251b03f3d33d02696dc8db1299dee78.tar.gz
portage-12c795d81251b03f3d33d02696dc8db1299dee78.tar.bz2
portage-12c795d81251b03f3d33d02696dc8db1299dee78.zip
Add emirrordist, a tool for mirroring distfiles.
Special thanks to Brian Harring, author of the mirror-dist program from which emirrordist is derived.
Diffstat (limited to 'pym/portage/util/_async')
-rw-r--r--pym/portage/util/_async/FileCopier.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/pym/portage/util/_async/FileCopier.py b/pym/portage/util/_async/FileCopier.py
new file mode 100644
index 000000000..27e5ab4c0
--- /dev/null
+++ b/pym/portage/util/_async/FileCopier.py
@@ -0,0 +1,17 @@
+# Copyright 2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from portage import os
+from portage import shutil
+from portage.util._async.ForkProcess import ForkProcess
+
+class FileCopier(ForkProcess):
+ """
+ Asynchronously copy a file.
+ """
+
+ __slots__ = ('src_path', 'dest_path')
+
+ def _run(self):
+ shutil.copy(self.src_path, self.dest_path)
+ return os.EX_OK