summaryrefslogtreecommitdiff
path: root/gbp/scripts/common
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-01-12 15:24:42 +0200
committerGuido Günther <agx@sigxcpu.org>2012-06-17 10:18:48 +0200
commit9b68e37096af76be8c00cdd9f25990fadd4765ab (patch)
treec385ba6a61d70fcfbd770ada4febb961e13bd67b /gbp/scripts/common
parent6287b0d6e78bd1bef0ed0abef9c96b003702bf71 (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.py8
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.