#
# This file is part of Koha.
#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
-# Written by Robin Sheat <robin@catalyst.net.nz>
+# Written by Robin Sheat <robin@catalyst.net.nz> and
+# Srdjan Jankovic <srdjan@catalyst.net.nz>
# Based on an sh version by Lars Wirzenius.
use strict;
my $buildresult;
my $distribution='squeeze-dev';
my $git_checks='all';
-my $version='3.3-1~git';
+my $version='3.23~git';
my $auto_version=1;
my $need_help;
my $debug;
my ($command) = @_;
print "$command\n" if $debug;
- open COMMAND, "$command |"
+ my $command_output;
+ open($command_output, "-|", "$command ")
or die qq{Cannot execute "$command": $!"};
- return map { chomp; $_ } <COMMAND>;
+ return map { chomp; $_ } <$command_output>;
+}
+
+sub sys_command_output_screen {
+ my ($command) = @_;
+
+ print "$command\n" if $debug;
+ system($command) == 0 or die "Command '$command' returns an error ($?)\n";
}
sub everything_is_committed {
tracked files with untracked changes will cause an error), and 'none'
(checking git status is skipped totally.) Default is 'all'.
--version, -v
- the version string for the resulting package. Default is '3.3-1~git'.
+ the version string for the resulting package. Default is '$version'.
--(no)autoversion
whether or not to use the date and git commit ID in the version value.
Default is to include it.
sys_command_output( qq{git archive --format=tar --prefix="koha-$newversion/" HEAD | gzip -9 > "../koha_$newversion.tar.gz"} );
my $pdebuildopts = $buildresult ? "--buildresult $buildresult" : "";
- sys_command_output( "pdebuild $pdebuildopts" );
+ sys_command_output_screen( "pdebuild $pdebuildopts" );
}
everything_is_committed() or die "cannot build: uncommited changes";