[Pkg-octave-commit] [octave-pkg-dev] 03/03: check-pkg: Only create files if they do not exist yet
Rafael Laboissiere
rafael at debian.org
Fri Sep 1 08:10:56 UTC 2017
This is an automated email from the git hooks/post-receive script.
rafael pushed a commit to branch master
in repository octave-pkg-dev.
commit 8e2851d3bd0bedde667ef0e2e34c919b29bc9623
Author: Rafael Laboissiere <rafael at debian.org>
Date: Fri Sep 1 05:01:55 2017 -0300
check-pkg: Only create files if they do not exist yet
---
make-octave-forge-debpkg.in | 45 ++++++++++++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 17 deletions(-)
diff --git a/make-octave-forge-debpkg.in b/make-octave-forge-debpkg.in
index 3fbf3d0..c47a73c 100755
--- a/make-octave-forge-debpkg.in
+++ b/make-octave-forge-debpkg.in
@@ -64,6 +64,10 @@ are generated with sensible contents, although they need further editing:
=back
+The files above are only create if they do not exist yet. This allow
+the use of make-octave-forge-debpkg for updating an already
+debianized source tree.
+
=head1 ENVIRONMENT VARIABLES
The environment variables B<DEBFULLNAME> and B<DEBEMAIL> are used for
@@ -109,10 +113,12 @@ sub makedir ($) {
}
### Function for opening a file and adding content to it
-sub writefile ($$) {
+sub writefile ($$$) {
+ my $mode = shift;
my $file = shift;
+ return if mode != "<<" and -e $file;
my $content = shift;
- open (FID, $file);
+ open (FID, $mode, $file);
print FID $content;
close FID;
}
@@ -149,10 +155,10 @@ makedir "debian";
### Create the debian/compat file.
my $compat = #Compat#;
-writefile ("> debian/compat", $compat);
+writefile (">", "debian/compat", $compat);
### Create the debian/watch file.
-writefile ("> debian/watch",
+writefile (">", "debian/watch",
"version=4
http://sf.net/octave/$name-(.+)\\.tar\\.gz
");
@@ -168,7 +174,7 @@ my $email = exists $ENV{DEBEMAIL} ? $ENV{DEBEMAIL}
: "joe\@developer.org";
my $author = "$developer <$email>";
-writefile ("> debian/changelog",
+writefile (">", "debian/changelog",
"octave-$name ($version-1) UNRELEASED; urgency=low
* Initial release (closes: #XXXXXX)
@@ -177,7 +183,7 @@ writefile ("> debian/changelog",
");
### Create the debian/rules file.
-writefile ("> debian/rules",
+writefile (">", "debian/rules",
"#!/usr/bin/make -f
# -*- makefile -*-
@@ -197,7 +203,7 @@ if ($architecture eq "any") {
$shlibs = ", \${shlibs:Depends}";
}
-writefile ("> debian/control",
+writefile (">", "debian/control",
"Source: octave-$name
Section: math
Priority: optional
@@ -219,18 +225,21 @@ Description: $title
### Create the debian/source/format file.
makedir "debian/source";
-writefile ("> debian/source/format", "3.0 (quilt)\n");
+writefile (">", "debian/source/format", "3.0 (quilt)\n");
### Create the debian/copyright file.
-system ("licensecheck -r --copyright -c '\\.m|\\.cc|\\.c|\\.h|\\.f' . "
- . "| /usr/lib/cdbs/licensecheck2dep5 > debian/copyright");
+unless (-e "debian/copyright") {
+
+ ## Add the automated part from licensecheck
+ system ("licensecheck -r --copyright -c '\\.m|\\.cc|\\.c|\\.h|\\.f' . "
+ . "| /usr/lib/cdbs/licensecheck2dep5 > debian/copyright");
-my $year = qx {date +%Y};
-chomp $year;
+ ## Create the Debian specific part to the debian/control file.
+ my $year = qx {date +%Y};
+ chomp $year;
-### Create the Debian specific part to the debian/control file.
-writefile (">> debian/copyright",
- "Files: debian/*
+ writefile (">>", "debian/copyright",
+ "Files: debian/*
Copyright: $year $author
License: GPL-3+
@@ -253,15 +262,17 @@ License: GPL-3+
`/usr/share/common-licenses/GPL-3'.
");
+}
+
### Create the autopkgtest files
makedir "debian/tests";
-writefile ("> debian/tests/control",
+writefile (">", "debian/tests/control",
"Tests: unit-tests
Depends: @, octave-pkg-dev (>= #Version#)
");
system ("chmod +x debian/tests/control");
-writefile ("> debian/tests/unit-tests",
+writefile (">", "debian/tests/unit-tests",
"#!/bin/sh
exec 2>&1
--
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/octave-pkg-dev.git
More information about the Pkg-octave-commit
mailing list