[DEFAULT]
compression = gz
debian-branch = debian/sid
pristine-tar = True
upstream-branch = upstream

[pq]
patch-numbers = False

[dch]
id-length = 7

[import-orig]
filter = [
 '*.yml',
 '*.bzl',
 '.baz*',
 '.devcontainer',
 '.editorconfig',
 '.git*',
 '.idea',
 '.mailmap',
 '.tours',
 'BUILD.bazel',
# 'common', # See details on the postunpack hook.
 'copyiedriver.bat',
 'cpp',
 'deploys',
 'dotnet',
 'generate_api_docs.sh',
 'generate_web_code.sh',
 'go*',
 'java*',
 'package.json',
 'package-lock.json',
 'private',
 'rake*',
 'Rakefile',
 'rb',
 'rust',
 'scripts',
 'selenium.iml',
 'sonar-project.properties',
# 'third_party', # See details on the postunpack hook.
 'tours',
 'WORKSPACE',
 ]

# Upstream ships one tarball on GitHub which includes source for multiple
# languages. We are only interessted in Python related things, but need to
# pick up at least things from the folders third_party/.
#
#  So we exclude first the folder selenium-*-$VERSION/common as we can't
#  use the filter options for this as it would match also other related
#  parts globally.
#
#  Next copy all the Python source into place.
#
#  Finally copy third_party/js/selenium/webdriver.json into the correct
#  folder with the later required naming and remove the folder third_party/.

postunpack = rm -rf $GBP_TMP_DIR/selenium*/common && cp -a $GBP_TMP_DIR/selenium*/py/* $GBP_TMP_DIR/selenium* && rm -rf $GBP_TMP_DIR/selenium*/py && TARGET_FOLDER=$(find $GBP_TMP_DIR -maxdepth 2 -name "selenium" -type d) && cp $GBP_TMP_DIR/selenium*/third_party/js/selenium/webdriver.json $TARGET_FOLDER/webdriver/firefox/webdriver_prefs.json && rm -rf $GBP_TMP_DIR/selenium*/third_party

# filter the files out of the tarball passed to pristine-tar
filter-pristine-tar = True
