aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/scripts/common/import_orig.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/scripts/common/import_orig.py')
-rw-r--r--gbp/scripts/common/import_orig.py41
1 files changed, 19 insertions, 22 deletions
diff --git a/gbp/scripts/common/import_orig.py b/gbp/scripts/common/import_orig.py
index c2c53a64..8e18e978 100644
--- a/gbp/scripts/common/import_orig.py
+++ b/gbp/scripts/common/import_orig.py
@@ -32,29 +32,26 @@ except ImportError:
pass
-class OrigUpstreamSource(UpstreamSource):
- """Upstream source that will be imported"""
-
- def needs_repack(self, options):
- """
- Determine if the upstream sources needs to be repacked
-
- We repack if
- 1. we want to filter out files and use pristine tar since we want
- to make a filtered tarball available to pristine-tar
- 2. when we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
- and want to use filters
- 3. when we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
- and want to use pristine-tar
- """
- if ((options.pristine_tar and options.filter_pristine_tar and len(options.filters) > 0)):
+def orig_needs_repack(upstream_source, options):
+ """
+ Determine if the upstream sources needs to be repacked
+
+ We repack if
+ 1. we want to filter out files and use pristine tar since we want
+ to make a filtered tarball available to pristine-tar
+ 2. when we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
+ and want to use filters
+ 3. when we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir)
+ and want to use pristine-tar
+ """
+ if ((options.pristine_tar and options.filter_pristine_tar and len(options.filters) > 0)):
+ return True
+ elif not upstream_source.is_orig():
+ if len(options.filters):
return True
- elif not self.is_orig():
- if len(options.filters):
- return True
- elif options.pristine_tar:
- return True
- return False
+ elif options.pristine_tar:
+ return True
+ return False
def cleanup_tmp_tree(tree):