Debian – workflow

Step 1: clone and build

git clone git@github.com:timmy00274672/demo_dh_make.git
cd demo_dh_make/
dpkg-buildpackage -rfakeroot -b -us -uc
sudo dpkg -i ../helloworld_0.1_amd64.deb
hello
sudo dpkg -r helloworld

Result:

bmc@bmc-R2-1208R-EV:~/workspace/tmp$ git clone git@github.com:timmy00274672/demo_dh_make.git
Cloning into 'demo_dh_make'...
remote: Enumerating objects: 88, done.
remote: Counting objects: 100% (88/88), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 88 (delta 20), reused 79 (delta 13), pack-reused 0
Receiving objects: 100% (88/88), 166.81 KiB | 0 bytes/s, done.
Resolving deltas: 100% (20/20), done.
Checking connectivity... done.

bmc@bmc-R2-1208R-EV:~/workspace/tmp$ cd demo_dh_make/

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ dpkg-buildpackage -rfakeroot -b -us -uc
dpkg-buildpackage: source package helloworld
dpkg-buildpackage: source version 0.1
dpkg-buildpackage: source distribution UNRELEASED
dpkg-buildpackage: source changed by Tim Chen <timchen@ingrasys.com>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build demo_dh_make
 fakeroot debian/rules clean
dh clean
   dh_testdir
   dh_auto_clean
        make -j1 distclean
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
rm -f src/hello
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_clean
 debian/rules build
dh build
   dh_testdir
   dh_update_autotools_config
   dh_auto_configure
   dh_auto_build
        make -j1
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
# CFLAGS=-g -O2 -fstack-protector-strong -Wformat
# -Werror=format-security
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security  -o src/hello src/hello.c
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_auto_test
 fakeroot debian/rules binary
dh binary
   dh_testroot
   dh_prep
   dh_auto_install
        make -j1 install DESTDIR=/home/bmc/workspace/tmp/demo_dh_make/debian/helloworld AM_UPDATE_INFO_DIR=no
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
install -D src/hello \
        /home/bmc/workspace/tmp/demo_dh_make/debian/helloworld/bin/hello
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_installdocs
   dh_installchangelogs
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   dh_strip
   dh_makeshlibs
   dh_shlibdeps
   dh_installdeb
   dh_gencontrol
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'helloworld' in '../helloworld_0.1_amd64.deb'.
 dpkg-genchanges -b >../helloworld_0.1_amd64.changes
dpkg-genchanges: binary-only upload (no source code included)
 dpkg-source --after-build demo_dh_make
dpkg-buildpackage: binary-only upload (no source included)

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ ls ..
demo_dh_make  helloworld_0.1_amd64.changes  helloworld_0.1_amd64.deb

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ sudo dpkg -i ../helloworld_0.1_amd64.deb
(Reading database ... 291316 files and directories currently installed.)
Preparing to unpack ../helloworld_0.1_amd64.deb ...
Unpacking helloworld (0.1) over (0.1) ...
Setting up helloworld (0.1) ...

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ hello
Hello, world!

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ sudo dpkg -r helloworld
(Reading database ... 291315 files and directories currently installed.)
Removing helloworld (0.1) ...

Step 2: change code

gbp pq import
change code (src/hello.c)
git add <file you changed>
git commit
dpkg-buildpackage -rfakeroot -b -us -uc
sudo dpkg -i ../helloworld_0.1_amd64.deb
hello
sudo dpkg -r helloworld

Result:

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ gbp pq import
gbp:info: Trying to apply patches at '9a241f67131019911d07d41407c3240ff70c241a'
gbp:info: Patches listed in 'debian/patches/series' imported on 'patch-queue/master'

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ git diff
diff --git a/src/hello.c b/src/hello.c
index ef0eb90..7c63dbb 100644
--- a/src/hello.c
+++ b/src/hello.c
@@ -2,7 +2,7 @@
 int
 main()
 {
-        printf("Hello, world!\n");
+        printf("Hello, world! v2\n");
         return 0;
 }

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ git add src/hello.c

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ git commit -m 'v2'
[patch-queue/master 72b5eea] v2
 1 file changed, 1 insertion(+), 1 deletion(-)

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ gbp pq export
gbp:info: On 'patch-queue/master', switching to 'master'
gbp:info: Generating patches from git (master..patch-queue/master)
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        debian/patches/0001-v2.patch
        debian/patches/series


bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ dpkg-buildpackage -rfakeroot -b -us -uc
dpkg-buildpackage: source package helloworld
dpkg-buildpackage: source version 0.1
dpkg-buildpackage: source distribution UNRELEASED
dpkg-buildpackage: source changed by Tim Chen <timchen@ingrasys.com>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build demo_dh_make
dpkg-source: info: applying 0001-v2.patch
 fakeroot debian/rules clean
dh clean
   dh_testdir
   dh_auto_clean
        make -j1 distclean
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
rm -f src/hello
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_clean
 debian/rules build
dh build
   dh_testdir
   dh_update_autotools_config
   dh_auto_configure
   dh_auto_build
        make -j1
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
# CFLAGS=-g -O2 -fstack-protector-strong -Wformat
# -Werror=format-security
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security  -o src/hello src/hello.c
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_auto_test
 fakeroot debian/rules binary
dh binary
   dh_testroot
   dh_prep
   dh_auto_install
        make -j1 install DESTDIR=/home/bmc/workspace/tmp/demo_dh_make/debian/helloworld AM_UPDATE_INFO_DIR=no
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
install -D src/hello \
        /home/bmc/workspace/tmp/demo_dh_make/debian/helloworld/bin/hello
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_installdocs
   dh_installchangelogs
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   dh_strip
   dh_makeshlibs
   dh_shlibdeps
   dh_installdeb
   dh_gencontrol
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'helloworld' in '../helloworld_0.1_amd64.deb'.
 dpkg-genchanges -b >../helloworld_0.1_amd64.changes
dpkg-genchanges: binary-only upload (no source code included)
 dpkg-source --after-build demo_dh_make
dpkg-source: info: unapplying 0001-v2.patch
dpkg-buildpackage: binary-only upload (no source included)

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ sudo dpkg -i ../helloworld_0.1_amd64.deb
Selecting previously unselected package helloworld.
(Reading database ... 291311 files and directories currently installed.)
Preparing to unpack ../helloworld_0.1_amd64.deb ...
Unpacking helloworld (0.1) ...
Setting up helloworld (0.1) ...

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ hello
Hello, world! v2

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ sudo dpkg -r helloworld
dpkg: warning: ignoring request to remove helloworld which isn't installed

Step 3: change again

git checkout patch-queue/master
change code (src/hello.c)
git add src/hello.c
git add src/hello.c
git commit
gbp pq export
dpkg-buildpackage -rfakeroot -b -us -uc
sudo dpkg -i ../helloworld_0.1_amd64.deb
hello
sudo dpkg -r helloworld

Result:

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ git checkout patch-queue/master
M       debian/helloworld/DEBIAN/md5sums
M       debian/helloworld/bin/hello
M       src/hello
Switched to branch 'patch-queue/master'

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ git diff src/hello.c
diff --git a/src/hello.c b/src/hello.c
index 7c63dbb..1dfb5dd 100644
--- a/src/hello.c
+++ b/src/hello.c
@@ -3,6 +3,7 @@ int
 main()
 {
         printf("Hello, world! v2\n");
+       printf("second line\n");
         return 0;
 }

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ git add src/hello.c

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ git commit -m 'add a line'
[patch-queue/master 41120cc] add a line
 1 file changed, 1 insertion(+)

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ gbp pq export
gbp:info: On 'patch-queue/master', switching to 'master'
gbp:info: Generating patches from git (master..patch-queue/master)
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        debian/patches/0001-v2.patch
        debian/patches/0002-add-a-line.patch
        debian/patches/series

nothing added to commit but untracked files present (use "git add" to track)

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ dpkg-buildpackage -rfakeroot -b -us -uc
dpkg-buildpackage: source package helloworld
dpkg-buildpackage: source version 0.1
dpkg-buildpackage: source distribution UNRELEASED
dpkg-buildpackage: source changed by Tim Chen <timchen@ingrasys.com>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build demo_dh_make
dpkg-source: info: applying 0001-v2.patch
dpkg-source: info: applying 0002-add-a-line.patch
 fakeroot debian/rules clean
dh clean
   dh_testdir
   dh_auto_clean
        make -j1 distclean
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
rm -f src/hello
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_clean
 debian/rules build
dh build
   dh_testdir
   dh_update_autotools_config
   dh_auto_configure
   dh_auto_build
        make -j1
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
# CFLAGS=-g -O2 -fstack-protector-strong -Wformat
# -Werror=format-security
cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security  -o src/hello src/hello.c
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_auto_test
 fakeroot debian/rules binary
dh binary
   dh_testroot
   dh_prep
   dh_auto_install
        make -j1 install DESTDIR=/home/bmc/workspace/tmp/demo_dh_make/debian/helloworld AM_UPDATE_INFO_DIR=no
make[1]: Entering directory '/home/bmc/workspace/tmp/demo_dh_make'
install -D src/hello \
        /home/bmc/workspace/tmp/demo_dh_make/debian/helloworld/bin/hello
make[1]: Leaving directory '/home/bmc/workspace/tmp/demo_dh_make'
   dh_installdocs
   dh_installchangelogs
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   dh_strip
   dh_makeshlibs
   dh_shlibdeps
   dh_installdeb
   dh_gencontrol
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'helloworld' in '../helloworld_0.1_amd64.deb'.
 dpkg-genchanges -b >../helloworld_0.1_amd64.changes
dpkg-genchanges: binary-only upload (no source code included)
 dpkg-source --after-build demo_dh_make
dpkg-source: info: unapplying 0002-add-a-line.patch
dpkg-source: info: unapplying 0001-v2.patch
dpkg-buildpackage: binary-only upload (no source included)

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ sudo dpkg -i ../helloworld_0.1_amd64.deb
Selecting previously unselected package helloworld.
(Reading database ... 291311 files and directories currently installed.)
Preparing to unpack ../helloworld_0.1_amd64.deb ...
Unpacking helloworld (0.1) ...
Setting up helloworld (0.1) ...

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ hello
Hello, world! v2
second line

bmc@bmc-R2-1208R-EV:~/workspace/tmp/demo_dh_make$ sudo dpkg -r helloworld
(Reading database ... 291315 files and directories currently installed.)
Removing helloworld (0.1) ...

Leave a comment

Design a site like this with WordPress.com
Get started