summaryrefslogtreecommitdiff
path: root/gbp.org
blob: 76b3794ea7f053f22ccb82c68181e942e7e39770 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#+STARTUP: indent
# Debconf17, 2017-08-10 Montreal, Canada
# Short demo of some newer gbp features and commands

* What's new in git-buildpackage

** gbp clone: cloning repositories
#+BEGIN_SRC shell :results output
set -e
rm -rf ~/tmp/demo/libvirt-glib*
mkdir -p ~/tmp/demo && cd ~/tmp/demo

gbp clone vcsgit:libvirt-glib
#+END_SRC

- sets up upstream, pristine-tar branches as well
- alias: vcs-git:
- also: github:

** gbp push: pushing to remotes

- Repo we push to

#+BEGIN_SRC shell :results output
set -e
rm -rf ~/tmp/demo/foo
git init --bare ~/tmp/demo/foo
#+END_SRC

- Push changes to remote

#+BEGIN_SRC shell :results output
set -e
cd ~/tmp/demo/libvirt-glib
git remote add foo ../foo

gbp push foo
#+END_SRC

- pushes current tags, debian-branch, upstream-branch, pristine-tar

** gbp export-orig: recreating tarballs

- uses pristine-tar if wanted
- uses pristine-tar verify when available

#+BEGIN_SRC shell  :results output
rm -f ~/tmp/demo/*.orig*
cd ~/tmp/demo/libvirt-glib

gbp export-orig
#+END_SRC

- stable SHA1 without pristine-tar

#+BEGIN_SRC shell :results output
set -e
rm -f ~/tmp/demo/*.orig*

cd ~/tmp/demo/libvirt-glib
gbp export-orig --no-pristine-tar
sha1sum ~/tmp/demo/*.orig*

rm -f ~/tmp/demo/*.orig*
gbp export-orig --no-pristine-tar
sha1sum ~/tmp/demo/*.orig*
#+END_SRC

** gbp pristine-tar: adding pristine-tar commits later

#+BEGIN_SRC shell :results output
set -e
cd ~/tmp/demo
rm -rf hello-debhelper
gbp import-dsc --no-pristine-tar data/hello-debhelper_2.8-1.dsc
cd hello-debhelper
git branch -l
#+END_SRC

#+BEGIN_SRC shell :results output
set -e
cd ~/tmp/demo/hello-debhelper

gbp pristine-tar commit --component=foo ../data/hello-debhelper_2.8.orig.tar.gz
pristine-tar list
git branch -l
#+END_SRC

** gbp import-orig: importing tarballs
*** No more merges in 3.0 (quilt)

#+BEGIN_SRC shell
gbp import-orig --uscan # --merge-mode=replace
#+END_SRC

*** Rollbacks
#+BEGIN_SRC shell :results verbatim
set -e
cd ~/tmp/demo
rm -rf hello-debhelper
gbp import-dsc --no-pristine-tar data/hello-debhelper_2.8-1.dsc
cd hello-debhelper
#+END_SRC

Import another version, make it fail to create tag

#+BEGIN_SRC shell :results verbatim
set -e
cd ~/tmp/demo/hello-debhelper
gbp import-orig ../data/hello-debhelper_2.9.orig.tar.gz
#+END_SRC

** import-dsc: Fetching a package from the archive

No more --download

#+BEGIN_SRC shell :results verbatim
cd ~/tmp/demo
gbp import-dsc https://people.debian.org/~agx/debian-lts/heimdal_1.6~git20120403+dfsg1-2+deb7u1.dsc
#+END_SRC

#+BEGIN_SRC shell :results verbatim
cd ~/tmp/demo
rm -rf sl/
gbp import-dsc apt:sl/wheezy
#+END_SRC

** gbp buildpackage: sloppy mode

#+BEGIN_SRC shell :results output
set -e
cd ~/tmp/demo
rm -rf hello-debhelper *.orig*
gbp import-dsc --no-pristine-tar data/hello-debhelper_2.8-1.dsc
cd hello-debhelper

git rm configure
git commit -m"drop configure"
#+END_SRC

Use debian branch without debian/ dir as upstream tarball:

#+BEGIN_SRC shell :results output
cd ~/tmp/demo/hello-debhelper
gbp buildpackage --git-upstream-tree=SLOPPY \
                 --git-no-pristine-tar \
                 --git-no-pbuilder \
                 --git-builder=/bin/true \
                 --git-no-hooks
tar -z --list -f hello-debhelper_2.8.orig.tar.gz  | grep -qs 'configure$' || echo "configure not found in tarball"
#+END_SRC

** gbp config: querying config

#+BEGIN_SRC shell
gbp config buildpackage.debian-branch
#+END_SRC

** docs
http://gbp.sigxcpu.org/manual

** gbp
*** https://pypi.org/project/gbp/
*** Python3 in experimental