Work when bundle not installed

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13592 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-05-04 19:01:24 +00:00
parent f7f46998d8
commit d6a5023609
3 changed files with 20 additions and 9 deletions

View file

@ -1,3 +1,7 @@
2002-05-04 Adam Fedor <fedor@gnu.org>
* Testing/nsbundle.m: Update to work without installing bundle.
2002-05-04 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSUser.m: NSHomeDirectoryForUser() ... fix windoze bug ...

View file

@ -22,7 +22,6 @@
int
main(int argc, char *argv[], char **env)
{
NSBundle *main;
NSBundle *bundle;
NSString *path;
id object;
@ -35,18 +34,26 @@ main(int argc, char *argv[], char **env)
printf(" GNUstep bundle directory is %s\n", [[[NSBundle gnustepBundle] bundlePath] cString]);
main = [NSBundle mainBundle];
printf("Looking for main bundle...\n");
if (!main) {
fprintf(stderr, "* ERROR: Can't get main bundle\n");
path = [[[NSProcessInfo processInfo] arguments] objectAtIndex: 0];
printf(" Executable is in %s\n", [path cString]);
path = [NSBundle _absolutePathOfExecutable: path];
if (!path) {
fprintf(stderr, "* ERROR: Can't find executable\n");
exit(1);
}
printf(" Main bundle directory is %s\n", [[main bundlePath] cString]);
printf(" Full directory is %s\n", [path cString]);
printf("Looking for LoadMe bundle...\n");
path = [main pathForResource:@"LoadMe" ofType:@"bundle"];
path = [path stringByDeletingLastPathComponent];
path = [path stringByDeletingLastPathComponent];
path = [path stringByDeletingLastPathComponent];
path = [path stringByDeletingLastPathComponent];
path = [path stringByDeletingLastPathComponent];
printf(" Bundle directory is %s\n", [path cString]);
path = [NSBundle pathForResource:@"LoadMe" ofType:@"bundle"
inDirectory: path];
if (!path) {
fprintf(stderr, "* ERROR: Can't find LoadMe bundle in main bundle\n");
fprintf(stderr, "* ERROR: Can't find LoadMe bundle\n");
exit(1);
}
printf(" Found LoadMe in: %s\n\n", [path cString]);

View file

@ -6,7 +6,7 @@ Summary: GNUstep Base library package
Packager: Adam Fedor <fedor@gnu.org>
Vendor: The GNUstep Project
URL: http://www.gnustep.org/
Requires: gnustep-make >= 0.9.0
Requires: gnustep-make >= 1.3.0
%description
The GNUstep Base Library is a powerful fast library of general-purpose,