Index: locker/update-system/bin/propose-update
===================================================================
--- locker/update-system/bin/propose-update	(revision 411)
+++ locker/update-system/bin/propose-update	(revision 446)
@@ -34,9 +34,9 @@
 
 unpackPackage($old, $olddir);
-unpackPackage($old, $newdir);
+unpackPackage($new, $newdir);
 
 sub unpackPackage($$) {
   my ($package, $dir) = @_;
-  print "Extracting $package to $dir...";
+  print STDERR "Extracting $package to $dir... ";
   if (-d $dir) {
     warn "$dir already exists; assuming unpacking was successful";
@@ -113,5 +113,7 @@
 my (@todelete, @toadd, @changed);
 my @comp = compareDirectories(\@oldfiles, \@newfiles);
-print Dumper(@comp);
+open(DIFF, ">", catfile($outdir, "diff.pl"));
+print DIFF Dumper(@comp);
+close(DIFF);
 @todelete = @{$comp[0]};
 @toadd = @{$comp[1]};
@@ -124,13 +126,15 @@
 	}
 	close(TODELETE);
-}
+	printf "Wrote %d filenames to files.delete\n", scalar(@todelete);
+} else { printf "Not overwriting existing files.delete\n"; }
 
 if ($redoadd or ! -e catfile($outdir, "files.add")) {
 	open(TOADD, ">", catfile($outdir, "files.add")) or die "Can't open files.add: $!";
 	foreach my $file (@toadd) {
-	  printf TOADD "%s # MD5 = %s\n", $file->[1], $file->[0];
+	  printf TOADD "%s %s\n", $file->[0], $file->[1];
 	}
 	close(TOADD);
-}
+	printf "Wrote %d filenames to files.add\n", scalar(@toadd);
+} else { printf "Not overwriting existing files.add\n"; }
 
 my @toreplace;
@@ -148,6 +152,21 @@
 	open(TOREPLACE, ">", catfile($outdir, "files.replace")) or die "Can't open files.replace: $!";
 	foreach my $file (@toreplace) {
-		printf TOREPLACE "%s %s\n", $file->[2][0], $file->[0];
+		printf TOREPLACE "%s %s\n", $file->[1][0], $file->[0];
 	}
 	close(TOREPLACE);
-}
+	printf "Wrote %d filenames to files.replace\n", scalar(@toreplace);
+} else { printf "Not overwriting existing files.replace\n"; }
+
+if ($redodiff or ! -e catfile($outdir, "update.diff")) {
+    open(DIFF, ">", catfile($outdir, "update.diff")) or die "Can't open update.diff: $!";
+    foreach my $file (@topatch) {
+	my $filename = $file->[0];
+	my $oldfile = catfile($olddir, $file->[1][1]);
+	my $newfile = catfile($newdir, $file->[2][1]);
+	my $cmd = "diff -urN $oldfile $newfile";
+	print DIFF "$cmd\n";
+	print DIFF `$cmd`;
+    }
+    close(DIFF);
+    printf "Wrote %d diffs to update.diff\n", scalar(@topatch);
+} else { printf "Not overwriting existing update.patch\n"; }
