]> git.donarmstrong.com Git - wannabuild.git/commitdiff
Copy, not move, when commiting a transaction
authorJoachim Breitner <mail@joachim-breitner.de>
Fri, 24 Jul 2009 14:39:48 +0000 (16:39 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Fri, 24 Jul 2009 14:39:48 +0000 (16:39 +0200)
A move would destroy the file owner permissions, which must not
happen with wanna-build.

bin/wanna-build

index 8a9352f4b052ac690b12987f41618ab5150df243..0762a235882b3fac8dcd818e06437198ba68cf35 100755 (executable)
@@ -336,8 +336,10 @@ if ($op_mode eq "start-transaction") {
 }
 
 if ($op_mode eq "commit-transaction") {
-       move ( db_filename_transaction( $distribution ), db_filename_master( $distribution ))
-               or die "Move failed: $!";
+       # we need to copy here to preserve the owner and group of the file
+       copy ( db_filename_transaction( $distribution ), db_filename_master( $distribution ))
+               or die "Copy failed: $!";
+       unlink db_filename_transaction( $distribution );
        open TLOG, "<", db_transactlog_transaction( $distribution )
                or die "Could not open logfile from transaction: $!";
        open LOG, ">>", db_transactlog_master( $distribution )