Changeset 446 for locker/update-system/bin
- Timestamp:
- Oct 6, 2007, 2:34:43 AM (17 years ago)
- Location:
- locker/update-system/bin
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
locker/update-system/bin/propose-update
r411 r446 34 34 35 35 unpackPackage($old, $olddir); 36 unpackPackage($ old, $newdir);36 unpackPackage($new, $newdir); 37 37 38 38 sub unpackPackage($$) { 39 39 my ($package, $dir) = @_; 40 print "Extracting $package to $dir...";40 print STDERR "Extracting $package to $dir... "; 41 41 if (-d $dir) { 42 42 warn "$dir already exists; assuming unpacking was successful"; … … 113 113 my (@todelete, @toadd, @changed); 114 114 my @comp = compareDirectories(\@oldfiles, \@newfiles); 115 print Dumper(@comp); 115 open(DIFF, ">", catfile($outdir, "diff.pl")); 116 print DIFF Dumper(@comp); 117 close(DIFF); 116 118 @todelete = @{$comp[0]}; 117 119 @toadd = @{$comp[1]}; … … 124 126 } 125 127 close(TODELETE); 126 } 128 printf "Wrote %d filenames to files.delete\n", scalar(@todelete); 129 } else { printf "Not overwriting existing files.delete\n"; } 127 130 128 131 if ($redoadd or ! -e catfile($outdir, "files.add")) { 129 132 open(TOADD, ">", catfile($outdir, "files.add")) or die "Can't open files.add: $!"; 130 133 foreach my $file (@toadd) { 131 printf TOADD "%s # MD5 = %s\n", $file->[1], $file->[0];134 printf TOADD "%s %s\n", $file->[0], $file->[1]; 132 135 } 133 136 close(TOADD); 134 } 137 printf "Wrote %d filenames to files.add\n", scalar(@toadd); 138 } else { printf "Not overwriting existing files.add\n"; } 135 139 136 140 my @toreplace; … … 148 152 open(TOREPLACE, ">", catfile($outdir, "files.replace")) or die "Can't open files.replace: $!"; 149 153 foreach my $file (@toreplace) { 150 printf TOREPLACE "%s %s\n", $file->[ 2][0], $file->[0];154 printf TOREPLACE "%s %s\n", $file->[1][0], $file->[0]; 151 155 } 152 156 close(TOREPLACE); 153 } 157 printf "Wrote %d filenames to files.replace\n", scalar(@toreplace); 158 } else { printf "Not overwriting existing files.replace\n"; } 159 160 if ($redodiff or ! -e catfile($outdir, "update.diff")) { 161 open(DIFF, ">", catfile($outdir, "update.diff")) or die "Can't open update.diff: $!"; 162 foreach my $file (@topatch) { 163 my $filename = $file->[0]; 164 my $oldfile = catfile($olddir, $file->[1][1]); 165 my $newfile = catfile($newdir, $file->[2][1]); 166 my $cmd = "diff -urN $oldfile $newfile"; 167 print DIFF "$cmd\n"; 168 print DIFF `$cmd`; 169 } 170 close(DIFF); 171 printf "Wrote %d diffs to update.diff\n", scalar(@topatch); 172 } else { printf "Not overwriting existing update.patch\n"; }
Note: See TracChangeset
for help on using the changeset viewer.