jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1771680 - /jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java
Date Mon, 28 Nov 2016 04:40:50 GMT
Author: tripod
Date: Mon Nov 28 04:40:49 2016
New Revision: 1771680

URL: http://svn.apache.org/viewvc?rev=1771680&view=rev
Log:
JCRVLT-140 Add support for extract subpackages without installing content

- improving logging

Modified:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java?rev=1771680&r1=1771679&r2=1771680&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageImpl.java
Mon Nov 28 04:40:49 2016
@@ -515,8 +515,8 @@ public class JcrPackageImpl implements J
 
     private void extractSubpackages(@Nonnull ImportOptions opts, @Nonnull Set<PackageId>
processed)
             throws RepositoryException, PackageException, IOException {
-        VaultPackage pack = getPackage();
-
+        final VaultPackage pack = getPackage();
+        final PackageId pId = pack.getId();
         Archive a = pack.getArchive();
         Archive.Entry packages = a.getEntry("/jcr_root/etc/packages");
         if (packages == null) {
@@ -524,7 +524,10 @@ public class JcrPackageImpl implements J
         }
         List<Archive.Entry> entries = new LinkedList<Archive.Entry>();
         findSubPackageEntries(entries, packages);
-
+        if (entries.isEmpty()) {
+            log.info("Package {} contains no sub-packages.", pId);
+            return;
+        }
         for (Archive.Entry e: entries) {
             VaultInputSource in = a.getInputSource(e);
             InputStream ins = null;
@@ -534,14 +537,14 @@ public class JcrPackageImpl implements J
 
                 // add dependency to this package
                 Dependency[] oldDeps = subPackage.getDefinition().getDependencies();
-                Dependency[] newDeps = DependencyUtil.addExact(oldDeps, pack.getId());
+                Dependency[] newDeps = DependencyUtil.addExact(oldDeps, pId);
                 if (oldDeps != newDeps) {
                     subPackage.getDefinition().setDependencies(newDeps, true);
                 }
 
                 PackageId id = subPackage.getDefinition().getId();
                 processed.add(id);
-                log.info("Extracted sub-package: {}", id);
+                log.info("Package {}: Extracted sub-package: {}", pId, id);
 
                 if (!opts.isNonRecursive()) {
                     subPackage.extractSubpackages(opts, processed);



Mime
View raw message