[Po4a-commits] "po-debconf podebconf-report-po,1.53,1.54"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Thu May 8 21:25:05 UTC 2008


Update of /cvsroot/po4a/po-debconf
In directory alioth:/tmp/cvs-serv5927

Modified Files:
	podebconf-report-po 
Log Message:
  * Allow the specification of a deadline by an offset, when the deadline
    starts with a '+'.
  * Set the default deadline to +10days.
  * Add a --nodeadline option.
  * Add a deadline and nodeadline option for the configuration file.


Index: podebconf-report-po
===================================================================
RCS file: /cvsroot/po4a/po-debconf/podebconf-report-po,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- podebconf-report-po	8 May 2008 20:52:15 -0000	1.53
+++ podebconf-report-po	8 May 2008 21:25:01 -0000	1.54
@@ -142,6 +142,7 @@
  "addlanguageteam=s"=>\@ADDLANGUAGETEAM,
  "package=s"       => \$PACKAGE_ARG,
  "deadline=s"      => \$DEADLINE_ARG,
+ "nodeadline"      => \$NO_DEADLINE,
  "call:s"          => \$CALL,
  "withtranslators" => \$CALL_WITH_TRANSLATORS,
  "withouttranslators" => \$CALL_WITHOUT_TRANSLATORS,
@@ -306,6 +307,19 @@
 	$GZIP_ARG = 0;
 }
 
+if (defined $NO_DEADLINE) {
+	undef $DEADLINE_ARG;
+} elsif (defined $DEADLINE_ARG) {
+	# Use the specified deadline
+} elsif ($conf =~ m/^nodeadline$/m) {
+	undef $DEADLINE_ARG;
+} elsif ($conf =~ m/^deadline\s*(?:\s|=)\s*(.*)$/m) {
+	$DEADLINE_ARG = $1;
+} else {
+	# The default deadline is +10days
+	$DEADLINE_ARG = "+10days";
+}
+
 if (defined $NO_LANGUAGETEAM) {
 	$LANGUAGETEAM_ARG = 0;
 } elsif (defined $LANGUAGETEAM_ARG) {
@@ -464,6 +478,15 @@
 Verbose("Version: $PKG_VERSION");
 Verbose("Maintainer: $FROM_ARG");
 
+# If the specified deadline starts with a '+', it is an offset from now.
+if ($DEADLINE_ARG =~ m/^\+/) {
+	my $cmd = "LC_ALL=C date -R -d \"$DEADLINE_ARG\"";
+	$DEADLINE_ARG = qx/$cmd/;
+	if ($? != 0) {
+		die "failed to execute '$cmd': $!.")
+	}
+}
+
 if ($DEADLINE_ARG ne "") {
 	$DEADLINE_ARG = "\nThe deadline for receiving the updated translation is $DEADLINE_ARG.";
 }




More information about the Po4a-commits mailing list