Changeset 15460
- Timestamp:
- 10/29/20 16:55:04 (3 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/JarPathname.java
r15457 r15460 346 346 if (!(jars instanceof Cons)) { 347 347 type_error("JAR-PATHNAME device is not a cons", 348 jars, 349 Symbol.CONS); 348 jars, Symbol.CONS); 350 349 return (LispObject)UNREACHED; 351 350 } … … 374 373 p.copyFrom(pathname); 375 374 376 // Run atruename resolution on the path of local jar archives375 // Run truename resolution on the path of local jar archives 377 376 if (p.isLocalFile()) { 378 377 Pathname rootJar; … … 396 395 return Pathname.doTruenameExit(rootJar, errorIfDoesNotExist); 397 396 } 398 LispObject otherJars 399 = p.getJars().cdr(); 397 LispObject otherJars = p.getJars().cdr(); 400 398 URLPathname newRootJar; 401 399 if (rootJarTruename instanceof Pathname) { … … 425 423 public boolean isLocalFile() { 426 424 Pathname p = (Pathname) getRootJar(); 427 if (p .isLocalFile()) {428 return true;425 if (p != null) { 426 return p.isLocalFile(); 429 427 } 430 428 return false; -
trunk/abcl/src/org/armedbear/lisp/ZipCache.java
r15452 r15460 422 422 if (innerJars.equals(NIL)) { 423 423 return getArchiveFile(jar); 424 } else { 425 result = getArchiveStreamFromFile(jar); 426 cache.put(result.root, result); 427 428 JarPathname nextArchive = new JarPathname(); 429 nextArchive 430 .setDevice(new Cons(rootJar, 431 new Cons(innerJars.car(), NIL))) 432 .setDirectory(NIL) 433 .setName(NIL) 434 .setType(NIL); 424 } 425 426 result = getArchiveStreamFromFile(jar); 427 cache.put(result.root, result); 428 429 JarPathname nextArchive = new JarPathname(); 430 nextArchive 431 .setDevice(new Cons(rootJar, 432 new Cons(innerJars.car(), NIL))) 433 .setDirectory(NIL) 434 .setName(NIL) 435 .setType(NIL); 435 436 437 innerJars = innerJars.cdr(); 438 while (innerJars.car() != NIL) { 439 Pathname nextJarArchive = (Pathname)innerJars.car(); 440 441 JarPathname nextAsEntry = new JarPathname(); 442 nextAsEntry 443 .setDevice(nextArchive.getDevice()) 444 .setDirectory(nextJarArchive.getDirectory()) 445 .setName(nextJarArchive.getName()) 446 .setType(nextJarArchive.getType()); 447 // FIXME 448 // The pathnames for subsquent entries in a PATHNAME-JAR 449 // are relative. Should they be? 450 LispObject directories = nextAsEntry.getDirectory(); 451 if ( !directories.equals(NIL) 452 && directories.car().equals(Keyword.RELATIVE)) { 453 directories = directories.cdr().push(Keyword.ABSOLUTE); 454 nextAsEntry.setDirectory(directories); 455 } 456 457 nextArchive.setDevice(nextArchive.getDevice().reverse().push(nextJarArchive).reverse()); 458 ArchiveStream stream = (ArchiveStream) result; 459 460 ZipEntry entry = stream.getEntry(nextAsEntry); 461 if (entry == null) { 462 return null; 463 } 464 465 InputStream inputStream = stream.getEntryAsInputStream(nextAsEntry); 466 if (inputStream == null) { 467 return null; 468 } 469 stream = new ArchiveStream(inputStream, nextArchive, entry); 470 result = stream; 471 cache.put(nextArchive, result); 472 436 473 innerJars = innerJars.cdr(); 437 while (innerJars.car() != NIL) { 438 Pathname nextJarArchive = (Pathname)innerJars.car(); 439 440 JarPathname nextAsEntry = new JarPathname(); 441 nextAsEntry 442 .setDevice(nextArchive.getDevice()) 443 .setDirectory(nextJarArchive.getDirectory()) 444 .setName(nextJarArchive.getName()) 445 .setType(nextJarArchive.getType()); 446 // FIXME 447 // The pathnames for subsquent entries in a PATHNAME-JAR are relative. Should they be? 448 if (nextAsEntry.getDirectory().car().equals(Keyword.RELATIVE)) { 449 LispObject directories = nextAsEntry.getDirectory(); 450 directories = directories.cdr(); 451 directories = directories.push(Keyword.ABSOLUTE); 452 nextAsEntry.setDirectory(directories); 453 } 454 nextArchive.setDevice(nextArchive.getDevice().reverse().push(nextJarArchive).reverse()); 455 ArchiveStream stream = (ArchiveStream) result; 456 457 ZipEntry entry = stream.getEntry(nextAsEntry); 458 if (entry == null) { 459 return null; 460 } 461 462 InputStream inputStream = stream.getEntryAsInputStream(nextAsEntry); 463 if (inputStream == null) { 464 return null; 465 } 466 stream = new ArchiveStream(inputStream, nextArchive, entry); 467 result = stream; 468 cache.put(nextArchive, result); 469 470 innerJars = innerJars.cdr(); 471 if (innerJars.cdr().equals(NIL) 472 && (!jar.getDirectory().equals(NIL) 473 || !jar.getName().equals(NIL) 474 || !jar.getType().equals(NIL))) { 475 simple_error("Currently unimplemented retrieval of an entry in a nested pathnames"); 476 return (Archive)UNREACHED; 477 } 478 } 479 480 return result; 481 } 474 if (innerJars.cdr().equals(NIL) 475 && (!jar.getDirectory().equals(NIL) 476 && jar.getName().equals(NIL) 477 && jar.getType().equals(NIL))) { 478 simple_error("Currently unimplemented retrieval of an entry in a nested pathnames"); 479 return (Archive)UNREACHED; 480 } 481 } 482 return result; 482 483 } 483 484
Note: See TracChangeset
for help on using the changeset viewer.