Return-Path: Delivered-To: apmail-avalon-cvs-archive@www.apache.org Received: (qmail 84733 invoked from network); 12 Sep 2003 16:43:51 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Sep 2003 16:43:51 -0000 Received: (qmail 68217 invoked by uid 500); 12 Sep 2003 16:43:43 -0000 Delivered-To: apmail-avalon-cvs-archive@avalon.apache.org Received: (qmail 68165 invoked by uid 500); 12 Sep 2003 16:43:43 -0000 Mailing-List: contact cvs-help@avalon.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list cvs@avalon.apache.org Received: (qmail 68152 invoked by uid 500); 12 Sep 2003 16:43:42 -0000 Received: (qmail 68149 invoked from network); 12 Sep 2003 16:43:42 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 12 Sep 2003 16:43:42 -0000 Received: (qmail 84643 invoked by uid 1438); 12 Sep 2003 16:43:49 -0000 Date: 12 Sep 2003 16:43:49 -0000 Message-ID: <20030912164349.84642.qmail@minotaur.apache.org> From: mcconnell@apache.org To: avalon-sandbox-cvs@apache.org Subject: cvs commit: avalon-sandbox/merlin/merlin-platform/src/repository/merlin/xmls kernel.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mcconnell 2003/09/12 09:43:49 Modified: merlin/kernel/impl/conf kernel.xml merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl DefaultKernelContext.java merlin/merlin-platform/src/config debug.xml kernel.xml merlin/merlin-platform/src/repository/merlin/xmls kernel.xml Log: Move from something to . Revision Changes Path 1.4 +4 -4 avalon-sandbox/merlin/kernel/impl/conf/kernel.xml Index: kernel.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/kernel/impl/conf/kernel.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- kernel.xml 2 Sep 2003 09:03:21 -0000 1.3 +++ kernel.xml 12 Sep 2003 16:43:49 -0000 1.4 @@ -2,14 +2,14 @@ - - + + - http://www.ibiblio.org/merlin/repository/ - http://www.ibiblio.org/maven/ + + 1.27 +76 -46 avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernelContext.java Index: DefaultKernelContext.java =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernelContext.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- DefaultKernelContext.java 12 Sep 2003 15:26:20 -0000 1.26 +++ DefaultKernelContext.java 12 Sep 2003 16:43:49 -0000 1.27 @@ -156,7 +156,7 @@ /** * The kernel configuration url. */ - private final String m_kernelURL; + private String m_kernelURL; /** * The block url. @@ -253,33 +253,51 @@ else { String kernelURL = null; - try + File standard = new File( getMerlinHomeDirectory(), "config/kernel.xml" ); + if( standard.exists() ) { - URL url = loadKernelDirective( repository ); - kernelURL = url.toString(); - kernelConfig = getKernelConfiguration( url ); - } - catch( Throwable e ) - { - kernelURL = "resource:/kernel.xml"; try { - final InputStream stream = - DefaultKernelContext.class.getClassLoader(). - getResourceAsStream( "kernel.xml" ); - final InputSource source = - new InputSource( stream ); - DefaultConfigurationBuilder builder = - new DefaultConfigurationBuilder(); - kernelConfig = builder.build( source ); + m_kernelURL = standard.toURL().toString(); + kernelConfig = getKernelConfiguration( standard.toURL() ); } catch( Throwable ee ) { final String error = - "Unable to resolve kernel profile."; + "Unable to resolve kernel profile: " + standard; throw new KernelException( error, ee ); } } + else + { + try + { + URL url = loadKernelDirective( repository ); + kernelURL = url.toString(); + kernelConfig = getKernelConfiguration( url ); + } + catch( Throwable e ) + { + kernelURL = "resource:/kernel.xml"; + try + { + final InputStream stream = + DefaultKernelContext.class.getClassLoader(). + getResourceAsStream( "kernel.xml" ); + final InputSource source = + new InputSource( stream ); + DefaultConfigurationBuilder builder = + new DefaultConfigurationBuilder(); + kernelConfig = builder.build( source ); + } + catch( Throwable ee ) + { + final String error = + "Unable to resolve kernel profile."; + throw new KernelException( error, ee ); + } + } + } m_kernelURL = kernelURL; } @@ -425,23 +443,30 @@ try { String path = host.getAttribute( "path", null ); - if(( path == null ) && ( host.getValue( null ) != null )) - { - path = host.getValue( null ); - final String warning = - "Your kernel file container a depricated statement. " - + "Please replace all ... references " - + "with ." - + ConfigurationUtil.list( host ) - + "/nkernel: " + m_kernelURL; - getLogger().warn( warning ); - } - else + if( path == null ) { - final String error = - "Missing host path attribute." - + ConfigurationUtil.list( host ); - throw new KernelException( error ); + if( host.getValue( null ) != null ) + { + path = host.getValue( null ); + final String warning = + "\n#" + + "\n# WARNING:" + path + + "\n# Your kernel file is using a depricated format. " + + "\n# Please replace all ... references " + + "\n# with ." + + "\n#" + + "\n# Source kernel defintion: " + m_kernelURL + + "\n#" + + ConfigurationUtil.list( host ); + getLogger().warn( warning ); + } + else + { + final String error = + "Missing host path attribute." + + ConfigurationUtil.list( host ); + throw new KernelException( error ); + } } if( !path.endsWith( "/" ) ) { @@ -669,14 +694,7 @@ { StringBuffer buffer = new StringBuffer(); buffer.append( " ${user.dir}: " + System.getProperty( "user.dir" ) ); - if( m_system == null ) - { - buffer.append( "\n ${merlin.home}: " + getMerlinHomeDirectory() ); - } - else - { - buffer.append( "\n ${merlin.home}: " + m_system ); - } + buffer.append( "\n ${merlin.home}: " + getMerlinHomeDirectory() ); buffer.append( "\n Version: " + getVersionString() ); buffer.append( "\n Environment: " + System.getProperty( "os.name" ) + " " @@ -895,7 +913,7 @@ return repository.getArtifact( "merlin", "kernel", "", "xml" ); } - private static File getSystemDefaultDirectory() + private File getSystemDefaultDirectory() { final String local = System.getProperty( @@ -904,11 +922,23 @@ return new File( local ); } - private static File getMerlinHomeDirectory() + private File getMerlinHomeDirectory() + { + if( m_system == null ) + { + return getDefaultMerlinHomeDirectory(); + } + else + { + return m_system; + } + } + + private File getDefaultMerlinHomeDirectory() { final String local = System.getProperty( "merlin.home", - System.getProperty( "user.home" ) + "/merlin" ); + System.getProperty( "user.home" ) + "/.merlin" ); return new File( local ); } } 1.5 +2 -2 avalon-sandbox/merlin/merlin-platform/src/config/debug.xml Index: debug.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/src/config/debug.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- debug.xml 12 Sep 2003 14:00:39 -0000 1.4 +++ debug.xml 12 Sep 2003 16:43:49 -0000 1.5 @@ -7,8 +7,8 @@ - http://www.dpml.net/repository/ - http://www.ibiblio.org/maven/ + + 1.14 +2 -2 avalon-sandbox/merlin/merlin-platform/src/config/kernel.xml Index: kernel.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/src/config/kernel.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- kernel.xml 12 Sep 2003 14:00:39 -0000 1.13 +++ kernel.xml 12 Sep 2003 16:43:49 -0000 1.14 @@ -11,8 +11,8 @@ - http://www.dpml.net/repository/ - http://www.ibiblio.org/maven/ + + 1.5 +2 -2 avalon-sandbox/merlin/merlin-platform/src/repository/merlin/xmls/kernel.xml Index: kernel.xml =================================================================== RCS file: /home/cvs/avalon-sandbox/merlin/merlin-platform/src/repository/merlin/xmls/kernel.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- kernel.xml 12 Sep 2003 14:00:39 -0000 1.4 +++ kernel.xml 12 Sep 2003 16:43:49 -0000 1.5 @@ -8,8 +8,8 @@ - http://www.dpml.net/repository/ - http://www.ibiblio.org/maven/ + + --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org For additional commands, e-mail: cvs-help@avalon.apache.org