archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1049407 - in /archiva/trunk/archiva-modules/archiva-base: ./ archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers...
Date Wed, 15 Dec 2010 03:39:47 GMT
Author: brett
Date: Wed Dec 15 03:39:46 2010
New Revision: 1049407

URL: http://svn.apache.org/viewvc?rev=1049407&view=rev
Log:
 [MRM-1421] Archiva repository purge incorrectly purges based on file timestamps even when
the snapshot timestamp is known
 Merged from: r1049391:1049399

Modified:
    archiva/trunk/archiva-modules/archiva-base/   (props changed)
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java
  (props changed)
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java

Propchange: archiva/trunk/archiva-modules/archiva-base/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Dec 15 03:39:46 2010
@@ -1,6 +1,6 @@
 /archiva/branches/MRM-1025/archiva-modules/archiva-base:721945-723577
 /archiva/branches/MRM-541/archiva-modules/archiva-base:686983-687034
-/archiva/branches/archiva-1.3.x/archiva-modules/archiva-base:953645,1049375,1049384,1049389-1049391
+/archiva/branches/archiva-1.3.x/archiva-modules/archiva-base:953645,1049375,1049384,1049389-1049399
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-base:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-base:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-base:898632

Propchange: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Dec 15 03:39:46 2010
@@ -1,6 +1,6 @@
 /archiva/branches/MRM-1025/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:721945-723577
 /archiva/branches/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/BaseConsumer.java:686983-687034
-/archiva/branches/archiva-1.3.x/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:1049375,1049384,1049389-1049391
+/archiva/branches/archiva-1.3.x/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:1049375,1049384,1049389-1049399
 /archiva/branches/archiva-search-improvements/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:723609-726925
 /archiva/branches/archiva-struts2/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/BaseConsumer.java:699795-705848
 /archiva/tags/archiva-1.3/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/Consumer.java:898632

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java?rev=1049407&r1=1049406&r2=1049407&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
Wed Dec 15 03:39:46 2010
@@ -128,10 +128,6 @@ public class DaysOldRepositoryPurge
                     {
                         doPurgeAllRelated( newArtifactReference );
                     }
-                    else if ( newArtifactFile.lastModified() < olderThanThisDate.getTimeInMillis()
)
-                    {
-                        doPurgeAllRelated( newArtifactReference );
-                    }
                 }
             }
         }

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java?rev=1049407&r1=1049406&r2=1049407&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
Wed Dec 15 03:39:46 2010
@@ -31,6 +31,8 @@ import java.util.Collections;
 public class DaysOldRepositoryPurgeTest
     extends AbstractRepositoryPurgeTest
 {
+    private static final int OLD_TIMESTAMP = 1179382029;
+
     private void setLastModified( String dirPath, long lastModified )
     {
         File dir = new File( dirPath );
@@ -54,7 +56,7 @@ public class DaysOldRepositoryPurgeTest
 
         String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-install-plugin";
 
-        setLastModified( projectRoot + "/2.2-SNAPSHOT/", 1179382029 );
+        setLastModified( projectRoot + "/2.2-SNAPSHOT/", OLD_TIMESTAMP );
 
         // test listeners for the correct artifacts
         listener.deleteArtifact( getRepository().getId(), "org.apache.maven.plugins", "maven-install-plugin",
@@ -113,7 +115,7 @@ public class DaysOldRepositoryPurgeTest
 
         String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-assembly-plugin";
 
-        setLastModified( projectRoot + "/1.1.2-SNAPSHOT/", 1179382029 );
+        setLastModified( projectRoot + "/1.1.2-SNAPSHOT/", OLD_TIMESTAMP );
 
         // test listeners for the correct artifacts
         listener.deleteArtifact( getRepository().getId(), "org.apache.maven.plugins", "maven-assembly-plugin",
@@ -169,8 +171,17 @@ public class DaysOldRepositoryPurgeTest
 
         for ( int i = 5; i <= 7; i++ )
         {
-            new File( versionRoot, "/plexus-utils-1.4.3-" + timestamp + "-" + i + ".jar"
).createNewFile();
-            new File( versionRoot, "/plexus-utils-1.4.3-" + timestamp + "-" + i + ".pom"
).createNewFile();
+            File jarFile = new File( versionRoot, "/plexus-utils-1.4.3-" + timestamp + "-"
+ i + ".jar" );
+            jarFile.createNewFile();
+            File pomFile = new File( versionRoot, "/plexus-utils-1.4.3-" + timestamp + "-"
+ i + ".pom" );
+            pomFile.createNewFile();
+
+            // set timestamp to older than 100 days for the first build, but ensure the filename
timestamp is honoured instead
+            if ( i == 5 )
+            {
+                jarFile.setLastModified( OLD_TIMESTAMP );
+                pomFile.setLastModified( OLD_TIMESTAMP );
+            }
         }
 
         // test listeners for the correct artifacts



Mime
View raw message