Browse Source

limit git srch depth and width

merge-requests/103/head
Daniel Reurich 7 years ago
parent
commit
d745ca9eae
  1. 23
      scripts/generate-git-snapshot

23
scripts/generate-git-snapshot

@ -1,3 +1,4 @@
#!/bin/bash
set -x
@ -19,6 +20,7 @@ if [ ! -d "${SOURCE_DIRECTORY}" ] ; then
exit 1
fi
if [ -z "${BUILD_NUMBER:-}" ] ; then
echo "No BUILD_NUMBER defined, please run it in jenkins." >&2
exit 1
@ -344,6 +346,26 @@ quilt_cleanup() {
rm -rf .pc
}
git_source_options() {
#Unless otherwise specified in the debian/source/options
# restrict git source archive depth and limit to only the branch we build.
GIT_DEPTH=20
local file
local value
file="debian/source/options"
if [ -f ${file} ]; then
value=$(git config --file ${file} --get git-depth 2>&- || true)
if [ -n "${value:-}" ]; then
DBP_EXTRA_OPTS="${DBP_EXTRA_OPTS:-} --source-option=--git-depth=$GIT_DEPTH"
fi
value=$(git config --file ${file} --get git-ref 2>&- || true)
if ![ -n "${value:-}" ]; then
DBP_EXTRA_OPTS="${DBP_EXTRA_OPTS:-} --source-option=--git-ref=${BRANCH}
fi
fi
}
source_format_opts() {
if ! [ -f "debian/source/format" ] ; then
echo '*** WARNING: Source format is not specified in debian/source/format! ***'
@ -359,6 +381,7 @@ source_format_opts() {
;;
'3.0 (git)')
echo "*** Source format detected as 3.0 (git) ***"
git_source_options()
PRISTINE_TAR=false
SKIP_QUILT_CLEANUP=true
IGNORE_GIT_BUILDPACKAGE=true

Loading…
Cancel
Save