summaryrefslogtreecommitdiffhomepage
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
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>
-rw-r--r--gbp/scripts/common/import_orig.py8
-rw-r--r--gbp/scripts/import_orig.py11
2 files changed, 10 insertions, 9 deletions
diff --git a/gbp/scripts/common/import_orig.py b/gbp/scripts/common/import_orig.py
index fe38d90a..4381b96a 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.
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