[3/3] karaf git commit: Test config write back

2017-08-11 Thread cschneider
Test config write back

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/0cbb2685
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/0cbb2685
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/0cbb2685

Branch: refs/heads/master
Commit: 0cbb2685817e70a45e44cb423dd2bd5cdfa37351
Parents: 562019c
Author: Christian Schneider 
Authored: Fri Aug 11 11:15:59 2017 +0200
Committer: Christian Schneider 
Committed: Fri Aug 11 11:15:59 2017 +0200

--
 .../src/test/java/org/apache/karaf/features/AppendTest.java | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/0cbb2685/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
--
diff --git 
a/features/core/src/test/java/org/apache/karaf/features/AppendTest.java 
b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
index 662ad2d..d64da81 100644
--- a/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
@@ -22,6 +22,8 @@ import static org.easymock.EasyMock.expectLastCall;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Dictionary;
 import java.util.Hashtable;
@@ -48,7 +50,7 @@ public class AppendTest {
 @Before
 public void before() throws Exception {
 System.setProperty("karaf.data", "data");
-System.setProperty("karaf.etc", "etc");
+System.setProperty("karaf.etc", "target");
 RepositoryImpl r = new 
RepositoryImpl(getClass().getResource("internal/service/f08.xml").toURI());
 Feature[] features = r.getFeatures();
 feature = features[0];
@@ -71,6 +73,8 @@ public class AppendTest {
 
 @Test
 public void testAppend() throws Exception {
+File cfgFile = new File("target/org.ops4j.pax.web.cfg");
+cfgFile.delete();
 Hashtable original = new Hashtable<>();
 original.put("foo", "bar");
 Configuration config = expectConfig(admin, original);
@@ -81,6 +85,9 @@ public class AppendTest {
 installer.installFeatureConfigs(feature);
 c.verify();
 assertEquals("data/pax-web-jsp", 
captured.getValue().get("javax.servlet.context.tempdir"));
+Properties props = new Properties();
+props.load(new FileInputStream(cfgFile));
+assertEquals("data/pax-web-jsp", 
props.getProperty("javax.servlet.context.tempdir"));
 }
 
 private Configuration expectConfig(ConfigurationAdmin admin, 
Hashtable original)



[1/3] karaf git commit: Replace tabs in files

2017-08-11 Thread cschneider
Repository: karaf
Updated Branches:
  refs/heads/master 3b42fb5a5 -> 0cbb26858


Replace tabs in files

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/935006e6
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/935006e6
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/935006e6

Branch: refs/heads/master
Commit: 935006e6d1ca68a5f84b2ad1584e7db84f939eb5
Parents: 3b42fb5
Author: Christian Schneider 
Authored: Fri Aug 11 10:07:52 2017 +0200
Committer: Christian Schneider 
Committed: Fri Aug 11 10:07:52 2017 +0200

--
 .../service/FeatureConfigInstaller.java | 80 -
 .../org/apache/karaf/features/AppendTest.java   | 90 ++--
 .../org/apache/karaf/features/FeatureTest.java  | 20 ++---
 .../apache/karaf/features/RepositoryTest.java   | 12 ++-
 4 files changed, 104 insertions(+), 98 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/935006e6/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
--
diff --git 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
index d1fc525..77522c5 100644
--- 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
+++ 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
@@ -73,8 +73,9 @@ public class FeatureConfigInstaller {
 }
 }
 
-private Configuration createConfiguration(ConfigurationAdmin 
configurationAdmin,
-  String pid, String factoryPid) 
throws IOException, InvalidSyntaxException {
+private Configuration createConfiguration(ConfigurationAdmin 
configurationAdmin, String pid,
+  String factoryPid)
+throws IOException, InvalidSyntaxException {
 if (factoryPid != null) {
 return configurationAdmin.createFactoryConfiguration(pid, null);
 } else {
@@ -82,8 +83,9 @@ public class FeatureConfigInstaller {
 }
 }
 
-private Configuration findExistingConfiguration(ConfigurationAdmin 
configurationAdmin,
-String pid, String 
factoryPid) throws IOException, InvalidSyntaxException {
+private Configuration findExistingConfiguration(ConfigurationAdmin 
configurationAdmin, String pid,
+String factoryPid)
+throws IOException, InvalidSyntaxException {
 String filter;
 if (factoryPid == null) {
 filter = "(" + Constants.SERVICE_PID + "=" + pid + ")";
@@ -99,7 +101,7 @@ public class FeatureConfigInstaller {
 }
 
 public void installFeatureConfigs(Feature feature) throws IOException, 
InvalidSyntaxException {
-   for (ConfigInfo config : feature.getConfigurations()) {
+for (ConfigInfo config : feature.getConfigurations()) {
 TypedProperties props = new TypedProperties();
 // trim lines
 String val = config.getValue();
@@ -108,14 +110,14 @@ public class FeatureConfigInstaller {
 } else {
 props.load(new StringReader(val));
 }
-   String[] pid = parsePid(config.getName());
-   Configuration cfg = 
findExistingConfiguration(configAdmin, pid[0], pid[1]);
-   if (cfg == null) {
-   Dictionary cfgProps = 
convertToDict(props);
-   cfg = createConfiguration(configAdmin, pid[0], 
pid[1]);
-   String key = createConfigurationKey(pid[0], 
pid[1]);
-   cfgProps.put(CONFIG_KEY, key);
-   props.put(CONFIG_KEY, key);
+String[] pid = parsePid(config.getName());
+Configuration cfg = findExistingConfiguration(configAdmin, pid[0], 
pid[1]);
+if (cfg == null) {
+Dictionary cfgProps = convertToDict(props);
+cfg = createConfiguration(configAdmin, pid[0], pid[1]);
+String key = createConfigurationKey(pid[0], pid[1]);
+cfgProps.put(CONFIG_KEY, key);
+props.put(CONFIG_KEY, key);
 if (storage != null && configCfgStore) {
 File cfgFile;
 if (pid[1] != null) {
@@ -125,15 +127,15 @@ public class FeatureConfigInstaller {
 }
 cfgProps.put(FILEINSTALL_FILE_NAME, 
cfgFile.getAbsoluteFile().toURI().toStr

[2/3] karaf git commit: Improve test to actually test the append scenario

2017-08-11 Thread cschneider
Improve test to actually test the append scenario

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/562019cb
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/562019cb
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/562019cb

Branch: refs/heads/master
Commit: 562019cbd2ffea35508d2cb30c29028130bd56de
Parents: 935006e
Author: Christian Schneider 
Authored: Fri Aug 11 11:00:11 2017 +0200
Committer: Christian Schneider 
Committed: Fri Aug 11 11:00:11 2017 +0200

--
 .../org/apache/karaf/features/AppendTest.java   | 110 +++
 1 file changed, 63 insertions(+), 47 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/562019cb/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
--
diff --git 
a/features/core/src/test/java/org/apache/karaf/features/AppendTest.java 
b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
index d6d5d20..662ad2d 100644
--- a/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
@@ -16,74 +16,90 @@
  */
 package org.apache.karaf.features;
 
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Properties;
 
-import junit.framework.TestCase;
 import org.apache.karaf.features.internal.service.FeatureConfigInstaller;
 import org.apache.karaf.features.internal.service.RepositoryImpl;
+import org.easymock.Capture;
 import org.easymock.EasyMock;
+import org.easymock.IMocksControl;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
 
-public class AppendTest extends TestCase {
-
-public void testLoad() throws Exception {
+public class AppendTest {
 
+private IMocksControl c;
+private Feature feature;
+private ConfigurationAdmin admin;
+private FeatureConfigInstaller installer;
+
+@Before
+public void before() throws Exception {
 System.setProperty("karaf.data", "data");
 System.setProperty("karaf.etc", "etc");
-
 RepositoryImpl r = new 
RepositoryImpl(getClass().getResource("internal/service/f08.xml").toURI());
-// Check repo
 Feature[] features = r.getFeatures();
-assertNotNull(features);
-assertEquals(1, features.length);
-Feature feature = features[0];
-
-ConfigInfo configInfo = feature.getConfigurations().get(0);
-assertNotNull(configInfo);
-assertTrue(configInfo.isAppend());
-
-Properties properties = configInfo.getProperties();
-assertNotNull(properties);
-String property = 
properties.getProperty("javax.servlet.context.tempdir");
-assertNotNull(property);
-assertFalse(property.contains("${"));
-assertEquals(property, "data/pax-web-jsp");
+feature = features[0];
+checkFeature(feature);
+c = EasyMock.createControl();
+admin = c.createMock(ConfigurationAdmin.class);
+installer = new FeatureConfigInstaller(admin);
+}
 
-ConfigurationAdmin admin = 
EasyMock.createMock(ConfigurationAdmin.class);
-Configuration config = EasyMock.createMock(Configuration.class);
-
EasyMock.expect(admin.listConfigurations(EasyMock.eq("(service.pid=org.ops4j.pax.web)")))
-.andReturn(new Configuration[] {
-config
-});
+@Test
+public void testNoChange() throws Exception {
 Hashtable original = new Hashtable<>();
-original.put("javax.servlet.context.tempdir", "data/pax-web-jsp");
-EasyMock.expect(config.getProperties()).andReturn(original);
+original.put("javax.servlet.context.tempdir", "bar");
+expectConfig(admin, original);
 
-Hashtable expected = new Hashtable<>();
-expected.put("org.ops4j.pax.web", "data/pax-web-jsp");
-expected.put("org.apache.karaf.features.configKey", 
"org.ops4j.pax.web");
-expected.put("foo", "bar");
-EasyMock.expectLastCall();
-EasyMock.replay(admin, config);
+c.replay();
+installer.installFeatureConfigs(feature);
+c.verify();
+}
 
-FeatureConfigInstaller installer = new FeatureConfigInstaller(admin);
+@Test
+public void testAppend() throws Exception {
+Hashtable original = new Hashtable<>();
+ 

karaf git commit: [KARAF-5305] Fix issue when cfg file exists

2017-08-11 Thread cschneider
Repository: karaf
Updated Branches:
  refs/heads/master 0cbb26858 -> 5cc9c81b3


[KARAF-5305] Fix issue when cfg file exists


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/5cc9c81b
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/5cc9c81b
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/5cc9c81b

Branch: refs/heads/master
Commit: 5cc9c81b3aadacab6c33614f22680b2acadde20d
Parents: 0cbb268
Author: Christian Schneider 
Authored: Fri Aug 11 11:42:10 2017 +0200
Committer: Christian Schneider 
Committed: Fri Aug 11 11:42:10 2017 +0200

--
 .../internal/service/FeatureConfigInstaller.java |  5 +++--
 .../java/org/apache/karaf/features/AppendTest.java   | 15 ++-
 2 files changed, 17 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/5cc9c81b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
--
diff --git 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
index 77522c5..5a86e53 100644
--- 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
+++ 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
@@ -301,13 +301,14 @@ public class FeatureConfigInstaller {
 && !FILEINSTALL_FILE_NAME.equals(key)) {
 List comments = props.getComments(key);
 List value = props.getRaw(key);
+Object writeValue = (value.size() == 1) ? value.get(0) 
: value;
 if (!properties.containsKey(key)) {
-properties.put(key, comments, value);
+properties.put(key, comments, writeValue);
 } else if (!append) {
 if (comments.isEmpty()) {
 comments = properties.getComments(key);
 }
-properties.put(key, comments, value);
+properties.put(key, comments, writeValue);
 }
 }
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/5cc9c81b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
--
diff --git 
a/features/core/src/test/java/org/apache/karaf/features/AppendTest.java 
b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
index d64da81..434cbc9 100644
--- a/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
+++ b/features/core/src/test/java/org/apache/karaf/features/AppendTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.Dictionary;
 import java.util.Hashtable;
@@ -72,9 +73,21 @@ public class AppendTest {
 }
 
 @Test
-public void testAppend() throws Exception {
+public void testAppendWhenFileExists() throws Exception {
+testAppendInternal(true);
+}
+
+@Test
+public void testAppendWhenNoFileExists() throws Exception {
+testAppendInternal(false);
+}
+
+private void testAppendInternal(boolean cfgFileExists) throws IOException, 
InvalidSyntaxException, FileNotFoundException {
 File cfgFile = new File("target/org.ops4j.pax.web.cfg");
 cfgFile.delete();
+if (cfgFileExists) {
+cfgFile.createNewFile();
+}
 Hashtable original = new Hashtable<>();
 original.put("foo", "bar");
 Configuration config = expectConfig(admin, original);



karaf git commit: Refactor FeatureConfigInstaller

2017-08-11 Thread cschneider
Repository: karaf
Updated Branches:
  refs/heads/master 5cc9c81b3 -> 244fafdc4


Refactor FeatureConfigInstaller


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/244fafdc
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/244fafdc
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/244fafdc

Branch: refs/heads/master
Commit: 244fafdc40a6b8210c8f5b2c65a3f8f5d7f7f07e
Parents: 5cc9c81
Author: Christian Schneider 
Authored: Fri Aug 11 12:01:28 2017 +0200
Committer: Christian Schneider 
Committed: Fri Aug 11 12:01:28 2017 +0200

--
 .../service/FeatureConfigInstaller.java | 182 +--
 1 file changed, 89 insertions(+), 93 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/244fafdc/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
--
diff --git 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
index 5a86e53..694427e 100644
--- 
a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
+++ 
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
@@ -62,15 +62,17 @@ public class FeatureConfigInstaller {
 this.configCfgStore = configCfgStore;
 }
 
-private String[] parsePid(String pid) {
+private ConfigId parsePid(String pid) {
 int n = pid.indexOf('-');
+ConfigId cid = new ConfigId();
+cid.fullPid = pid;
 if (n > 0) {
-String factoryPid = pid.substring(n + 1);
-pid = pid.substring(0, n);
-return new String[]{pid, factoryPid};
+cid.factoryPid = pid.substring(n + 1);
+cid.pid = pid.substring(0, n);
 } else {
-return new String[]{pid, null};
+cid.pid = pid;
 }
+return cid;
 }
 
 private Configuration createConfiguration(ConfigurationAdmin 
configurationAdmin, String pid,
@@ -83,21 +85,16 @@ public class FeatureConfigInstaller {
 }
 }
 
-private Configuration findExistingConfiguration(ConfigurationAdmin 
configurationAdmin, String pid,
-String factoryPid)
+private Configuration findExistingConfiguration(ConfigurationAdmin 
configurationAdmin, ConfigId cid)
 throws IOException, InvalidSyntaxException {
 String filter;
-if (factoryPid == null) {
-filter = "(" + Constants.SERVICE_PID + "=" + pid + ")";
+if (cid.factoryPid == null) {
+filter = "(" + Constants.SERVICE_PID + "=" + cid.pid + ")";
 } else {
-String key = createConfigurationKey(pid, factoryPid);
-filter = "(" + CONFIG_KEY + "=" + key + ")";
+filter = "(" + CONFIG_KEY + "=" + cid.fullPid + ")";
 }
 Configuration[] configurations = 
configurationAdmin.listConfigurations(filter);
-if (configurations != null && configurations.length > 0) {
-return configurations[0];
-}
-return null;
+return (configurations != null && configurations.length > 0) ? 
configurations[0] : null;
 }
 
 public void installFeatureConfigs(Feature feature) throws IOException, 
InvalidSyntaxException {
@@ -110,26 +107,20 @@ public class FeatureConfigInstaller {
 } else {
 props.load(new StringReader(val));
 }
-String[] pid = parsePid(config.getName());
-Configuration cfg = findExistingConfiguration(configAdmin, pid[0], 
pid[1]);
+ConfigId cid = parsePid(config.getName());
+Configuration cfg = findExistingConfiguration(configAdmin, cid);
 if (cfg == null) {
 Dictionary cfgProps = convertToDict(props);
-cfg = createConfiguration(configAdmin, pid[0], pid[1]);
-String key = createConfigurationKey(pid[0], pid[1]);
-cfgProps.put(CONFIG_KEY, key);
-props.put(CONFIG_KEY, key);
+cfg = createConfiguration(configAdmin, cid.pid, 
cid.factoryPid);
+cfgProps.put(CONFIG_KEY, cid.fullPid);
+props.put(CONFIG_KEY, cid.fullPid);
 if (storage != null && configCfgStore) {
-File cfgFile;
-if (pid[1] != null) {
-cfgFile = new File(storage, pid[0] + "-" + pid[1] + 
".cfg");
-} else {
-cfgFile = new File(storage, pid[0] + ".cfg");
-}
+   

karaf git commit: [KARAF-5304] Update karaf script to be compliant with AIX

2017-08-11 Thread jbonofre
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.1.x 31e38f8f6 -> 7281969cf


[KARAF-5304] Update karaf script to be compliant with AIX


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/7281969c
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/7281969c
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/7281969c

Branch: refs/heads/karaf-4.1.x
Commit: 7281969cff49399c8f4817456e56de3b06b5b7e0
Parents: 31e38f8
Author: Jean-Baptiste Onofré 
Authored: Fri Aug 11 15:00:57 2017 +0200
Committer: Jean-Baptiste Onofré 
Committed: Fri Aug 11 15:02:00 2017 +0200

--
 .../base/src/main/filtered-resources/resources/bin/karaf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/7281969c/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
--
diff --git 
a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf 
b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
index 0eb9df0..0a191c7 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
@@ -89,10 +89,10 @@ checkRootInstance() {
   ROOT_INSTANCE_PID=$(sed -n -e '/item.0.pid/ s/.*\= *//p' 
"${KARAF_HOME}/instances/instance.properties")
   ROOT_INSTANCE_NAME=$(sed -n -e '/item.0.name/ s/.*\= *//p' 
"${KARAF_HOME}/instances/instance.properties")
   if [ "${ROOT_INSTANCE_PID}" -ne "0" ]; then
-  if ps p "${ROOT_INSTANCE_PID}" > /dev/null
+  if ps -p "${ROOT_INSTANCE_PID}" > /dev/null
   then
   MAIN=org.apache.karaf.main.Main
-  PID_COMMAND=$(ps p "${ROOT_INSTANCE_PID}" o args | sed 1d)
+  PID_COMMAND=$(ps -p "${ROOT_INSTANCE_PID}" o args | sed 1d)
   if [ "${PID_COMMAND#*$MAIN}" != "$PID_COMMAND" ]; then
 ROOT_INSTANCE_RUNNING=true
   fi



karaf git commit: [KARAF-5304] Update karaf script to be compliant with AIX

2017-08-11 Thread jbonofre
Repository: karaf
Updated Branches:
  refs/heads/master 244fafdc4 -> b7bdb3594


[KARAF-5304] Update karaf script to be compliant with AIX


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/b7bdb359
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/b7bdb359
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/b7bdb359

Branch: refs/heads/master
Commit: b7bdb359499d7fd9db09847e078d20cb461c2ace
Parents: 244fafd
Author: Jean-Baptiste Onofré 
Authored: Fri Aug 11 15:00:57 2017 +0200
Committer: Jean-Baptiste Onofré 
Committed: Fri Aug 11 15:01:34 2017 +0200

--
 .../base/src/main/filtered-resources/resources/bin/karaf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/b7bdb359/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
--
diff --git 
a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf 
b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
index dc022bc..048b344 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
@@ -89,10 +89,10 @@ checkRootInstance() {
   ROOT_INSTANCE_PID=$(sed -n -e '/item.0.pid/ s/.*\= *//p' 
"${KARAF_HOME}/instances/instance.properties")
   ROOT_INSTANCE_NAME=$(sed -n -e '/item.0.name/ s/.*\= *//p' 
"${KARAF_HOME}/instances/instance.properties")
   if [ "${ROOT_INSTANCE_PID}" -ne "0" ]; then
-  if ps p "${ROOT_INSTANCE_PID}" > /dev/null
+  if ps -p "${ROOT_INSTANCE_PID}" > /dev/null
   then
   MAIN=org.apache.karaf.main.Main
-  PID_COMMAND=$(ps p "${ROOT_INSTANCE_PID}" o args | sed 1d)
+  PID_COMMAND=$(ps -p "${ROOT_INSTANCE_PID}" o args | sed 1d)
   if [ "${PID_COMMAND#*$MAIN}" != "$PID_COMMAND" ]; then
 ROOT_INSTANCE_RUNNING=true
   fi



Build failed in Jenkins: karaf-master #4535

2017-08-11 Thread Apache Jenkins Server
See 


Changes:

[jbonofre] [KARAF-5304] Update karaf script to be compliant with AIX

--
[...truncated 1.02 MB...]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.maven.plugins:maven-invoker-plugin:2.0.0:run (integration-test) on 
project karaf-maven-plugin: Could not create temporary file for invoker 
settings.xml
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at 
org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not create 
temporary file for invoker settings.xml
at 
org.apache.maven.plugin.invoker.AbstractInvokerMojo.runBuilds(AbstractInvokerMojo.java:1196)
at 
org.apache.maven.plugin.invoker.AbstractInvokerMojo.execute(AbstractInvokerMojo.java:737)
at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 31 more
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(File.java:2024)
at java.io.File.createTempFile(File.java:2070)
at 
org.apache.maven.plugin.invoker.AbstractInvokerMojo.runBuilds(AbstractInvokerMojo.java:1175)
... 34 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :karaf-maven-plugin
[JENKINS] Archiving 
 to 
org.apache.karaf.archetypes/karaf-blueprint-archetype/4.2.0-SNAPSHOT/karaf-blueprint-archetype-4.2.0-SNAPSHOT.pom
[JENKINS] Archiving 
 to 
org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/4.2.0-SNAPSHOT/org.apache.karaf.webconsole.gogo-4.2.0-SNAPSHOT.pom
[JENKINS] Archiving 


Jenkins build is back to stable : karaf-4.1.x #162

2017-08-11 Thread Apache Jenkins Server
See 




karaf git commit: [KARAF-5304] Update karaf script to be compliant with AIX

2017-08-11 Thread jbonofre
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x cdb905c0a -> e1f74e3a2


[KARAF-5304] Update karaf script to be compliant with AIX


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/e1f74e3a
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/e1f74e3a
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/e1f74e3a

Branch: refs/heads/karaf-4.0.x
Commit: e1f74e3a2148a3b9b47cc1066d84ef5413920ce1
Parents: cdb905c
Author: Jean-Baptiste Onofré 
Authored: Fri Aug 11 17:34:02 2017 +0200
Committer: Jean-Baptiste Onofré 
Committed: Fri Aug 11 17:34:02 2017 +0200

--
 assemblies/features/base/src/main/resources/resources/bin/karaf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/e1f74e3a/assemblies/features/base/src/main/resources/resources/bin/karaf
--
diff --git a/assemblies/features/base/src/main/resources/resources/bin/karaf 
b/assemblies/features/base/src/main/resources/resources/bin/karaf
index a86956b..c157a7a 100755
--- a/assemblies/features/base/src/main/resources/resources/bin/karaf
+++ b/assemblies/features/base/src/main/resources/resources/bin/karaf
@@ -358,7 +358,7 @@ checkRootInstance() {
   ROOT_INSTANCE_PID=$(sed -n -e '/item.0.pid/ s/.*\= *//p' 
"${KARAF_HOME}/instances/instance.properties")
   ROOT_INSTANCE_NAME=$(sed -n -e '/item.0.name/ s/.*\= *//p' 
"${KARAF_HOME}/instances/instance.properties")
   if [ "${ROOT_INSTANCE_PID}" -ne "0" ]; then
-  if ps p "${ROOT_INSTANCE_PID}" > /dev/null
+  if ps -p "${ROOT_INSTANCE_PID}" > /dev/null
   then
   ROOT_INSTANCE_RUNNING=true
   fi



Jenkins build is back to normal : karaf-master #4536

2017-08-11 Thread Apache Jenkins Server
See