Remove unused functions and multiple defines
authorJun Wang <junbill.wang@samsung.com>
Mon, 7 Mar 2016 15:22:54 +0000 (23:22 +0800)
committerJun Wang <junbill.wang@samsung.com>
Mon, 7 Mar 2016 15:22:54 +0000 (23:22 +0800)
Change-Id: I36c7b6d9c0b03b9d4659cc0b531bc371f77049e4

gbp/config.py
gbp/scripts/common/import_orig.py
gbp/scripts/import_orig.py
gbp/scripts/pq.py

index 225ae65c6ecf0e2df2f6a9be33da21fe79479ffa..9fd31b73fe5661a01b968111a06b0100965e19eb 100644 (file)
@@ -160,7 +160,6 @@ class GbpOptionParser(OptionParser):
                  'allow-unauthenticated': 'False',
                  'symlink-orig': 'True',
                  'purge': 'True',
-                 'tmp-dir' : '/var/tmp/gbp/',
                  'drop': 'False',
                  'commit': 'False',
                  'tmp-dir' : '/var/tmp/gbp/',
@@ -311,9 +310,6 @@ class GbpOptionParser(OptionParser):
                    "'%(symlink-orig)s'"),
               'purge':
                   "Purge exported package build directory. Default is '%(purge)s'",
-             'tmp-dir':
-                  ("Base directory under which temporary directories are "
-                   "created, default is '%(tmp-dir)s'"),
               'drop':
                   ("In case of 'export' drop the patch-queue branch "
                    "after export. Default is '%(drop)s'"),
index 45e71c577093666754a076f231d97b09f47ee539..162444232db3197b2e9b1eedf5081460c7e10899 100644 (file)
@@ -148,16 +148,6 @@ def prepare_sources(source, pkg_name, pkg_version, pristine_commit_name,
     pristine_path = pristine.path if pristine else ''
     return (filtered.unpacked, pristine_path)
 
-def repack_source(source, new_name, unpack_dir, filters, new_prefix=None):
-    """Repack the source tree"""
-    repacked = source.pack(new_name, filters, new_prefix)
-    if source.is_tarball(): # the tarball was filtered on unpack
-        repacked.unpacked = source.unpacked
-    else: # otherwise unpack the generated tarball get a filtered tree
-        repacked.unpack(unpack_dir)
-    return repacked
-
-
 def prepare_pristine_tar(source, pkg_name, pkg_version, pristine_commit_name,
                          filters=None, prefix=None, tmpdir=None):
     """
index e9b6a653386dfc60fef7f027c39df072b80ba66d..9d183b6d2682f7882a476b748166cb2b77297843 100644 (file)
@@ -36,45 +36,6 @@ from gbp.scripts.common.import_orig import (cleanup_tmp_tree, ask_package_name,
                                                ask_package_version,
                                                prepare_sources)
 
-def prepare_pristine_tar(archive, pkg, version):
-    """
-    Prepare the upstream source for pristine tar import.
-
-    This checks if the upstream source is actually a tarball
-    and creates a symlink from I{archive}
-    to I{<pkg>_<version>.orig.tar.<ext>} so pristine-tar will
-    see the correct basename.
-
-    @param archive: the upstream source's name
-    @type archive: C{str}
-    @param pkg: the source package's name
-    @type pkg: C{str}
-    @param version: the upstream version number
-    @type version: C{str}
-    @rtype: C{str}
-    """
-    linked = False
-    if os.path.isdir(archive):
-        return None
-
-    ext = os.path.splitext(archive)[1]
-    if ext in ['.tgz', '.tbz2', '.tlz', '.txz' ]:
-        ext = ".%s" % ext[2:]
-
-    link = "../%s_%s.orig.tar%s" % (pkg, version, ext)
-
-    if os.path.basename(archive) != os.path.basename(link):
-        try:
-            if not is_link_target(archive, link):
-                os.symlink(os.path.abspath(archive), link)
-                linked = True
-        except OSError as err:
-                raise GbpError("Cannot symlink '%s' to '%s': %s" % (archive, link, err[1]))
-        return (link, linked)
-    else:
-        return (archive, linked)
-
-
 def upstream_import_commit_msg(options, version):
     return options.import_msg % dict(version=version)
 
index 02b74e756bb566583b407159ac296f2bfe085529..7053d0afb8a29ecf1377af1102304d683af76bab 100755 (executable)
@@ -342,7 +342,6 @@ def build_parser(name):
     parser.add_config_file_option(option_name="color", dest="color", type='tristate')
     parser.add_config_file_option(option_name="color-scheme",
                                   dest="color_scheme")
-    parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
     parser.add_config_file_option(option_name="meta-closes", dest="meta_closes")
     parser.add_config_file_option(option_name="tmp-dir", dest="tmp_dir")
     return parser