diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-01-12 15:24:42 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-06-17 10:18:48 +0200 |
commit | 9b68e37096af76be8c00cdd9f25990fadd4765ab (patch) | |
tree | c385ba6a61d70fcfbd770ada4febb961e13bd67b /gbp/scripts/common | |
parent | 6287b0d6e78bd1bef0ed0abef9c96b003702bf71 (diff) |
import-orig: move is_link_target() to common module
This change makes is_link_target() re-usable in the upcoming RPM-tools.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/scripts/common')
-rw-r--r-- | gbp/scripts/common/import_orig.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gbp/scripts/common/import_orig.py b/gbp/scripts/common/import_orig.py index fe38d90..4381b96 100644 --- a/gbp/scripts/common/import_orig.py +++ b/gbp/scripts/common/import_orig.py @@ -57,6 +57,14 @@ def cleanup_tmp_tree(tree): gbp.log.err("Removal of tmptree %s failed." % tree) +def is_link_target(target, link): + """does symlink link already point to target?""" + if os.path.exists(link): + if os.path.samefile(target, link): + return True + return False + + def ask_package_name(default, name_validator_func, err_msg): """ Ask the user for the source package name. |