7
. /usr/share/gitpkg/hooks/repo-config-helper
7
9
find -name Makefile -type l -print -delete
8
rm -r test1 test2 src/Makefile
9
. /usr/share/gitpkg/hooks/quilt-patches-deb-export-hook
11
#. /usr/share/gitpkg/hooks/quilt-patches-deb-export-hook
13
patch_list=debian/source/git-patches
14
patch_dir=debian/patches
16
if [ ! -r "$patch_list" ]; then
17
echo "No $patch_list file, I guess you've pushed them all upstream."
22
if [ -e "$patch_dir" ]; then
23
echo "Uh oh. You already have a $patch_dir here."
24
echo "You probably don't want us to scribble on that without asking."
28
if [ -z "$REPO_DIR" ]; then
29
# support running as a free-standing script, without gitpkg
30
DEB_VERSION="$(dpkg-parsechangelog | sed -rne 's/^Version: ([^:]+:)?//p')"
31
UPSTREAM_VERSION="${DEB_VERSION%-*}"
35
DEB_REF=$(sanitise_git_ref $DEB_VERSION)
36
UPSTREAM_REF="${DEB_REF%-*}"
41
[ -n "$line" ] || continue
46
git --git-dir "$REPO_DIR/.git" diff "$line" > "$patch_dir/$line"
47
echo "$line" >> "$patch_dir/series"
53
mkdir -p "$patch_dir" || exit 1
54
echo "# $patch_list exported from git by export-hook" > "$patch_dir/series"
56
(sed -e "s/\$DEB_VERSION/$DEB_VERSION/g" \
57
-e "s/\${DEB_VERSION}/$DEB_VERSION/g" \
58
-e "s/\$UPSTREAM_VERSION/$UPSTREAM_VERSION/g" \
59
-e "s/\${UPSTREAM_VERSION}/$UPSTREAM_VERSION/g" \
60
-e "s/\$DEB_REF/$DEB_REF/g" \
61
-e "s/\${DEB_REF}/$DEB_REF/g" \
62
-e "s/\$UPSTREAM_REF/$UPSTREAM_REF/g" \
63
-e "s/\${UPSTREAM_REF}/$UPSTREAM_REF/g" \
64
< "$patch_list" ; echo ) | do_patches || exit 1