Update of /cvsroot/fink/fink
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv3238

Modified Files:
        ChangeLog fink-virtual-pkgs.in 
Log Message:
Don't blindly write to a predictably-named file in /tmp


Index: fink-virtual-pkgs.in
===================================================================
RCS file: /cvsroot/fink/fink/fink-virtual-pkgs.in,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- fink-virtual-pkgs.in        3 Jan 2006 20:14:46 -0000       1.21
+++ fink-virtual-pkgs.in        28 Dec 2006 11:04:29 -0000      1.22
@@ -22,6 +22,8 @@
 require 5.008_001;  # perl 5.8.1 or newer required
 use strict;
 use Getopt::Long;
+use Fcntl;
+
 my $standalone = 0;
 my $basepath = '@BASEPATH@';
 
@@ -35,18 +37,17 @@
                "apt" => 0,
                "debug" => 0,
                "dpkg" => 0,
-               "version" => 0,
    );
 GetOptions(
-       'apt|a' => sub {  $options{apt} = 1},
-       'debug' => sub { $options{debug} = 1},
-       'dpkg|d' => sub { $options{dpkg} = 1},
+       'apt|a' => \$options{apt},
+       'debug' => \$options{debug},
+       'dpkg|d' => \$options{dpkg},
        'help|h' => \&usage,
        'version|v' => \&version,
        ) or die "Unknown option\n";
 if ($options{dpkg} and $options{apt}) { die "Can only specify one option dpkg 
or apt\n" }
 if ($options{apt}) {
-       open(FH,">/tmp/finkaptstatus") || die "Can not open file 
/tmp/finkaptstatus for writing\n";
+       sysopen(FH,'/tmp/finkaptstatus', O_WRONLY | O_EXCL | O_CREAT) || die 
"Can not open file /tmp/finkaptstatus for writing: $!\n";
        select FH;
     }
 if ($standalone == 0)

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/ChangeLog,v
retrieving revision 1.451
retrieving revision 1.452
diff -u -d -r1.451 -r1.452
--- ChangeLog   9 Dec 2006 23:30:34 -0000       1.451
+++ ChangeLog   28 Dec 2006 11:04:29 -0000      1.452
@@ -1,3 +1,8 @@
+2006-12-28  Daniel Macks  <[EMAIL PROTECTED]>
+
+       * fink-virtual-pkgs.in: Do not overwrite apt's data transfer
+       file. Use more canonical Getopt syntax.
+
 2006-12-09  Dave Morrison  <[EMAIL PROTECTED]>
 
        * REVISION: add a line for 10.5 to allow bootstrapping


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to