aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSwedish Language Team <swedish>2000-05-17 21:42:04 +0000
committerSwedish Language Team <swedish>2000-05-17 21:42:04 +0000
commit77b7746cc94f721ebd9141c9ff06d4c8c095051e (patch)
tree93a2149e18e2a876576aed9fed354788c956d9c4
parentd7a72f661ce0372a4c5eebb3bea7e84673826c71 (diff)
Does not overwrite if destination file exists
CVS version numbers copypage.pl: 1.3 -> 1.4 swedish/News/weekly/copyissue.pl: 1.2 -> 1.3 swedish/security/copyadvisory.pl: 1.1 -> 1.2
-rwxr-xr-xcopypage.pl5
-rwxr-xr-xswedish/News/weekly/copyissue.pl29
-rwxr-xr-xswedish/security/copyadvisory.pl35
3 files changed, 60 insertions, 9 deletions
diff --git a/copypage.pl b/copypage.pl
index fdb53a3ca12..eae864cebb7 100755
--- a/copypage.pl
+++ b/copypage.pl
@@ -28,11 +28,11 @@ else
# Check usage.
unless ($page)
{
- print "Usage: $0 page\n";
+ print "Usage: $0 page\n\n";
print "Copies the page from the english/ directory to the $language/ directory\n";
print "and adds the translation string\n";
print "If the directory does not exist, it will be created, and the Makefile\n";
- print "copied.\n";
+ print "copied.\n\n";
print "You can either keep or not keep the 'english/' part of the path.\n";
exit;
}
@@ -70,6 +70,7 @@ $dstmake = $dstdir . "Makefile"; # Name of destination Makefile
# Sanity checks
die "Directory $srcdir does not exist\n" unless -d $srcdir;
die "File $srcfile does not exist\n" unless -e $srcfile;
+die "File $dstfile already exists\n" if -e $dstfile;
# Check if destination exists, if not - create it
unless (-d $dstdir)
diff --git a/swedish/News/weekly/copyissue.pl b/swedish/News/weekly/copyissue.pl
index 769f87ad773..466706f1f2f 100755
--- a/swedish/News/weekly/copyissue.pl
+++ b/swedish/News/weekly/copyissue.pl
@@ -1,7 +1,20 @@
#!/usr/bin/perl -w
+# This script copies a DWN issue as given on the command line to the
+# translation named in copypage.conf, translates the dates and a few
+# strings, and adds the <!--translation x.x--> string to it. It also will
+# create the destination directory if necessary.
+
+# Written in 2000 by peter karlsson <peter@softwolves.pp.se>
+# © Copyright 2000 Software in the public interest, Inc.
+# This program is released under the GNU General Public License, v2.
+
+# $Id$
+
+# Get command line
($year, $issue) = @ARGV;
+# Check usage.
unless ($year && $issue)
{
print "Usage: $0 year issue\n\n";
@@ -10,16 +23,20 @@ unless ($year && $issue)
exit;
}
+# Create needed file and directory names
$srcdir = "../../../english/News/weekly/$year/$issue";
$srcfile= "$srcdir/index.wml";
$cvsfile= "$srcdir/CVS/Entries";
$dstdir = "./$year/$issue";
$dstfile= "$dstdir/index.wml";
+# Sanity checks
die "Directory $srcdir does not exist\n" unless -d $srcdir;
die "File $srcfile does not exist\n" unless -e $srcfile;
+die "File $dstfile already exists\n" if -e $dstfile;
mkdir $dstdir, 0755 unless -d $dstdir;
+# Open the files
open CVS, $cvsfile
or die "Could not read $cvsfile ($!)\n";
@@ -29,6 +46,7 @@ open SRC, $srcfile
open DST, ">$dstfile"
or die "Could not create $dstfile ($!)\n";
+# Retrieve the CVS version number
while (<CVS>)
{
if (m[^/index\.wml/([0-9]*\.[0-9])*/]o)
@@ -39,14 +57,21 @@ while (<CVS>)
close CVS;
-print "Could not get revision number\n" unless $revision;
+unless ($revision)
+{
+ print "Could not get revision number\n";
+ $revision = '1.1';
+}
+# Copy the file, translate date and some other stuff, and insert the
+# revision number
$insertedrevision = 0;
while (<SRC>)
{
if (/PAGENAME="([A-Za-z]*) ([0-9]*)[a-z]*, ([0-9]*)"/)
{
+ # Translate date
$date = "$2 $1 $3";
$date =~ s/January/januari/;
$date =~ s/February/februari/;
@@ -66,6 +91,7 @@ while (<SRC>)
if ($_ eq "<b>Welcome</b> to Debian Weekly News, a newsletter for the Debian developer\n")
{
+ # Translate intro
$next = <SRC>;
if ($next eq "community.\n")
{
@@ -88,4 +114,5 @@ while (<SRC>)
close SRC;
close DST;
+# We're done
print "Copying done, remember to edit $dstfile\n";
diff --git a/swedish/security/copyadvisory.pl b/swedish/security/copyadvisory.pl
index 2e091ddbb0e..84fb89773fe 100755
--- a/swedish/security/copyadvisory.pl
+++ b/swedish/security/copyadvisory.pl
@@ -1,7 +1,19 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
-$date = @ARGV[0];
+# This script copies a security advisory named on the command line, and adds
+# the <!--translation x.x--> string to it. It also will create the
+# destination directory if necessary, and copy the Makefile from the source.
+# Written in 2000 by peter karlsson <peter@softwolves.pp.se>
+# © Copyright 2000 Software in the public interest, Inc.
+# This program is released under the GNU General Public License, v2.
+
+# $Id$
+
+# Get command line
+$date = $ARGV[0];
+
+# Check usage.
unless ($date)
{
print "Usage: $0 advisorydate\n\n";
@@ -10,6 +22,7 @@ unless ($date)
exit;
}
+# Create needed file and directory names
$year = substr($date, 0, 4);
$srcdir = "../../english/security/$year";
$srcfile= "$srcdir/$date.wml";
@@ -17,10 +30,13 @@ $cvsfile= "$srcdir/CVS/Entries";
$dstdir = "./$year";
$dstfile= "$dstdir/$date.wml";
-die "Directory $srdir does not exist\n" unless -d $srcdir;
-die "File $srcfile does not exist\n" unless -e $srcfile;
-mkdir $dstdir, 0755 unless -d $dstdir;
+# Sanity checks
+die "Directory $srcdir does not exist\n" unless -d $srcdir;
+die "File $srcfile does not exist\n" unless -e $srcfile;
+die "File $dstfile already exists\n" if -e $dstfile;
+mkdir $dstdir, 0755 unless -d $dstdir;
+# Open the files
open CVS, $cvsfile
or die "Could not read $cvsfile ($!)\n";
@@ -30,6 +46,7 @@ open SRC, $srcfile
open DST, ">$dstfile"
or die "Could not create $dstfile ($!)\n";
+# Retrieve the CVS version number
while (<CVS>)
{
if (m[^/$date\.wml/([0-9]*\.[0-9])*/]o)
@@ -40,8 +57,13 @@ while (<CVS>)
close CVS;
-print "Could not get revision number\n" unless $revision;
+unless ($revision)
+{
+ print "Could not get revision number - bug in script?\n";
+ $revision = '1.1';
+}
+# Copy the file and insert the revision number
$insertedrevision = 0;
while (<SRC>)
@@ -57,4 +79,5 @@ while (<SRC>)
close SRC;
close DST;
+# We're done
print "Copying done, remember to edit $dstfile\n";

© 2014-2024 Faster IT GmbH | imprint | privacy policy