Add linktree(src, dst) to sysutils

This commit is contained in:
Will Woods 2011-05-09 19:04:35 -04:00
parent 5e242925ec
commit b436479f97
1 changed files with 6 additions and 2 deletions

View File

@ -19,8 +19,8 @@
# Red Hat Author(s): Martin Gracik <mgracik@redhat.com>
#
__all__ = ["joinpaths", "touch", "replace", "chown_", "chmod_", "remove"]
__all__ = ["joinpaths", "touch", "replace", "chown_", "chmod_", "remove",
"linktree"]
import sys
import os
@ -30,6 +30,7 @@ import pwd
import grp
import glob
import shutil
import subprocess
def joinpaths(*args, **kwargs):
@ -96,3 +97,6 @@ def remove(target):
shutil.rmtree(target)
else:
os.unlink(target)
def linktree(src, dst):
subprocess.check_call(["/bin/cp", "-al", src, dst])