-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle intermediate directories of collect entries in MissingDirector…
…yTracker
- Loading branch information
Showing
4 changed files
with
197 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>de.dentrassi.maven.rpm.test</groupId> | ||
<artifactId>test19</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>Test Package #19</name> | ||
<description> | ||
Test explicitly adding and applying rules for implicitly created intermediate directories with collect entries. | ||
</description> | ||
|
||
<url>http://dentrassi.de</url> | ||
|
||
<organization> | ||
<name>Jens Reimann</name> | ||
<url>http://dentrassi.de</url> | ||
</organization> | ||
|
||
<licenses> | ||
<license> | ||
<name>Eclipse Public License - v 1.0</name> | ||
<distribution>repo</distribution> | ||
<url>https://www.eclipse.org/legal/epl-v10.html</url> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<skipSigning>true</skipSigning> | ||
<!-- use a predictable timestamp --> | ||
<project.build.outputTimestamp>2009-01-01T12:00:00+01:00</project.build.outputTimestamp> | ||
</properties> | ||
|
||
<build> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>de.dentrassi.maven</groupId> | ||
<artifactId>rpm</artifactId> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>rpm</goal> | ||
</goals> | ||
<configuration> | ||
<attach>false</attach> | ||
<group>Application/Misc</group> | ||
|
||
<signature> | ||
<keyId>${keyId}</keyId> | ||
<keyringFile>${user.home}/.gnupg/secring.gpg</keyringFile> | ||
<passphrase>${passphrase}</passphrase> | ||
<hashAlgorithm>SHA1</hashAlgorithm> | ||
<skip>${skipSigning}</skip> | ||
</signature> | ||
|
||
<generateIntermediateDirectories> | ||
<baseDirecotry>/opt/mycompany/myapp</baseDirecotry> | ||
</generateIntermediateDirectories> | ||
|
||
<rulesets> | ||
<ruleset> | ||
<id>my-default</id> | ||
<rules> | ||
<rule> | ||
<when> | ||
<prefix>/opt/mycompany</prefix> | ||
</when> | ||
<user>mygeneraluser</user> | ||
<group>mygeneralgroup</group> | ||
<mode>0111</mode> | ||
</rule> | ||
<rule> | ||
<when> | ||
<prefix>/opt/mycompany/myapp</prefix> | ||
</when> | ||
<user>myuser</user> | ||
<group>mygroup</group> | ||
<mode>0555</mode> | ||
</rule> | ||
<rule> | ||
<when> | ||
<prefix>/opt/mycompany/myapp</prefix> | ||
<type>directory</type> | ||
</when> | ||
<mode>0777</mode> | ||
</rule> | ||
</rules> | ||
</ruleset> | ||
</rulesets> | ||
|
||
<entries> | ||
<entry> | ||
<name>/opt/mycompany/myapp/a/b</name> | ||
<collect> | ||
<from>${project.basedir}/src/main/data</from> | ||
<directories>false</directories> <!-- make explicit directories --> | ||
</collect> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
<entry> | ||
<name>/opt/mycompany/myapp/c/d</name> | ||
<collect> | ||
<from>${project.basedir}/src/main/data</from> | ||
<directories>true</directories> <!-- make explicit directories --> | ||
</collect> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
</entries> | ||
|
||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>sign</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
</activation> | ||
<properties> | ||
<skipSigning>false</skipSigning> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/it/test19-intermediate-directories-collect/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def dump() { | ||
Process proc = ('rpm -q --dump -p ' + basedir + "/target/*.rpm").execute() | ||
return proc.in.getText().trim() | ||
} | ||
|
||
def actual = dump() | ||
println "Dump:\n" + actual | ||
|
||
def expected = """\ | ||
/opt/mycompany/myapp 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/a 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/a/b 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/a/b/x/y/foobar 0 1230807600 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0100555 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/c 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/c/d 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/c/d/x 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/c/d/x/y 0 1230807600 0000000000000000000000000000000000000000000000000000000000000000 040777 myuser mygroup 0 0 0 X | ||
/opt/mycompany/myapp/c/d/x/y/foobar 0 1230807600 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0100555 myuser mygroup 0 0 0 X""".stripIndent() | ||
|
||
if (actual != expected) { | ||
System.out.format("RPM dump doesn't match - actual:%n%s%nexpected:%n%s%n", actual, expected); | ||
return false; | ||
} | ||
|
||
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters