File: debcherry-deb-export-hook

package info (click to toggle)
gitpkg 0.31%2Bnmu1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 232 kB
  • sloc: sh: 1,365; makefile: 34
file content (23 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# To enable this hook, use:
# git config gitpkg.deb-export-hook /usr/share/gitpkg/hooks/debcherry-deb-export-hook

if [ -z "$REPO_DIR" -o -z "$GITPKG_TREEISH" ]; then
   echo "internal error: please define REPO_DIR and GITPKG_TREEISH" >&2
   exit 1
fi

orig_treeish="$GITPKG_ORIG_TREEISH"
commit_file="../$DEB_ORIG".commit
if [ -z "$orig_treeish" ]; then
   if [ ! -r "$commit_file" ]; then
       echo "No origbranch specified and no $commit_file" >&2
       echo "Cannot export patches" >&2
       exit 1
   else
       orig_treeish=$(cat $commit_file)
   fi
else
   echo "$orig_treeish" > "$commit_file"
fi

git --git-dir="$REPO_DIR/.git" debcherry -o debian/patches $orig_treeish $GITPKG_TREEISH