# `gbp.scripts.common.import_orig` module documentation

Part of `gbp.scripts.common`

Common functionality for import-orig scripts

Function | orig_needs_repack | Determine if the upstream sources needs to be repacked
Function | cleanup_tmp_tree | remove a tree of temporary files
Function | is_link_target | does symlink link already point to target?
Function | ask_package_name | Ask the user for the source package name. @param default: The default package name to suggest to the user.
Function | ask_package_version | Ask the user for the upstream package version. @param default: The default package version to suggest to the user.
Function | repacked_tarball_name | Undocumented
Function | repack_upstream | Repack the upstream source tree
Function | download_orig | No summary

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. we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir) and want to use filters
3. we don't have a suitable upstream tarball (e.g. zip archive or unpacked dir) and want to use pristine-tar

def cleanup_tmp_tree(tree):

remove a tree of temporary files

def is_link_target(target, link):

does symlink link already point to target?

def ask_package_name(default, name_validator_func, err_msg):

Ask the user for the source package name.

Parameters | default | The default package name to suggest to the user.

def ask_package_version(default, ver_validator_func, err_msg):

Ask the user for the upstream package version.

Parameters | default | The default package version to suggest to the user.

def repacked_tarball_name(upstream, name, version):
Undocumented
def repack_upstream(upstream, name, version, tmpdir, filters):

Repack the upstream source tree

def download_orig(url):

Download orig tarball from given URL

Parameters | url | the download URL (type: `str`)
Returns | The upstream source tarball (type: DebianUpstreamSource)
Raises | GbpError | on all errors