X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=debian%2Fbuild-git-snapshot;h=cedddae525b838e9b07597c2e83c9938e2821830;hb=c123b414800a9a7f20d1a7948baa6ea43025eec6;hp=94c4ea8f59e3b869f6eaed48ba5c3b9def0e2be5;hpb=4d373f6c444ab2806e3646302d2ddfb08450a554;p=koha-ffzg.git diff --git a/debian/build-git-snapshot b/debian/build-git-snapshot index 94c4ea8f59..cedddae525 100755 --- a/debian/build-git-snapshot +++ b/debian/build-git-snapshot @@ -4,38 +4,39 @@ # # 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 . # Written by Robin Sheat and # Srdjan Jankovic # Based on an sh version by Lars Wirzenius. -use strict; -use warnings; +use Modern::Perl; -use Getopt::Long; +use Getopt::Long qw(:config no_ignore_case); use POSIX qw/strftime/; +my $basetgz; my $buildresult; my $distribution='squeeze-dev'; my $git_checks='all'; -my $version='3.11-1~git'; +my $version='16.06~git'; my $auto_version=1; my $need_help; my $debug; GetOptions( + 'basetgz|b=s' => \$basetgz, 'buildresult|r=s' => \$buildresult, 'distribution|D=s' => \$distribution, 'git-checks|g=s' => \$git_checks, @@ -62,7 +63,7 @@ sub sys_command_output_screen { my ($command) = @_; print "$command\n" if $debug; - system($command); + system($command) == 0 or die "Command '$command' returns an error ($?)\n"; } sub everything_is_committed { @@ -108,7 +109,7 @@ Options: 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.5-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. @@ -123,6 +124,8 @@ sub latest_sha1 { sub adjust_debian_changelog { my ($newversion) = @_; + # debian revision + $newversion .= "-1"; sys_command_output( qq{dch --force-distribution -D "$distribution" -v "$newversion" "Building git snapshot."} ); sys_command_output( qq{dch -r "Building git snapshot."} ); @@ -134,10 +137,11 @@ sub reset_debian_changelog { sub build_package { my ($newversion) = @_; - sys_command_output( qq{git archive --format=tar --prefix="koha-$newversion/" HEAD | gzip -9 > "../koha_$newversion.tar.gz"} ); + sys_command_output( qq{git archive --format=tar --prefix="koha-$newversion/" HEAD | gzip -9 > "../koha_$newversion.orig.tar.gz"} ); my $pdebuildopts = $buildresult ? "--buildresult $buildresult" : ""; - sys_command_output_screen( "pdebuild $pdebuildopts" ); + my $pdebuildbasetgz = $basetgz ? "-- --basetgz /var/cache/pbuilder/" . $basetgz . ".tgz" : ""; + sys_command_output_screen( "pdebuild $pdebuildbasetgz $pdebuildopts" ); } everything_is_committed() or die "cannot build: uncommited changes";