File: import-new-snapshot

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (35 lines) | stat: -rwxr-xr-x 988 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -e

error() {
  echo "$@" >&2
  exit 1
}

if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
  error "Current branch is not master!"
fi
if [ "$(git remote get-url upstream)" != "https://git.launchpad.net/cloud-init" ]; then
  error "Need remote called 'upstream' pointing to https://git.launchpad.net/cloud-init!"
fi

remote_master=refs/remotes/upstream/master

master_version=$(git describe ${remote_master})
master_id=$(git show-ref --verify --hash ${remote_master})
tar=../cloud-init_${master_version}.orig.tar.xz

if [ -e ${tar} ]; then
  error "${tar} already exists!"
fi

set -x

git archive --format=tar --prefix=cloud-init-${master_version}/ ${master_id} | xz > ${tar}
pristine-tar commit ${tar} ${master_id}

git update-ref refs/heads/upstream ${master_id}
git-dpm record-new-upstream ${tar} ${master_id}
dch -v ${master_version}-1 "New upstream snapshot."
git add debian/changelog
git commit --amend --message "Merge from master at ${master_version}"