Skip to content

Commit

Permalink
#26 - fixed repomd
Browse files Browse the repository at this point in the history
  • Loading branch information
g4s8 committed Mar 4, 2020
1 parent 37b2ee4 commit 86f110f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
50 changes: 49 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ SOFTWARE.
<dependency>
<groupId>com.artipie</groupId>
<artifactId>asto</artifactId>
<version>0.14.2</version>
<version>0.14.4</version>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
Expand Down Expand Up @@ -147,5 +147,53 @@ SOFTWARE.
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<parallel>none</parallel>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>cli</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>rpm</finalName>
<archive>
<manifest>
<mainClass>com.artipie.rpm.MainCli</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
9 changes: 6 additions & 3 deletions src/main/java/com/artipie/rpm/Repomd.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import com.artipie.asto.Key;
import com.artipie.asto.Storage;
import com.artipie.asto.blocking.BlockingStorage;
import com.artipie.asto.fs.RxFile;
import com.artipie.asto.rx.RxStorageWrapper;
import com.jcabi.xml.XML;
Expand Down Expand Up @@ -220,9 +221,11 @@ private CompletableSource performUpdate(
)
.andThen(new Update(temp).apply(directives))
.andThen(
rxsto.save(
new Key.From("repodata/repomd.xml"),
new RxFile(temp).flow()
Completable.fromAction(
() -> new BlockingStorage(this.storage).save(
new Key.From("repodata/repomd.xml"),
Files.readAllBytes(temp)
)
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/artipie/rpm/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public Completable apply(final Directives dirs) {
}
final String doc = new XMLDocument(output).toString();
Files.write(this.xml, doc.getBytes(StandardCharsets.UTF_8));
Logger.debug(this, "Saved:\n%s", doc);
Logger.debug(this, "Saved: %s\n%s", this.xml, doc);
});
}
}
4 changes: 3 additions & 1 deletion src/test/resources/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=com.jcabi.log.MulticolorLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%color{%p}] %t %c: %m%n

log4j.logger.com.yegor256.rpm=DEBUG
log4j.logger.com.artipie.rpm=DEBUG
log4j.logger.com.artipie.asto.fs=DEBUG

0 comments on commit 86f110f

Please sign in to comment.