[Buildd-tools-devel] Current work on sbuild
Roger Leigh
rleigh at whinlatter.ukfsn.org
Tue May 20 22:19:38 UTC 2008
Roger Leigh <rleigh at whinlatter.ukfsn.org> writes:
> Over the last week, I have been working on making the core code in
> sbuild more maintainable in the future. While this is still not
> complete, I thought I should let you know what I've been doing so far.
>
> The changes so far are available from
>
> http://git.debian.org/?p=users/rleigh/sbuild.git;a=summary
> (git://git.debian.org/git/users/rleigh/sbuild.git)
>
> branch build-object.
>
> Most of the recent changes focus on moving from using global variables
> (main::*) to using a single hash (main::build_object) which contains
> all of the state of a single build, plus the command-line options.
>
> Once all of the global state has been replaced by the single object,
> most of the function call parameters can be refactored to remove all
> the redundant information being passed around (it's all in one place).
> We can then convert this to a perl object and all the functions will
> be class methods. This will then allow further cleanup of the code.
This part is now complete. You can get the code from the above
repository using GIT to pull them into your existing repository, or
clone it directly. To pull it in to a branch in your own repo cloned
From the main buildd-tools repo on git.debian.org:
% git checkout master
% git branch --track build-object-test
% git checkout build-object-test
% git pull git://git.debian.org/git/users/rleigh/sbuild.git build-object:build-object-test
You now have all the changes on a build-object-test branch, which you
can then merge back onto the master branch, or further branch if you
wish. The log of all the changes made is at the end of this mail.
If any sbuild users are willing to test this, I would be very
grateful. While the program logic is identical, and the changes made
are quite simple, the sheer number of changes makes some bugs likely,
though I would of course hope that the refactoring was flawless :)
If there are no issues found, I'd like to merge this into the master
branch at the weekend. As always, comments are welcome--if people
think this type of refactoring is a bad plan, or have any other
thoughts, I'd really like to hear!
Regards,
Roger
commit a7693de34454edae1515bf3faeb39af70dd38635
Merge: d92498b... cb27716...
Author: Roger Leigh <rleigh at debian.org>
Date: Tue May 20 23:03:46 2008 +0100
Merge branch 'master' into build-object
Conflicts:
TODO
commit d92498bd8e52b550ad2037d035cd59486bfdc622
Author: Roger Leigh <rleigh at debian.org>
Date: Tue May 20 23:00:06 2008 +0100
[TODO] Note logging issues
TODO | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
commit b9ca49b4ebd1f434f0f08a8a55769bf237661567
Author: Roger Leigh <rleigh at debian.org>
Date: Tue May 20 22:56:56 2008 +0100
[Sbuild::Build] Move Sbuild::Build from sbuild
All Sbuild::Build module code moved from sbuild.
lib/Sbuild/Build.pm is distributed and installed.
bin/sbuild | 2431 +-----------------------------------------------
lib/Sbuild/Build.pm | 2385 ++++++++++++++++++++++++++++++++++++++++++++++-
lib/Sbuild/Makefile.am | 3 +-
3 files changed, 2382 insertions(+), 2437 deletions(-)
commit 9f4c7bdd5490a2a4d18f80038b68f406173f43b0
Author: Roger Leigh <rleigh at debian.org>
Date: Tue May 20 22:51:52 2008 +0100
[sbuild] Convert build hash into Sbuild::Build class
bin/sbuild | 1587 +++++++++++++++++++++++++++++++-----------------------------
1 files changed, 819 insertions(+), 768 deletions(-)
commit 0e64d9b93f3d3907ca9973bc0728962a06bdb8c4
Author: Roger Leigh <rleigh at debian.org>
Date: Tue May 20 22:49:51 2008 +0100
[Sbuild::Chroot] Don't export new
lib/Sbuild/Chroot.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit 265d7c46878ed221d679d46c1a4cb0e1ce907201
Author: Roger Leigh <rleigh at debian.org>
Date: Tue May 20 22:46:39 2008 +0100
[Sbuild] copy() does not need a self argument
lib/Sbuild.pm | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
commit 5c97b2637772befb8ba488a5c85378690a81226b
Author: Roger Leigh <rleigh at debian.org>
Date: Sun May 18 00:14:51 2008 +0100
[sbuild] Move shutdown() to end of file
bin/sbuild | 206 ++++++++++++++++++++++++++++++------------------------------
1 files changed, 103 insertions(+), 103 deletions(-)
commit f737178c40f67334bd17450a0629aaec6478fe99
Author: Roger Leigh <rleigh at debian.org>
Date: Sun May 18 00:12:38 2008 +0100
[Sbuild] Move copy() from sbuild
bin/sbuild | 35 +++--------------------------------
lib/Sbuild.pm | 31 ++++++++++++++++++++++++++++++-
2 files changed, 33 insertions(+), 33 deletions(-)
commit dc563c8cc3b612ccebaffbdc7a13fcd1bae39d1d
Author: Roger Leigh <rleigh at debian.org>
Date: Sun May 18 00:08:24 2008 +0100
[sbuild] build_new: Initialise 'GCC Snapshot' as integer, not array
bin/sbuild | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit e4e7623d05285dd738de54d4a4429b26326919bf
Author: Roger Leigh <rleigh at debian.org>
Date: Sun May 18 00:06:29 2008 +0100
[Sbuild::Conf] Move $stats_dir from sbuild
$stats dir moved from main:: in sbuild.
Exported by Sbuild::Conf.
Defaulted to $HOME/stats
Added to sbuild.conf and example.sbuildrc.
bin/sbuild | 23 ++++++++++++++---------
etc/example.sbuildrc | 3 +++
etc/sbuild.conf | 3 +++
lib/Sbuild/Conf.pm | 17 +++++++++--------
4 files changed, 29 insertions(+), 17 deletions(-)
commit 3153173b82e01a337608b39744d3b01ea3f09b9f
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 23:48:19 2008 +0100
[sbuild] Replace %main::this_watches
bin/sbuild | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
commit c63103f59c3af302011bd7ad667a795dc9b22060
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 23:44:55 2008 +0100
[sbuild] Replace $main::pkg_fail_stage and $main::useSNAP
bin/sbuild | 40 +++++++++++++++++++---------------------
1 files changed, 19 insertions(+), 21 deletions(-)
commit 178084457605e7ebf6df75b98904eb034baa7fc9
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 23:37:29 2008 +0100
[sbuild] Replace $main::sub_pid and remove $main::shutdown in dump code
bin/sbuild | 37 +++++++++++++++++--------------------
1 files changed, 17 insertions(+), 20 deletions(-)
commit 1f2bbddaaaae3ef79a87133fff92b604c822a558
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 23:32:00 2008 +0100
[sbuild] Remove @main::manual_srcdeps
bin/sbuild | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
commit 85becb50444ce3d7264ac0ba43adcb6da736620f
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 23:29:22 2008 +0100
[sbuild] Replace $main::ld_library_path
bin/sbuild | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
commit c38a2159c2fad7d2829e898845d934dc33c05e19
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 23:09:59 2008 +0100
[sbuild] Replace $main::have_dsc_build_deps
bin/sbuild | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
commit 6eacf8707e13e2ee6f90fd2e2215387dbb42a121
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 23:05:45 2008 +0100
[sbuild] Replace $main::dpkg_buildpackage_signopt
bin/sbuild | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
commit 5ced3fe4a5e8d2611794890f3ac6a3006a555113
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 23:02:56 2008 +0100
[sbuild] Replace $main::deps
bin/sbuild | 39 +++++++++++++++++++--------------------
1 files changed, 19 insertions(+), 20 deletions(-)
commit af5350febf6af09e595490fe6583f7161241fb35
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 22:56:29 2008 +0100
[sbuild] Replace $main::database
bin/sbuild | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
commit d95c5b20a2488772cf84a3bd84190faad4dc05e1
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 15:54:14 2008 +0100
[sbuild] Replace %main::changes
bin/sbuild | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
commit 1c0e1112ac1cc6e8069feb40597d7b0481bfc372
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 15:29:25 2008 +0100
[sbuild] Replace $main::build_start_time
bin/sbuild | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
commit 699be6210a2c4afc0f79c827a3dad0b5b6f3263b
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 15:27:11 2008 +0100
[sbuild] Replace $main::binNMU*
bin/sbuild | 49 +++++++++++++++++++++++++------------------------
1 files changed, 25 insertions(+), 24 deletions(-)
commit 58ec0fd3dac94d33eb6132a69de92fd84b976e15
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 15:20:19 2008 +0100
[sbuild] Replace $main::additional_deps
bin/sbuild | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
commit f4958e566442765e68bd09bb939e8e0ab2bcd7aa
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 14:54:59 2008 +0100
[sbuild] Replace $main::sub_task
bin/sbuild | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
commit 0c5821b193619fe6303c75f6f64b4c1666458f90
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 14:52:34 2008 +0100
[sbuild] Replace $main::override_distribution
bin/sbuild | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
commit 65d14bf861f397b72940a349ec1d1b1767616894
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 14:50:43 2008 +0100
[sbuild] Replace @main::toolchain_pkgs
bin/sbuild | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
commit 2c50820f2918a018741a9fd8cff57e27fad93df0
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 14:36:25 2008 +0100
[sbuild] Replace $main::this_space
bin/sbuild | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
commit 68da16515960351060d733248bbb82b81879854c
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 14:22:35 2008 +0100
[sbuild] Replace $main::pkg*
bin/sbuild | 51 ++++++++++++++++++++++-----------------------------
1 files changed, 22 insertions(+), 29 deletions(-)
commit dca244a0ab514edf7facfffe21521f6339400d4f
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 13:38:36 2008 +0100
[sbuild] Replace $main::ilock_file
bin/sbuild | 25 ++++++++++---------------
1 files changed, 10 insertions(+), 15 deletions(-)
commit f8424b500de79faa6df82c496119b1f3a05ca46c
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 13:35:45 2008 +0100
[sbuild] Replace $main::srcdep_lock*
bin/sbuild | 30 +++++++++++-------------------
1 files changed, 11 insertions(+), 19 deletions(-)
commit 8bb1a7ef891e7c7bd862580495fb6ef4b02b06a6
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 13:30:47 2008 +0100
[sbuild] Replace $main::chroot*
bin/sbuild | 115 +++++++++++++++++++++++++++++------------------------------
1 files changed, 57 insertions(+), 58 deletions(-)
commit bc97881530b28481d1757d93a421a68a50070930
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 13:17:59 2008 +0100
[Sbuild::Conf] Move lock timeout settings from being hardcoded in sbuild
bin/sbuild | 16 ++--------
etc/sbuild.conf | 7 ++++
lib/Sbuild/Build.pm | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
lib/Sbuild/Conf.pm | 7 +++-
4 files changed, 95 insertions(+), 15 deletions(-)
commit 66c4345d854f99aa14693aa85af8382b9e02f87c
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:42:11 2008 +0100
[sbuild] Replace $main::jobs_file
bin/sbuild | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
commit c2ed2a4deff575b72561a2fc99ac577db550a424
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:39:02 2008 +0100
[sbuild] Remove redundant main:: namespace usage
bin/sbuild | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit 5bca06718b8d10a738a0416b1b2b1ea7146a3fb5
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:37:31 2008 +0100
[sbuild] Replace $main::build_arch_all and $main::build_source
bin/sbuild | 24 +++++++++++-------------
1 files changed, 11 insertions(+), 13 deletions(-)
commit 91ba7baddeb016e1d9608acc612a9b798d1203f7
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:30:50 2008 +0100
[sbuild] Replace $main::verbose
bin/sbuild | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
commit 070673d342353fa3f01ca781168f00de49bd2825
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:29:35 2008 +0100
[sbuild] Replace $main::username
bin/sbuild | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)
commit dcf8e7a70800445927ce6a51f1bab82adc7b3c95
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:26:46 2008 +0100
[sbuild] Remove $main::nolog
bin/sbuild | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
commit 82cb64018a577f09f2ba45c21b747d0e5fc562ff
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:25:51 2008 +0100
[sbuild] Remove $main::cwd
bin/sbuild | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
commit 6063f102efd1f29f186af77544cd370a5670658f
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:23:46 2008 +0100
[sbuild] Replace $main::auto_giveback*
bin/sbuild | 40 ++++++++++++++++------------------------
1 files changed, 16 insertions(+), 24 deletions(-)
commit e715a91f3fcb2a104dc9f199e9e1be23723fccb6
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:11:14 2008 +0100
[sbuild] Replace $main::batchmode
bin/sbuild | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
commit cfea6c6380573cea6bcc49a06b4dd2d3b85f836f
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:07:34 2008 +0100
[sbuild] Replace $main::user_arch
bin/sbuild | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
commit ff8e92121f12c89b87a9f1741f847183e4e73ba4
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:05:58 2008 +0100
[sbuild] Replace $main::arch
bin/sbuild | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
commit 3064be7160fc3b89647c79e1664dd9d3f871c422
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 12:03:35 2008 +0100
[sbuild] Move global statements into main function
bin/sbuild | 495 ++++++++++++++++++++++++++++++-----------------------------
1 files changed, 252 insertions(+), 243 deletions(-)
commit 5e5e987ad1dd5a7c51b5ff9d53c9709312f40989
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 11:57:58 2008 +0100
[sbuild] Build object creation and initialisation separated into function
bin/sbuild | 156 +++++++++++++++++++++++++++++++-----------------------------
1 files changed, 81 insertions(+), 75 deletions(-)
commit 286efa216265327730bd8faa236d3c4d6d2413f4
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 11:52:06 2008 +0100
[sbuild] Remove $session (2)
bin/sbuild | 124 ++++++++++++++++++++++++++----------------------------------
1 files changed, 54 insertions(+), 70 deletions(-)
commit fbfda502dd1e248d4e63de72da914ec2c8ba82f1
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 11:37:08 2008 +0100
[sbuild] Remove $session (1)
bin/sbuild | 340 ++++++++++++++++++++++++++++++------------------------------
1 files changed, 170 insertions(+), 170 deletions(-)
commit 7dfc639c0b2585149d1bf256a3e0d367b01008c9
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 11:20:13 2008 +0100
[sbuild] Replace $main::current_session
bin/sbuild | 65 ++++++++++++++++++++++++++++-------------------------------
1 files changed, 31 insertions(+), 34 deletions(-)
commit 46c95673aa51801f6619744245f91244db712d71
Author: Roger Leigh <rleigh at debian.org>
Date: Sat May 17 11:16:01 2008 +0100
[sbuild] Replace $main::distribution
bin/sbuild | 55 +++++++++++++++++++++++++++----------------------------
1 files changed, 27 insertions(+), 28 deletions(-)
commit 77b7a63008bc10012241908d549b0c1899d5f79b
Author: Roger Leigh <rleigh at debian.org>
Date: Tue May 13 22:04:23 2008 +0100
[sbuild] All functions take self argument
bin/sbuild | 497 +++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 293 insertions(+), 204 deletions(-)
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20080520/388e4631/attachment.pgp
More information about the Buildd-tools-devel
mailing list