[pkg-kolab] r1268 - /

Mathieu Parent mparent-guest at alioth.debian.org
Thu Apr 23 17:31:44 UTC 2009


Author: mparent-guest
Date: 2009-04-23 17:31:44 +0000 (Thu, 23 Apr 2009)
New Revision: 1268

Modified:
   pkg-kolab_toolbox
Log:
- Allow to configure base directory
- Add a prepare command to build packages ready for debuild

Merci Benoit Mortier !



Modified: pkg-kolab_toolbox
===================================================================
--- pkg-kolab_toolbox	2009-04-09 01:24:08 UTC (rev 1267)
+++ pkg-kolab_toolbox	2009-04-23 17:31:44 UTC (rev 1268)
@@ -20,6 +20,10 @@
 
 Issue a custom command (B<--command>)
 
+=item I<prepare>
+
+Command to prepare the packages to be build with pbuilder
+
 =back
 
 =head1 OPTIONS
@@ -42,11 +46,16 @@
 
 Change branch (default: current)
 
+=item B<--basedir>
+
+By default the base dir is where you are, you can change it with this option
+
 =item B<--command>
 
 Command to be issued when using I<command> or I<build>. The command is issued
 from the branch directory.
 
+
 =back
 
 =head1 COPYRIGHT AND AUTHORS
@@ -76,8 +85,6 @@
 use Pod::Usage;
 use File::Path;
 
-my $basedir = '/home/mathieu/apps/pkg-kolab';
-
 my %branches = (
     'current' => {
         'libkolab-perl' => 'trunk',
@@ -96,6 +103,7 @@
 my $o_verbose = '';
 my $o_branch = 'current';
 my $o_command = '';
+my $o_basedir = `pwd`;
 
 Getopt::Long::Configure('permute');
 my $result = GetOptions(
@@ -104,6 +112,7 @@
     'verbose!' => \$o_verbose,
     '<>' => \&process,
     'branch=s' => \$o_branch,
+    'basedir=s' => \$o_basedir,
     'command=s' => \$o_command,
     ) or pod2usage(2);
 
@@ -119,20 +128,29 @@
 sub process {
     my $action = shift;
     info("Empty branch `$o_branch'") if(!defined($branches{$o_branch}));
-    if($action eq 'build' || $action eq 'command') {
+    if($action eq 'build' || $action eq 'command' || $action eq 'prepare') {
         for my $package ( keys %{ $branches{$o_branch} } ) {
             my $branch = $branches{$o_branch}{$package};
 	    info("================================");
 	    info($package);
 	    info("================================");
 	    if($action eq 'build') {
-	         rmtree("$basedir/$package/build-area");
-	         chdir "$basedir/$package/$branch";
+	         rmtree("$o_basedir/$package/build-area");
+	         chdir "$o_basedir/$package/$branch";
 	         system("svn-buildpackage --svn-ignore-new > /dev/null 2> /dev/null");
-	         chdir "$basedir/$package/build-area";
-	         system("lintian --display-info --pedantic --color always *.changes");
+	         chdir "$o_basedir/$package/build-area";
+	         system("lintian --display-info --color always *.changes");
             }
-	    chdir "$basedir/$package/$branch";
+
+	    if($action eq 'prepare') {
+		chomp $o_basedir;
+	        rmtree("$o_basedir/$package/build-area");
+	        chdir "$o_basedir/$package/$branch";
+		print "$o_basedir/$package/$branch\n";
+	        system("svn-buildpackage --svn-export --svn-verbose ");
+            }
+
+	    chdir "$o_basedir/$package/$branch";
 	    if($o_command) {
 	        system($o_command);
             }




More information about the pkg-kolab-devel mailing list