[SCM] Debian Qt/KDE packaging tools branch, master, updated. debian/0.6.1

Modestas Vainius modax at alioth.debian.org
Sun Feb 7 08:22:32 UTC 2010


The following commit has been merged in the master branch:
commit 878a7e1ae31b895d18b4cda417d2b96d1423fcde
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Sat Feb 6 16:03:04 2010 +0200

    Alter behaviour of -o option.
    
    - if it is not specified, output is dumped to the same file as input was
    read from;
    - if it is specified without argument, dump to stdout;
    - if it is specified with argument, dump to the file in argument.
---
 debian/changelog                   |    5 +++++
 symbolshelper/pkgkde-symbolshelper |   16 ++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index feba911..2711e52 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,11 @@ pkg-kde-tools (0.6.1) UNRELEASED; urgency=low
   * Now `pkgkde-symbolshelper create` bases its template on the arch specific
     symbol file (as specified with -a option). This alters arch tag generation
     a bit (negative arches are used more frequently than before).
+  * Alter behaviour of -o option:
+    - if it is not specified, output is dumped to the same file as input was
+      read from;
+    - if it is specified without argument, dump to stdout;
+    - if it is specified with argument, dump to the file in argument.
 
  -- Modestas Vainius <modax at debian.org>  Sat, 06 Feb 2010 15:05:44 +0200
 
diff --git a/symbolshelper/pkgkde-symbolshelper b/symbolshelper/pkgkde-symbolshelper
index 3201d96..f47fd28 100755
--- a/symbolshelper/pkgkde-symbolshelper
+++ b/symbolshelper/pkgkde-symbolshelper
@@ -68,7 +68,7 @@ sub get_common_options {
     my (%args, %res);
 
     map { $args{$_} = 1 } split(//, $args);
-    $res{"output|o=s"} = \$opt_out if ($args{o});
+    $res{"output|o:s"} = \$opt_out if ($args{o});
     $res{"input|i=s"} = \&verify_opt_in if ($args{i});
     $res{"package|p=s"} = \$opt_package if ($args{p});
     $res{"architecture|a=s"} = \&verify_opt_arch if ($args{a});
@@ -126,10 +126,22 @@ sub out_symfile {
     my ($symfile, %opts) = @_;
     return 1 unless $symfile;
 
+    my $out_fh;
+    if (defined $opt_out) {
+	# If -o is specified, dump to STDOUT if it does not have an argument or
+	# save to specified file otherwise.
+	$out_fh = *STDOUT unless $opt_out;
+    } else {
+	# If -o is not specified, save to the input file.
+	$opt_out = $opt_in;
+    }
+
     if ($opt_out) {
 	$symfile->save($opt_out, template_mode => 1, with_deprecated => 1, %opts);
+    } elsif ($out_fh) {
+	$symfile->dump($out_fh, template_mode => 1, with_deprecated => 1, %opts);
     } else {
-	$symfile->dump(*STDOUT, template_mode => 1, with_deprecated => 1, %opts);
+	error("output file could not be determined");
     }
     return 0;
 }

-- 
Debian Qt/KDE packaging tools



More information about the pkg-kde-commits mailing list