summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-01 10:46:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-01 10:46:59 +0000
commit68fbc16b85fc22ad7c95922325748a2bc48fbdac (patch)
treee8ee8fec859bcd9646d07f5b1c7be4de531f9582
parentc5fca0bc726f26aa3a5f1e930f0d00131856c74e (diff)
downloadurpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.tar
urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.tar.gz
urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.tar.bz2
urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.tar.xz
urpmi-68fbc16b85fc22ad7c95922325748a2bc48fbdac.zip
add append_to_file()
-rw-r--r--urpm/util.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/urpm/util.pm b/urpm/util.pm
index 0af9cc53..0a7bbd00 100644
--- a/urpm/util.pm
+++ b/urpm/util.pm
@@ -14,7 +14,7 @@ our @EXPORT = qw(min max quotespace unquotespace
partition put_in_hash uniq uniq_
begins_with
difference2 intersection member
- file_size cat_ cat_utf8 output_safe dirname basename
+ file_size cat_ cat_utf8 output_safe append_to_file dirname basename
);
(our $VERSION) = q($Revision$) =~ /(\d+)/;
@@ -161,6 +161,13 @@ sub output_safe {
1;
}
+sub append_to_file {
+ my $f = shift;
+ open(my $F, '>>', $f) or die "writing to file $f failed: $!\n";
+ print $F $_ foreach @_;
+ 1;
+}
+
1;
__END__