Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2979 - in development/main/depot: console/src/main/net/dpml/depot/lang console/src/main/net/dpml/depot/profile install/src/main/net/dpml/depot/install

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2979 - in development/main/depot: console/src/main/net/dpml/depot/lang console/src/main/net/dpml/depot/profile install/src/main/net/dpml/depot/install
  • Date: Tue, 05 Jul 2005 04:41:16 -0400

Author: mcconnell AT dpml.net
Date: Tue Jul 5 04:41:16 2005
New Revision: 2979

Modified:
development/main/depot/console/src/main/net/dpml/depot/lang/Main.java

development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfile.java

development/main/depot/console/src/main/net/dpml/depot/profile/DefaultApplicationProfile.java

development/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java

development/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
Log:
General improvements to installation handling.

Modified:
development/main/depot/console/src/main/net/dpml/depot/lang/Main.java
==============================================================================
--- development/main/depot/console/src/main/net/dpml/depot/lang/Main.java
(original)
+++ development/main/depot/console/src/main/net/dpml/depot/lang/Main.java
Tue Jul 5 04:41:16 2005
@@ -155,12 +155,12 @@
}

boolean install = isFlagPresent( args, "-install" );
- if( install )
+ boolean remove = isFlagPresent( args, "-remove" );
+ if( install || remove )
{
System.setProperty( "java.util.logging.ConsoleHandler.level",
"SEVERE" );
}

-
try
{
//
@@ -200,7 +200,14 @@
{
args = consolidate( args, "-install" );
model = loadTransitModel( args, logger, false );
- profile = createInstallProfile( logger );
+ profile = createInstallProfile( logger, true );
+ break;
+ }
+ else if( arg.equals( "-remove" ) )
+ {
+ args = consolidate( args, "-remove" );
+ model = loadTransitModel( args, logger, false );
+ profile = createInstallProfile( logger, false );
break;
}
else if( arg.equals( "-profile" ) )
@@ -317,9 +324,13 @@

Artifact artifact = Artifact.createArtifact( uri );
String type = artifact.getType();
+ Properties params = profile.getProperties();
if( "plugin".equals( type ) )
{
- return loader.getPlugin( parent, uri, new Object[]{ args,
manager, model, logger, profile } );
+ return loader.getPlugin(
+ parent,
+ uri,
+ new Object[]{ args, manager, model, logger, profile, params }
);
}
else if( "part".equals( type ) )
{
@@ -358,7 +369,7 @@
log, id, title, null, command, null, uri, true, args );
}

- private static ApplicationProfile createInstallProfile( Logger logger )
throws Exception
+ private static ApplicationProfile createInstallProfile( Logger logger,
boolean install ) throws Exception
{
String id = "install";
Logger log = logger.getChildLogger( "install" );
@@ -368,6 +379,7 @@
boolean command = false;
Properties args = new Properties();
args.setProperty( "java.util.logging.ConsoleHandler.level", "SEVERE"
);
+ args.setProperty( "dpml.depot.install", "" + install );
return new DefaultApplicationProfile(
log, id, title, null, command, null, uri, true, args );
}
@@ -585,10 +597,17 @@
+ "\n\n -debug Enable debug level logging."
+ "\n -get [artifact] Load the supplied artifact to the cache."
+ "\n -help List command line help."
+ + "\n -install Launch the package installation manager."
+ "\n -prefs Start the DepotProfile preferences editor."
+ "\n -profile [name] Launch a named application."
+ "\n -reset Clear DepotProfile and Transit prefences."
- + "\n -version List DepotProfile version information.";
+ + "\n -version List DepotProfile version information."
+ + "\n"
+ + "\nNB: The -install option may be invoked with the argument
'magic' "
+ + "and 'metro'. This is equivalent to entering the installation
manager "
+ + "and requesting installation of the respective packages. The
-remove option "
+ + "is also recognized as an alias to the installion manager."
+ + "\n";
getLogger().info( message );
}


Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfile.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfile.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/ApplicationProfile.java
Tue Jul 5 04:41:16 2005
@@ -43,6 +43,10 @@

void setConnection( Connection connection ) throws RemoteException;

+ Properties getProperties() throws RemoteException;
+
+ void setProperties( Properties args ) throws RemoteException;
+
}



Modified:
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultApplicationProfile.java
==============================================================================
---
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultApplicationProfile.java
(original)
+++
development/main/depot/console/src/main/net/dpml/depot/profile/DefaultApplicationProfile.java
Tue Jul 5 04:41:16 2005
@@ -53,7 +53,15 @@
m_enabled = enabled;
m_connection = connection;
m_command = command;
- m_params = params;
+
+ if( null == params )
+ {
+ m_params = new Properties();
+ }
+ else
+ {
+ m_params = params;
+ }
}

public DefaultApplicationProfile( Logger logger, ApplicationStorage
store )

Modified:
development/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
==============================================================================
---
development/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
(original)
+++
development/main/depot/install/src/main/net/dpml/depot/install/PackageInstaller.java
Tue Jul 5 04:41:16 2005
@@ -21,6 +21,7 @@
import java.io.InputStreamReader;
import java.io.File;
import java.net.URL;
+import java.util.Properties;
import java.net.URISyntaxException;
import java.rmi.RemoteException;

@@ -50,6 +51,7 @@
private final TransitRegistryModel m_transit;
private final DepotProfile m_depot;
private final String[] m_args;
+ private final Properties m_properties;

private boolean m_continue = true;

@@ -65,13 +67,14 @@
* @param depot the profile application and activatable server registry
* @param args commandline args
*/
- public PackageInstaller( Logger logger, DepotProfile depot, String[]
args ) throws Exception
+ public PackageInstaller( Logger logger, DepotProfile depot, Properties
properties, String[] args ) throws Exception
{
super();

m_depot = depot;
m_logger = logger;
m_args = args;
+ m_properties = properties;

TransitStorageHome home = new TransitStorageHome();
m_transit = new DefaultTransitRegistryModel( logger, home );
@@ -79,16 +82,18 @@

public void run()
{
- //System.out.println( "INSTALL> " );
if( m_args.length > 0 )
{
if( m_args.length == 1 )
{
m_continue = false;
+
+ String flag = m_properties.getProperty(
"dpml.depot.install", "true" );
+ boolean isInstallation = "true".equals( flag );
String arg = m_args[0];
try
{
- processCommand( arg );
+ processCommand( isInstallation, arg );
}
catch( HandledException e )
{
@@ -130,7 +135,11 @@

private void processCommand( String command ) throws Exception
{
- System.out.println( "[" + command + "]" );
+ processCommand( true, command );
+ }
+
+ private void processCommand( boolean flag, String command ) throws
Exception
+ {
if( "exit".equals( command ) )
{
m_continue = false;
@@ -142,15 +151,20 @@
else if( command.startsWith( "install " ) )
{
String args = command.substring( "install ".length() );
- processInstallCommand( args );
+ processInstallCommand( true, args );
+ }
+ else if( command.startsWith( "remove " ) )
+ {
+ String args = command.substring( "remove ".length() );
+ processInstallCommand( false, args );
}
else if( "magic".equals( command ) )
{
- processInstallCommand( "magic" );
+ processInstallCommand( flag, "magic" );
}
else if( "metro".equals( command ) )
{
- processInstallCommand( "metro" );
+ processInstallCommand( flag, "metro" );
}
else if( "help".equals( command ) )
{
@@ -160,6 +174,9 @@
System.out.println( " install magic -- installs the magic
build system" );
System.out.println( " install metro -- installs the metro
container" );
System.out.println( " install [urn] -- installs an
application" );
+ System.out.println( " remove magic -- deinstall magic" );
+ System.out.println( " remove metro -- deinstall metro" );
+ System.out.println( " remove [urn] -- deinstalls an
application" );
System.out.println( " exit -- exit the manager" );
System.out.println( "\n" );
}
@@ -190,15 +207,15 @@
System.out.println( "" );
}

- private void processInstallCommand( String args ) throws Exception
+ private void processInstallCommand( boolean flag, String args ) throws
Exception
{
if( "magic".equals( args ) )
{
- processInstallCommand( "@MAGIC_BUNDLE_URI@" );
+ processInstallCommand( flag, "@MAGIC_BUNDLE_URI@" );
}
else if( "metro".equals( args ) )
{
- processInstallCommand( "@METRO_BUNDLE_URI@" );
+ processInstallCommand( flag, "@METRO_BUNDLE_URI@" );
}
else
{
@@ -206,7 +223,7 @@
String type = artifact.getType();
if( "zip".equals( type ) )
{
- installZipBundle( artifact );
+ installZipBundle( flag, artifact );
}
else
{
@@ -248,10 +265,17 @@
}
}

- private void installZipBundle( Artifact artifact ) throws Exception
+ private void installZipBundle( boolean flag, Artifact artifact ) throws
Exception
{
ZipInstaller installer = new ZipInstaller( m_logger, m_depot,
m_transit );
- installer.install( artifact );
+ if( flag )
+ {
+ installer.install( artifact );
+ }
+ else
+ {
+ installer.deinstall( artifact );
+ }
}


//--------------------------------------------------------------------------

Modified:
development/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
==============================================================================
---
development/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
(original)
+++
development/main/depot/install/src/main/net/dpml/depot/install/ZipInstaller.java
Tue Jul 5 04:41:16 2005
@@ -67,7 +67,8 @@
* of a target package via commandline instructions.
*
* @param logger the assigned logging channel
- * @param artifact the installable artifact
+ * @param depot the depot application registry
+ * @param transit the transit profile registry
*/
public ZipInstaller( Logger logger, DepotProfile depot,
TransitRegistryModel transit ) throws Exception
{
@@ -166,6 +167,11 @@
}
}
}
+
+ public void deinstall( Artifact artifact )
+ {
+ System.out.println( "\n WARNING: deinstallation service not
available in this version.\n" );
+ }

private void unpack( ZipFile zip ) throws Exception
{



  • svn commit: r2979 - in development/main/depot: console/src/main/net/dpml/depot/lang console/src/main/net/dpml/depot/profile install/src/main/net/dpml/depot/install, mcconnell, 07/05/2005

Archive powered by MHonArc 2.6.24.

Top of Page