summaryrefslogtreecommitdiff
path: root/gbp/scripts/import_orig.py
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/import_orig.py
parent6287b0d6e78bd1bef0ed0abef9c96b003702bf71 (diff)
downloadgit-buildpackage-9b68e37096af76be8c00cdd9f25990fadd4765ab.tar.gz
git-buildpackage-9b68e37096af76be8c00cdd9f25990fadd4765ab.tar.bz2
git-buildpackage-9b68e37096af76be8c00cdd9f25990fadd4765ab.zip
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/import_orig.py')
-rw-r--r--gbp/scripts/import_orig.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index 4ba9bf8a..feb5a605 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -31,7 +31,8 @@ from gbp.errors import (GbpError, GbpNothingImported)
import gbp.log
from gbp.scripts.common.import_orig import (OrigUpstreamSource, cleanup_tmp_tree,
ask_package_name, ask_package_version,
- repacked_tarball_name, repack_source)
+ repacked_tarball_name, repack_source,
+ is_link_target)
# Try to import readline, since that will cause raw_input to get fancy
# line editing and history capabilities. However, if readline is not
@@ -42,14 +43,6 @@ except ImportError:
pass
-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 symlink_orig(archive, pkg, version):
"""
Create a symlink from I{archive} ti I{<pkg>_<version>.orig.tar.<ext>} so