Skip to content

Commit 58c1f0e

Browse files
committed
Merge pull request #2 from aloubyansky/7.x
merged with the latest master at jbossas/patch-gen
2 parents 2d19266 + a7003de commit 58c1f0e

File tree

13 files changed

+522
-87
lines changed

13 files changed

+522
-87
lines changed

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ In the following sections, substitute `patch-gen` for `java -jar patch-gen-*-sha
88

99
alias patch-gen='java -jar patch-gen-*-shaded.jar'
1010

11-
### Patch Generation
12-
patch-gen --applies-to-dist=~/wildfly/wildfly-8.0.0.Final --updated-dist=~/wildfly/wildfly-8.1.0.CR2 --patch-config=patch-config-wildfly-CR2-patch.xml --output-file=wildfly-8.1.0.CR2.patch.zip
11+
## Patch Generation
12+
patch-gen --applies-to-dist=~/wildfly/wildfly-8.0.0.Final --updated-dist=~/wildfly/wildfly-8.0.1.Final --patch-config=wildfly-8.0.1.Final-patch.xml --output-file=wildfly-8.0.1.Final.patch.zip
1313

1414
`--applies-to-dist` and `--updated-dist` must point exactly at the root of the distributions (the directory containing bin, modules, domain, etc.), otherwise the tool will crash.
1515

16+
### Generation of patches containing multiple CPs
17+
18+
patch-gen --applies-to-dist=~/wildfly/wildfly-8.0.1.Final --updated-dist=~/wildfly/wildfly-8.0.2.Final --patch-config=wildfly-8.0.2.Final-patch.xml --output-file=wildfly-8.0.2.Final.patch.zip --combine-with=wildfly-8.0.1.Final.patch.zip
19+
20+
where wildfly-8.0.1.Final.patch.zip is the last produced CP (in this example generated in the section above) for wildfly-8.0.0.Final.
21+
The generated patch wildfly-8.0.2.Final.patch.zip can be applied to wildfly-8.0.1.Final as well as to wildfly-8.0.0.Final.
22+
No matter to which version it is applied, the resulting patched version will be wildfly-8.0.2.Final.
23+
There is no restriction on the number of CPs included into a single patch file.
24+
1625
### Configuration Templating
1726

1827
#### One off
@@ -44,10 +53,10 @@ $EDITOR patch-config-wildfly-CR2-patch.xml
4453
```xml
4554
<?xml version='1.0' encoding='UTF-8'?>
4655
<patch-config xmlns="urn:jboss:patch-config:1.0">
47-
<name>wildfly-CR2</name>
48-
<description>WildFly 8.1.0.CR2 patch</description>
56+
<name>wildfly-8.0.2.Final.patch</name>
57+
<description>WildFly 8.0.2.Final patch</description>
4958
<cumulative />
50-
<element patch-id="base-wildfly-CR2-patch">
59+
<element patch-id="base-wildfly-8.0.2.Final-patch">
5160
<cumulative name="base" />
5261
<description>No description available</description>
5362
</element>
@@ -60,4 +69,4 @@ $EDITOR patch-config-wildfly-CR2-patch.xml
6069
unzip -qo patch.zip README.txt
6170
$EDITOR README.txt
6271
zip -qu patch.zip README.txt
63-
```
72+
```

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
<groupId>org.jboss.as</groupId>
1414
<artifactId>patch-gen</artifactId>
15-
<version>1.0.0.Alpha1-SNAPSHOT</version>
15+
<version>2.0.0.Alpha1-SNAPSHOT</version>
1616

1717
<name>jboss patch-gen tool</name>
18-
<description>The patch patch-gen tool</description>
18+
<description>The patch-gen tool</description>
1919

2020
<properties>
2121
<!-- Build configuration -->
@@ -33,7 +33,7 @@
3333
For example: <version.org.jboss.as.console>
3434
-->
3535

36-
<version.org.wildfly>7.3.1.Final-redhat-2</version.org.wildfly>
36+
<version.org.wildfly-core>2.0.0.CR6</version.org.wildfly-core>
3737
<version.junit>4.11</version.junit>
3838

3939
<!-- Surefire args -->
@@ -136,9 +136,9 @@
136136
<dependencies>
137137

138138
<dependency>
139-
<groupId>org.wildfly</groupId>
139+
<groupId>org.wildfly.core</groupId>
140140
<artifactId>wildfly-patching</artifactId>
141-
<version>${version.org.wildfly}</version>
141+
<version>${version.org.wildfly-core}</version>
142142
</dependency>
143143

144144
<dependency>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* JBoss, Home of Professional Open Source.
3+
* Copyright 2015, Red Hat, Inc., and individual contributors
4+
* as indicated by the @author tags. See the copyright.txt file in the
5+
* distribution for a full listing of individual contributors.
6+
*
7+
* This is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation; either version 2.1 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* This software is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this software; if not, write to the Free
19+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21+
*/
22+
23+
package org.jboss.as.patching.generator;
24+
25+
/**
26+
*
27+
* @author Alexey Loubyansky
28+
*/
29+
public class OptionalPath {
30+
31+
public static OptionalPath create(String path) {
32+
return new OptionalPath(path, null);
33+
}
34+
35+
public static OptionalPath create(String path, String requires) {
36+
return new OptionalPath(path, requires);
37+
}
38+
39+
private final String value;
40+
private final String requires;
41+
42+
OptionalPath(String value, String requires) {
43+
assert value != null : "value is null";
44+
this.value = value;
45+
this.requires = requires;
46+
}
47+
48+
public String getValue() {
49+
return value;
50+
}
51+
52+
public String getRequires() {
53+
return requires;
54+
}
55+
56+
/* (non-Javadoc)
57+
* @see java.lang.Object#hashCode()
58+
*/
59+
@Override
60+
public int hashCode() {
61+
final int prime = 31;
62+
int result = 1;
63+
result = prime * result + ((requires == null) ? 0 : requires.hashCode());
64+
result = prime * result + ((value == null) ? 0 : value.hashCode());
65+
return result;
66+
}
67+
68+
/* (non-Javadoc)
69+
* @see java.lang.Object#equals(java.lang.Object)
70+
*/
71+
@Override
72+
public boolean equals(Object obj) {
73+
if (this == obj)
74+
return true;
75+
if (obj == null)
76+
return false;
77+
if (getClass() != obj.getClass())
78+
return false;
79+
OptionalPath other = (OptionalPath) obj;
80+
if (requires == null) {
81+
if (other.requires != null)
82+
return false;
83+
} else if (!requires.equals(other.requires))
84+
return false;
85+
if (value == null) {
86+
if (other.value != null)
87+
return false;
88+
} else if (!value.equals(other.value))
89+
return false;
90+
return true;
91+
}
92+
93+
@Override
94+
public String toString() {
95+
return "[" + value + " requires " + requires + "]";
96+
}
97+
}

0 commit comments

Comments
 (0)