From b11cac64e7a0d0ecf0295a66bf54753fc7353376 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 18 Jun 2009 15:10:31 +0300 Subject: Patching capabilities now patches also the pkg file UID. --- bin/patch_capabilities.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl index f18aaba..4c4e67a 100644 --- a/bin/patch_capabilities.pl +++ b/bin/patch_capabilities.pl @@ -31,13 +31,22 @@ if (@ARGV) # Start with no binaries listed. my @binaries = (); - # Open the ".pkg" file. + my $tempPkgFileName = $pkgFileName."_@@TEMP@@"; + unlink($tempPkgFileName); + open (NEW_PKG, ">>".$tempPkgFileName); open (PKG, "<".$pkgFileName); # Parse each line. while () { my $line = $_; + my $newLine = $line; + if ( $line =~ m/^\#.*\(0x[0-9|a-f|A-F]*\).*$/) + { + $newLine =~ s/\(0x./\(0xE/; + } + print NEW_PKG $newLine; + chomp ($line); # If the line specifies a file, parse the source and destination locations. @@ -54,8 +63,11 @@ if (@ARGV) } } - # Close the ".pkg" file. close (PKG); + close (NEW_PKG); + + unlink($pkgFileName); + rename($tempPkgFileName, $pkgFileName); print ("\n"); -- cgit v0.12