Commits

camlspotter committed 89c2e84

added recover_mode.pl

  • Participants
  • Parent commits ba0a5f4
  • Branches custom-3.12.0

Comments (0)

Files changed (1)

File 0scripts/recover_mode.pl

+#!/usr/bin/perl
+
+# ocaml svn site tar ball has no file perm info. This script tries to fix it from hg diff -g output
+
+$rev = $ARGV[0];
+print STDERR "rev=$rev\n";
+open(IN, "hg diff -g -r $rev |");
+while(<IN>){
+    if( /^diff --git a\/([^ ]+)/ ){
+	$target = $1;
+    }
+    if( /^old mode ([0-9]+)/ ){
+	$mod = $1;
+	print "$target : $mod\n";
+	$mod =~ s/^100//;
+	`chmod $mod $target`;
+    }
+}
+