rpms/azureus/F-11 azureus-no-update-manager-PluginInstallerImpl, NONE, 1.1

David Juran djuran at fedoraproject.org
Sat Sep 5 17:53:41 UTC 2009


Author: djuran

Update of /cvs/pkgs/rpms/azureus/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8299

Added Files:
	azureus-no-update-manager-PluginInstallerImpl 
Log Message:
adding missing patch



--- NEW FILE azureus-no-update-manager-PluginInstallerImpl ---
diff -up azureus-4.0.0.4/org/gudy/azureus2/pluginsimpl/local/installer/PluginInstallerImpl.java.no-update-manager-PluginInstallerImpl azureus-4.0.0.4/org/gudy/azureus2/pluginsimpl/local/installer/PluginInstallerImpl.java
--- azureus-4.0.0.4/org/gudy/azureus2/pluginsimpl/local/installer/PluginInstallerImpl.java.no-update-manager-PluginInstallerImpl	2008-09-25 14:32:04.000000000 +0300
+++ azureus-4.0.0.4/org/gudy/azureus2/pluginsimpl/local/installer/PluginInstallerImpl.java	2009-09-05 19:18:15.000000000 +0300
@@ -376,87 +376,87 @@ PluginInstallerImpl
 	{
 		PluginUpdatePlugin	pup = (PluginUpdatePlugin)manager.getPluginInterfaceByClass( PluginUpdatePlugin.class ).getPlugin();
 		
-		UpdateManagerImpl	uman = (UpdateManagerImpl)manager.getDefaultPluginInterface().getUpdateManager();
+// 		UpdateManagerImpl	uman = (UpdateManagerImpl)manager.getDefaultPluginInterface().getUpdateManager();
 		
-		UpdateCheckInstance	inst = 
-			uman.createEmptyUpdateCheckInstance( 
-					UpdateCheckInstance.UCI_INSTALL,
-					"update.instance.install",
-					low_noise );
-		
-		if ( listener != null ){
-			
-			inst.addListener(
-				new UpdateCheckInstanceListener()
-				{
-					public void
-					cancelled(
-						UpdateCheckInstance		instance )
-					{
-						listener.failed( new PluginException( "Installation cancelled" ));
-					}
-					
-					public void
-					complete(
-						UpdateCheckInstance		instance )
-					{
-						final Update[] updates = instance.getUpdates();
+// 		UpdateCheckInstance	inst = 
+// 			uman.createEmptyUpdateCheckInstance( 
+// 					UpdateCheckInstance.UCI_INSTALL,
+// 					"update.instance.install",
+// 					low_noise );
+		
+// 		if ( listener != null ){
+			
+// 			inst.addListener(
+// 				new UpdateCheckInstanceListener()
+// 				{
+// 					public void
+// 					cancelled(
+// 						UpdateCheckInstance		instance )
+// 					{
+// 						listener.failed( new PluginException( "Installation cancelled" ));
+// 					}
+					
+// 					public void
+// 					complete(
+// 						UpdateCheckInstance		instance )
+// 					{
+// 						final Update[] updates = instance.getUpdates();
 						
-						if ( updates.length == 0 ){
+// 						if ( updates.length == 0 ){
 														
-							listener.failed( new PluginException( "No updates were added during check process" ));
+// 							listener.failed( new PluginException( "No updates were added during check process" ));
 							
-						}else{
+// 						}else{
 							
-							for (int i=0;i<updates.length;i++){
+// 							for (int i=0;i<updates.length;i++){
 								
-								updates[i].addListener(
-									new UpdateListener()
-									{
-										private boolean	cancelled;
+// 								updates[i].addListener(
+// 									new UpdateListener()
+// 									{
+// 										private boolean	cancelled;
 										
-										public void 
-										cancelled(
-											Update update) 
-										{
-											cancelled = true;
+// 										public void 
+// 										cancelled(
+// 											Update update) 
+// 										{
+// 											cancelled = true;
 											
-											check();
-										}
+// 											check();
+// 										}
 										
-										public void 
-										complete(
-											Update update ) 
-										{
-											check();
-										}
+// 										public void 
+// 										complete(
+// 											Update update ) 
+// 										{
+// 											check();
+// 										}
 										
-										protected void
-										check()
-										{
-											for (int i=0;i<updates.length;i++){
+// 										protected void
+// 										check()
+// 										{
+// 											for (int i=0;i<updates.length;i++){
 												
-												if ( !updates[i].isCancelled() && !updates[i].isComplete()){
+// 												if ( !updates[i].isCancelled() && !updates[i].isComplete()){
 													
-													return;
-												}
-											}
+// 													return;
+// 												}
+// 											}
 											
-											if ( cancelled ){
+// 											if ( cancelled ){
 												
-												listener.failed( new PluginException( "Installation cancelled" ));
+// 												listener.failed( new PluginException( "Installation cancelled" ));
 												
-											}else{
+// 											}else{
 												
-												listener.done();
-											}
-										}
-									});
-							}
-						}
-					}
-				});
-		}
+// 												listener.done();
+// 											}
+// 										}
+// 									});
+// 							}
+// 						}
+// 					}
+// 				});
+// 		}
 		
 		try{
 			
@@ -522,56 +522,52 @@ PluginInstallerImpl
 				
 					final PluginInterface dummy_plugin_interface = manager.getPluginInterfaceByID( plugin_id, false );
 					
-					((InstallablePluginImpl)plugin).addUpdate( inst, pup, dummy_plugin, dummy_plugin_interface );
+// 					((InstallablePluginImpl)plugin).addUpdate( inst, pup, dummy_plugin, dummy_plugin_interface );
 							
-					inst.addListener(
-						new UpdateCheckInstanceListener()
-						{
-							public void
-							cancelled(
-								UpdateCheckInstance		instance )
-							{
-								try{
+// 					inst.addListener(
+// 						new UpdateCheckInstanceListener()
+// 						{
+// 							public void
+// 							cancelled(
+// 								UpdateCheckInstance		instance )
+// 							{
+// 								try{
 								
-									dummy_plugin_interface.getPluginState().unload();
+// 									dummy_plugin_interface.getPluginState().unload();
 									
-								}catch( Throwable e ){
+// 								}catch( Throwable e ){
 									
-									Debug.out( "Failed to unload plugin", e );
-								}
-							}
+// 									Debug.out( "Failed to unload plugin", e );
+// 								}
+// 							}
 							
-							public void
-							complete(
-								UpdateCheckInstance		instance )
-							{
-								PluginInterface pi = manager.getPluginInterfaceByID( plugin_id, false );
+// 							public void
+// 							complete(
+// 								UpdateCheckInstance		instance )
+// 							{
+// 								PluginInterface pi = manager.getPluginInterfaceByID( plugin_id, false );
 								
-								if ( pi != null && pi.getPlugin() instanceof FailedPlugin ){
+// 								if ( pi != null && pi.getPlugin() instanceof FailedPlugin ){
 									
-									try{
-										pi.getPluginState().unload();
+// 									try{
+// 										pi.getPluginState().unload();
 										
-									}catch( Throwable e ){
+// 									}catch( Throwable e ){
 										
-										Debug.out( "Failed to unload plugin", e );
-									}
-								}
+// 										Debug.out( "Failed to unload plugin", e );
+// 									}
+// 								}
 
-							}
-						});
-				}else{
+// 							}
+// 						});
+// 				}else{
 					
-					((InstallablePluginImpl)plugin).addUpdate( inst, pup, existing_plugin, existing_plugin_interface );
+// 					((InstallablePluginImpl)plugin).addUpdate( inst, pup, existing_plugin, existing_plugin_interface );
 				}
 			}
 		
-			inst.start();
-			
 		}catch( Throwable e ){
 			
-			inst.cancel();
-			
 			if ( e instanceof PluginException ){
 				
 				throw((PluginException)e);
@@ -635,138 +631,138 @@ PluginInstallerImpl
 			}
 		}
 		
-		try{
-			UpdateManager	uman = manager.getDefaultPluginInterface().getUpdateManager();
+// 		try{
+// 			UpdateManager	uman = manager.getDefaultPluginInterface().getUpdateManager();
 			
-			UpdateCheckInstance	inst = 
-				uman.createEmptyUpdateCheckInstance(
-						UpdateCheckInstance.UCI_UNINSTALL,
-						"update.instance.uninstall");
+// 			UpdateCheckInstance	inst = 
+// 				uman.createEmptyUpdateCheckInstance(
+// 						UpdateCheckInstance.UCI_UNINSTALL,
+// 						"update.instance.uninstall");
 
-			for (int i=0;i<pis.length;i++){
+// 			for (int i=0;i<pis.length;i++){
 				
-				final PluginInterface	pi = pis[i];
+// 				final PluginInterface	pi = pis[i];
 				
-				final String	plugin_dir = pi.getPluginDirectoryName();
+// 				final String	plugin_dir = pi.getPluginDirectoryName();
 
-				inst.addUpdatableComponent(
-					new UpdatableComponent()
-					{
-						public String
-						getName()
-						{
-							return( pi.getPluginName());
-						}
-					
-						public int
-						getMaximumCheckTime()
-						{
-							return( 0 );
-						}
+// 				inst.addUpdatableComponent(
+// 					new UpdatableComponent()
+// 					{
+// 						public String
+// 						getName()
+// 						{
+// 							return( pi.getPluginName());
+// 						}
+					
+// 						public int
+// 						getMaximumCheckTime()
+// 						{
+// 							return( 0 );
+// 						}
 						
-						public void
-						checkForUpdate(
-							final UpdateChecker	checker )
-						{
-							try{
-								ResourceDownloader rd = 
-									manager.getDefaultPluginInterface().getUtilities().getResourceDownloaderFactory().create( new File( plugin_dir ));
+// 						public void
+// 						checkForUpdate(
+// 							final UpdateChecker	checker )
+// 						{
+// 							try{
+// 								ResourceDownloader rd = 
+// 									manager.getDefaultPluginInterface().getUtilities().getResourceDownloaderFactory().create( new File( plugin_dir ));
 								
-								rd.addListener(
-									new ResourceDownloaderAdapter()
-									{
-										public boolean
-										completed(
-											ResourceDownloader	downloader,
-											InputStream			data )
-										{
-											try{
-												if ( pi.getPluginState().isUnloadable()){
+// 								rd.addListener(
+// 									new ResourceDownloaderAdapter()
+// 									{
+// 										public boolean
+// 										completed(
+// 											ResourceDownloader	downloader,
+// 											InputStream			data )
+// 										{
+// 											try{
+// 												if ( pi.getPluginState().isUnloadable()){
 											
-													pi.getPluginState().unload();
+// 													pi.getPluginState().unload();
 													
-													FileUtil.recursiveDelete( new File( plugin_dir ));
+// 													FileUtil.recursiveDelete( new File( plugin_dir ));
 												
-												}
+// 												}
 																
-												UpdateInstaller installer = checker.createInstaller();
+// 												UpdateInstaller installer = checker.createInstaller();
 													
-												installer.addRemoveAction( new File( plugin_dir ).getCanonicalPath());
+// 												installer.addRemoveAction( new File( plugin_dir ).getCanonicalPath());
 											
 												
-											}catch( Throwable e ){
+// 											}catch( Throwable e ){
 												
-												Debug.printStackTrace(e);
-												Logger.log(new LogAlert(LogAlert.REPEATABLE,
-														"Plugin uninstall failed", e));
-											}
+// 												Debug.printStackTrace(e);
+// 												Logger.log(new LogAlert(LogAlert.REPEATABLE,
+// 														"Plugin uninstall failed", e));
+// 											}
 											
-												// don't close the stream as we process it later
+// 												// don't close the stream as we process it later
 												
-											return( true );
-										}
+// 											return( true );
+// 										}
 										
-										public void
-										failed(
-											ResourceDownloader			downloader,
-											ResourceDownloaderException e )
-										{
-											if ( !downloader.isCancelled()){
-												Logger.log(new LogAlert(LogAlert.REPEATABLE,
-														"Plugin uninstall failed", e));
-											}
-										}
-									});
+// 										public void
+// 										failed(
+// 											ResourceDownloader			downloader,
+// 											ResourceDownloaderException e )
+// 										{
+// 											if ( !downloader.isCancelled()){
+// 												Logger.log(new LogAlert(LogAlert.REPEATABLE,
+// 														"Plugin uninstall failed", e));
+// 											}
+// 										}
+// 									});
 	
-									// the plugin may have > 1 plugin interfaces, make the name up appropriately
+// 									// the plugin may have > 1 plugin interfaces, make the name up appropriately
 								
-								String	update_name = "";
+// 								String	update_name = "";
 									
-								PluginInterface[]	ifs = manager.getPluginInterfaces();
+// 								PluginInterface[]	ifs = manager.getPluginInterfaces();
 								
-							    Arrays.sort( 
-							    		ifs,
-									  	new Comparator()
-										{
-								      		public int 
-											compare(
-												Object o1, 
-												Object o2)
-								      		{
-								      			return(((PluginInterface)o1).getPluginName().compareTo(((PluginInterface)o2).getPluginName()));
-								      		}
-										});
+// 							    Arrays.sort( 
+// 							    		ifs,
+// 									  	new Comparator()
+// 										{
+// 								      		public int 
+// 											compare(
+// 												Object o1, 
+// 												Object o2)
+// 								      		{
+// 								      			return(((PluginInterface)o1).getPluginName().compareTo(((PluginInterface)o2).getPluginName()));
+// 								      		}
+// 										});
 							    
-								for (int i=0;i<ifs.length;i++){
+// 								for (int i=0;i<ifs.length;i++){
 									
-									if ( ifs[i].getPluginID().equals(pi.getPluginID())){
+// 									if ( ifs[i].getPluginID().equals(pi.getPluginID())){
 									
-										update_name += (update_name.length()==0?"":",") + ifs[i].getPluginName();
-									}
-								}
+// 										update_name += (update_name.length()==0?"":",") + ifs[i].getPluginName();
+// 									}
+// 								}
 								
-								checker.addUpdate(
-									update_name,
-									new String[]{ "Uninstall: " + plugin_dir},
-									pi.getPluginVersion(),
-									rd,
-									pi.getPluginState().isUnloadable()?Update.RESTART_REQUIRED_NO:Update.RESTART_REQUIRED_YES );
+// 								checker.addUpdate(
+// 									update_name,
+// 									new String[]{ "Uninstall: " + plugin_dir},
+// 									pi.getPluginVersion(),
+// 									rd,
+// 									pi.getPluginState().isUnloadable()?Update.RESTART_REQUIRED_NO:Update.RESTART_REQUIRED_YES );
 									
-							}finally{
+// 							}finally{
 								
-								checker.completed();
-							}
+// 								checker.completed();
+// 							}
 								
-						}
-					}, false );
-			}
+// 						}
+// 					}, false );
+// 			}
 
-			inst.start();
+// 			inst.start();
 			
-		}catch( Throwable e ){
+// 		}catch( Throwable e ){
 			
-			Debug.printStackTrace(e);
-		}
+// 			Debug.printStackTrace(e);
+// 		}
 	}
 	
 	protected PluginInterface




More information about the fedora-extras-commits mailing list