pkgApp.pl   pkgApp.pl 
skipping to change at line 45 skipping to change at line 45
$name =~ s,^\s*,,; $name =~ s,^\s*,,;
$name =~ s,\s*\(compa.+$,,; $name =~ s,\s*\(compa.+$,,;
## we've already dealt with this name on this executable, ie, itself ## we've already dealt with this name on this executable, ie, itself
if ( index($name, $main_executable) >= 0 || if ( index($name, $main_executable) >= 0 ||
index($main_executable, $name) >= 0 ) { index($main_executable, $name) >= 0 ) {
next NAME_LOOP; next NAME_LOOP;
} }
## leave sys libraries alone and dont include them ## leave sys libraries alone and dont include them
if ( $name =~ m,^(/System/Library|/usr/lib|\@executable_name), ) { if ( $name =~ m,^(/System/Library|/usr/lib|\@executable_name), &&
$name !~ m,^(/usr/lib/libiconv), ){
next NAME_LOOP; next NAME_LOOP;
} }
## a rooted Framework ## a rooted Framework
## an unrooted Framework ## an unrooted Framework
if ( $name =~ m,^([^/]+\.framework)/(\S+)$, ) { if ( $name =~ m,^([^/]+\.framework)/(\S+)$, ) {
my $fwname = $1; my $fwname = $1;
my $binary = $2; my $binary = $2;
my $absname = &locateFramework($fwname); my $absname = &locateFramework($fwname);
my $arch = &architecture("$absname/$binary"); my $arch = &architecture("$absname/$binary");
if ( $arch eq $current_arch || $arch eq 'fat' ) { if ( $arch eq $current_arch || $arch eq 'fat' ) {
my $relPath = "\@executable_path/../Frameworks/$fwname/$bina ry"; my $relPath = "\@executable_path/../Frameworks/$fwname/$bina ry";
my $fwPath = "$frameworks_dir/$fwname/$binary"; my $fwPath = "$frameworks_dir/$fwname/$binary";
my $not_existed = 1; my $not_existed = 1;
if ( ! -e $fwPath ) { if ( ! -e $fwPath ) {
my $c = "cp -R -p $absname $frameworks_dir/$fwname"; my $c = "cp -RP -p $absname $frameworks_dir/$fwname";
`$c`; `$c`;
} else { } else {
$not_existed = 0; $not_existed = 0;
} }
my $c = sprintf($id_inmt, $relPath, $fwPath); my $c = sprintf($id_inmt, $relPath, $fwPath);
`$c`; `$c`;
$c = sprintf($ch_inmt, $name, $relPath, $main_executable); $c = sprintf($ch_inmt, $name, $relPath, $main_executable);
`$c`; `$c`;
skipping to change at line 91 skipping to change at line 92
} }
next NAME_LOOP; next NAME_LOOP;
} }
## a rooted dylib ## a rooted dylib
if ( $name =~ m,^/.+?([^/]+\.dylib)$, ) { if ( $name =~ m,^/.+?([^/]+\.dylib)$, ) {
my $basename = $1; my $basename = $1;
my $absname = $name; my $absname = $name;
my $arch = &architecture($absname); my $arch = &architecture($absname);
if ( $arch eq $current_arch || $arch eq 'fat' ) { if ( $arch eq $current_arch || $arch eq 'fat' ) {
my $relPath = "\@executable_path/../Frameworks/$current_arch /$basename"; my $relPath = "\@executable_path/../Frameworks/$current_arch /$basename";
my $fwPath = "$frameworks_dir/$current_arch/$basename"; my $fwPath = "$frameworks_dir/$current_arch/$basename";
my $not_existed = 1; my $not_existed = 1;
if ( ! -e $fwPath ) { if ( ! -e $fwPath ) {
my $c = "cp $absname $frameworks_dir/$current_arch"; my $c = "cp -P $absname $frameworks_dir/$current_arch";
`$c`; `$c`;
} else { } else {
$not_existed = 0; $not_existed = 0;
} }
my $c = sprintf($id_inmt, $relPath, $fwPath); my $c = sprintf($id_inmt, $relPath, $fwPath);
`$c`; `$c`;
$c = sprintf($ch_inmt, $absname, $relPath, $main_executable) ; $c = sprintf($ch_inmt, $absname, $relPath, $main_executable) ;
`$c`; `$c`;
skipping to change at line 130 skipping to change at line 132
if ( $name =~ m/\@executable/ ) { if ( $name =~ m/\@executable/ ) {
# we've been here already # we've been here already
next NAME_LOOP; next NAME_LOOP;
} }
my $basename = $name; my $basename = $name;
my $absname = "MacOS/" . $name; my $absname = "MacOS/" . $name;
my $arch = &architecture($absname); my $arch = &architecture($absname);
if ( $arch eq $current_arch || $arch eq 'fat') { if ( $arch eq $current_arch || $arch eq 'fat') {
my $relPath = "\@executable_path/$basename"; my $relPath = "\@executable_path/$basename";
my $c = sprintf($id_inmt, $relPath, $absname); my $c = sprintf($id_inmt, $relPath, $absname);
`$c`; `$c`;
$c = sprintf($ch_inmt, $name, $relPath, $main_executable); $c = sprintf($ch_inmt, $name, $relPath, $main_executable);
`$c`; `$c`;
&recurse($absname, $frameworks_dir, $current_arch); &recurse($absname, $frameworks_dir, $current_arch);
} else { } else {
skipping to change at line 154 skipping to change at line 157
## something else? ## something else?
warn qq{$0: [3] for $main_executable: what to do with $name?!?!?\n}; warn qq{$0: [3] for $main_executable: what to do with $name?!?!?\n};
} }
} }
sub architecture { sub architecture {
my $file = shift; my $file = shift;
my(@output) = `/usr/bin/file $file`; my(@output) = `/usr/bin/file $file`;
if ( grep(m/^${file}: symbolic link to \`([^\']+)\'/, @output) ) { if ( grep(m/^${file}: symbolic link to ([^\']+)/, @output) ) {
my($r, @junk) = grep(m/^${file}: symbolic link to \`([^\']+)\'/, @ou my($r, @junk) = grep(m/^${file}: symbolic link to ([^\']+)/, @output
tput); );
$r =~ m,^(.+)/([^/]+.dylib): symbolic link to \`([^\']+)\',; $r =~ m,^(.+)/([^/]+.dylib): symbolic link to ([^\']+),;
my $root = $1; my $root = $1;
my $base = $2; my $base = $2;
my $target = $3; my $target = $3;
if ( $target =~ m,^/, ) { if ( $target =~ m,^/, ) {
return &architecture("$target"); return &architecture("$target");
} else { } else {
return &architecture("$root/$target"); return &architecture("$root/$target");
} }
} }
my $retval = undef; my $retval = undef;
# file with 2 architectures # file with 2 architectures
if ( grep(m/(universal binary|fat file) with 2 architectures/i, @output
)) { if ( grep(m/(universal binary|fat file) with [0-9] architectures/i, @ou
tput)) {
$retval = 'fat'; $retval = 'fat';
} }
elsif ( grep(m/ppc/, @output) ) { elsif ( grep(m/ppc/, @output) ) {
$retval = 'ppc'; $retval = 'ppc';
} }
elsif ( grep(m/i386/, @output) ) { elsif ( grep(m/i386/, @output) ) {
$retval = 'i386'; $retval = 'i386';
} }
# warn qq{$0: $file isa '$retval' arch\n}; # warn qq{$0: $file isa '$retval' arch\n};
return $retval; return $retval;
} }
sub locateFramework { sub locateFramework {
my $fname = shift; my $fname = shift;
my $lib; my $lib;
foreach $lib ( '~/Library/Frameworks', '/Library/Frameworks' ) { foreach $lib ( '~/Library/Frameworks', '/Library/Frameworks', '/usr/loc al/Trolltech/Qt-4.5.0/lib' ) {
if ( -e "$lib/$fname" ) { if ( -e "$lib/$fname" ) {
return "$lib/$fname"; return "$lib/$fname";
} }
} }
warn qq{$0: couldnt find $fname!!!!\n}; warn qq{$0: couldnt find $fname!!!!\n};
return undef; return undef;
} }
 End of changes. 8 change blocks. 
10 lines changed or deleted 14 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/