]>
git.proxmox.com Git - pve-kernel.git/blob - debian/scripts/import-upstream-tag
13 # generated based on new_tag
15 # previously checked out in submodule
18 function cleanup_pq_branch
{
19 if [[ -n $pq_branch ]]; then
20 echo "cleaning up PQ branch '$pq_branch'"
21 cd "${top}/${kernel_submodule}"
22 git checkout
--quiet $old_ref
24 git branch
-D "$pq_branch"
39 if [[ "$#" -lt 3 ||
"$#" -gt 4 ]]; then
40 echo "USAGE: $0 submodule patchdir tag [rebase]"
41 echo "\t fetches and checks out 'tag' in 'submodule'"
42 echo "\t if 'rebase' is given, imports, rebases and exports patchqueue from 'patchdir' as well"
47 if [ ! -d "${kernel_submodule}" ]; then
48 error_exit
"'${kernel_submodule}' must be a directory!"
52 if [ ! -d "${kernel_patchdir}" ]; then
53 error_exit
"'${kernel_patchdir}' must be a directory!"
59 if [[ -n $
(git status
--untracked-files=no
--porcelain) ]]; then
60 error_exit
"working directory unclean, aborting"
64 cd "${kernel_submodule}"
65 ## check for tag and fetch if needed
66 echo "checking for tag '${new_tag}'"
67 if [[ -z $
(git tag
-l "${new_tag}") ]]; then
68 echo "tag not found, fetching and retrying"
71 if [[ -z $
(git tag
-l "${new_tag}") ]]; then
72 error_exit
"tag not found, aborting"
77 if [[ -n "$rebase" ]]; then
79 echo "automatic patchqueue rebase enabled"
80 cd "${kernel_submodule}"
81 ## preparing patch queue branch
82 old_ref
=$
(git rev-parse HEAD
)
83 pq_branch
="auto_pq/${new_tag}"
86 echo "previous HEAD: ${old_ref}"
89 "${top}/debian/scripts/import-patchqueue" "${kernel_submodule}" "${kernel_patchdir}" "${pq_branch}" || error_exit
"failed to import patchqueue"
91 cd "${kernel_submodule}"
94 echo "rebasing patchqueue on top of '${new_tag}'"
95 git rebase
"${new_tag}"
98 ## regenerate exported patch queue
100 "${top}/debian/scripts/export-patchqueue" "${kernel_submodule}" "${kernel_patchdir}" "${new_tag}" || error_exit
"failed to export patchqueue"
107 cd "${kernel_submodule}"
109 echo "checking out '${new_tag}' in submodule"
110 git checkout
--quiet "${new_tag}"
114 echo "committing results"
115 git commit
--verbose -s -m "update sources to ${new_tag}" -m "(generated with debian/scripts/import-upstream-tag)" "${kernel_submodule}"
116 if [[ -n "$rebase" ]]; then
117 git add
"${kernel_patchdir}"
118 git commit
--verbose -s -m "rebase patches on top of ${new_tag}" -m "(generated with debian/scripts/import-upstream-tag)" "${kernel_patchdir}"