[SCM] Azureus/Vuze packaging for Debian branch, master, updated. debian/4.2.0.8-1-3-gbbbeafe

Adrian Perez adrianperez-guest at alioth.debian.org
Mon Sep 21 18:34:53 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Azureus/Vuze packaging for Debian".

The branch, master has been updated
       via  bbbeafe4dd078e6146e9572fa7ecce2c32e4be66 (commit)
      from  6119bcccd45c22db2420fe4d7b38e574d2bb23c3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bbbeafe4dd078e6146e9572fa7ecce2c32e4be66
Author: Adrian Perez <adrianperez.deb at gmail.com>
Date:   Mon Sep 21 14:02:11 2009 -0400

    Release 4.2.0.8-2 to unstable

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                          |   12 +
 debian/patches/debian/update-disable.diff |    2 +-
 debian/patches/fixes/encoding.diff        |    2 +-
 debian/patches/fixes/utf8-encoding.diff   |  388 +++++++++++++++++++++++++++++
 debian/patches/series                     |    1 +
 5 files changed, 403 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index fd0d6b2..727c1b0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+azureus (4.2.0.8-2) unstable; urgency=low
+
+  * Fix filename encoding UTF8 issues. Closes: #502879.
+    Thanks: Arron Mogge (TuxPaper).
+  * debian/vuze.desktop:
+    - Improve Comment for Vuze description.
+    - Fix typo in GenericName.
+  * debian/control:
+    - Clean Vcs-Browser URL in control file.
+
+ -- Adrian Perez <adrianperez.deb at gmail.com>  Mon, 21 Sep 2009 11:58:33 -0400
+
 azureus (4.2.0.8-1) unstable; urgency=low
 
   * New upstream release.
diff --git a/debian/patches/debian/update-disable.diff b/debian/patches/debian/update-disable.diff
index 23cc3d1..c3bc98b 100644
--- a/debian/patches/debian/update-disable.diff
+++ b/debian/patches/debian/update-disable.diff
@@ -111,4 +111,4 @@ index c1ade9d..7907dc9 100644
  	
  	public String
 -- 
-tg: (25674b0..) debian/update-disable (depends on: master)
+tg: (25674b0..) debian/update-disable (depends on: upstream)
diff --git a/debian/patches/fixes/encoding.diff b/debian/patches/fixes/encoding.diff
index 7b85eed..e65de97 100644
--- a/debian/patches/fixes/encoding.diff
+++ b/debian/patches/fixes/encoding.diff
@@ -4,7 +4,7 @@ Reviewed-by: Adrian Perez <adrianperez.deb at gmail.com>
 Bug-Debian: http://bugs.debian.org/492800
 Last-Update: 2009-07-29
 Description: remove non-UTF8 characters to fix month translation
- in DateParserRegex.java.
+in DateParserRegex.java.
 
 ---
  .../core/metasearch/impl/DateParserRegex.java      |    8 ++++----
diff --git a/debian/patches/fixes/utf8-encoding.diff b/debian/patches/fixes/utf8-encoding.diff
new file mode 100644
index 0000000..169b17f
--- /dev/null
+++ b/debian/patches/fixes/utf8-encoding.diff
@@ -0,0 +1,388 @@
+Author: Arron Mogge <tuxpaper at users.sourceforge.net>
+Bug: https://jira.vuze.com/browse/SUP-18
+Bug-Debian: http://bugs.debian.org/502879
+Origin: https://jira.vuze.com/secure/attachment/12798/utf8torrents.patch
+Reviewed-by: Adrian Perez <adrianperez.deb at gmail.com>
+Last-Update: 2009-09-21
+Description: Fix issue when decoding UTF-8 from torrent filenames which causes
+some files to not be displayed properly.
+
+---
+ org/gudy/azureus2/core3/torrent/TOTorrent.java     |    2 +
+ .../torrent/impl/TOTorrentDeserialiseImpl.java     |   49 ++++++++-
+ .../core3/torrent/impl/TOTorrentFileImpl.java      |  118 +++++++++++++++++++-
+ .../azureus2/core3/torrent/impl/TOTorrentImpl.java |   47 ++------
+ 4 files changed, 170 insertions(+), 46 deletions(-)
+
+diff --git a/org/gudy/azureus2/core3/torrent/TOTorrent.java b/org/gudy/azureus2/core3/torrent/TOTorrent.java
+index df5c21d..d9760e2 100644
+--- a/org/gudy/azureus2/core3/torrent/TOTorrent.java
++++ b/org/gudy/azureus2/core3/torrent/TOTorrent.java
+@@ -44,6 +44,8 @@ TOTorrent
+ 		 */
+ 	
+ 	public static final String	AZUREUS_PRIVATE_PROPERTIES		= "azureus_private_properties";
++
++	public static final String ENCODING_ACTUALLY_UTF8_KEYS = "utf8 keys";
+ 	
+ 	/**
+ 	 * Get the name of the torrent
+diff --git a/org/gudy/azureus2/core3/torrent/impl/TOTorrentDeserialiseImpl.java b/org/gudy/azureus2/core3/torrent/impl/TOTorrentDeserialiseImpl.java
+index 510d2ce..259043d 100644
+--- a/org/gudy/azureus2/core3/torrent/impl/TOTorrentDeserialiseImpl.java
++++ b/org/gudy/azureus2/core3/torrent/impl/TOTorrentDeserialiseImpl.java
+@@ -466,7 +466,9 @@ TOTorrentDeserialiseImpl
+ 				throw( new TOTorrentException( "Decode fails, 'info' element not found'",
+ 												TOTorrentException.RT_DECODE_FAILS ));
+ 			}
+-		
++	
++			boolean hasUTF8Keys = info.containsKey(TK_NAME_UTF8);
++	
+ 			setName((byte[])info.get( TK_NAME ));
+ 				
+ 			long	piece_length = ((Long)info.get( TK_PIECE_LENGTH )).longValue();
+@@ -484,12 +486,20 @@ TOTorrentDeserialiseImpl
+ 			Long simple_file_length = (Long)info.get( TK_LENGTH );
+ 			
+ 			long	total_length = 0;
++
++			String encoding = getAdditionalStringProperty("encoding");
++			hasUTF8Keys &= encoding == null || encoding.equals(ENCODING_ACTUALLY_UTF8_KEYS);
+ 			
+ 			if ( simple_file_length != null ){
+ 			
+ 				setSimpleTorrent( true );
+ 				
+ 				total_length = simple_file_length.longValue();
++
++				if (hasUTF8Keys) {
++					setNameUTF8((byte[])info.get( TK_NAME_UTF8 ));
++					setAdditionalStringProperty("encoding", ENCODING_ACTUALLY_UTF8_KEYS);
++				}
+ 				
+ 				setFiles( new TOTorrentFileImpl[]{ new TOTorrentFileImpl( this, 0, total_length, new byte[][]{getName()})});
+ 				
+@@ -500,7 +510,23 @@ TOTorrentDeserialiseImpl
+ 				List	meta_files = (List)info.get( TK_FILES );
+ 			
+ 				TOTorrentFileImpl[] files = new TOTorrentFileImpl[ meta_files.size()];
+-			
++
++				if (hasUTF8Keys) {
++				for (int i=0;i<files.length;i++){
++	                        	Map file_map = (Map)meta_files.get(i);
++                                
++	                               	hasUTF8Keys &= file_map.containsKey(TK_PATH_UTF8);
++	                        	if (!hasUTF8Keys) {
++	                                	break;
++	                        	}
++	                        }
++
++				if (hasUTF8Keys) {
++					setNameUTF8((byte[])info.get( TK_NAME_UTF8 ));
++					setAdditionalStringProperty("encoding", ENCODING_ACTUALLY_UTF8_KEYS);
++				}	
++				}
++
+ 				for (int i=0;i<files.length;i++){
+ 					
+ 					Map	file_map = (Map)meta_files.get(i);
+@@ -508,6 +534,8 @@ TOTorrentDeserialiseImpl
+ 					long	len = ((Long)file_map.get( TK_LENGTH )).longValue();
+ 					
+ 					List	paths = (List)file_map.get( TK_PATH );
++
++					List	paths8 = (List)file_map.get( TK_PATH_UTF8 );
+ 						
+ 					byte[][]	path_comps = new byte[paths.size()][];
+ 					
+@@ -516,8 +544,20 @@ TOTorrentDeserialiseImpl
+ 						path_comps[j] = (byte[])paths.get(j);
+ 					}
+ 					
+-					TOTorrentFileImpl file = files[i] = new TOTorrentFileImpl( this, total_length, len, path_comps );
++					TOTorrentFileImpl file;
+ 					
++					if (hasUTF8Keys) {
++					byte[][]	path_comps8 = new byte[paths8.size()][];
++
++					for (int j=0;j<paths8.size();j++) {
++						
++						path_comps8[j] = (byte[])paths8.get(j);
++					}
++
++						file = files[i] = new TOTorrentFileImpl( this, total_length, len, path_comps, path_comps8 );
++					} else {
++						file = files[i] = new TOTorrentFileImpl( this, total_length, len, path_comps );
++					}
+ 					total_length += len;
+ 					
+ 						// preserve any non-standard attributes
+@@ -532,6 +572,7 @@ TOTorrentDeserialiseImpl
+ 								key.equals( TK_PATH )){
+ 									
+ 							// standard
++							// we don't skip TK_PATH_UTF8 because some code might assume getAdditionalProperty can get it
+ 						}else{
+ 							
+ 							file.setAdditionalProperty( key, file_map.get( key ));
+@@ -742,4 +783,4 @@ TOTorrentDeserialiseImpl
+ 			System.out.println( indent + name + "{byte[], length " + value.length + "}" );
+ 		}
+ 	}
+-}
+\ No newline at end of file
++}
+diff --git a/org/gudy/azureus2/core3/torrent/impl/TOTorrentFileImpl.java b/org/gudy/azureus2/core3/torrent/impl/TOTorrentFileImpl.java
+index 85d9359..a29fb4d 100644
+--- a/org/gudy/azureus2/core3/torrent/impl/TOTorrentFileImpl.java
++++ b/org/gudy/azureus2/core3/torrent/impl/TOTorrentFileImpl.java
+@@ -36,6 +36,7 @@ TOTorrentFileImpl
+ 	private final TOTorrent	torrent;
+ 	private final long		file_length;
+ 	private final byte[][]	path_components;
++	private final byte[][]	path_components_utf8;
+ 	
+ 	private final int		first_piece_number;
+ 	private final int		last_piece_number;
+@@ -87,6 +88,10 @@ TOTorrentFileImpl
+ 			path_components		= new byte[temp.size()][];
+ 			
+ 			temp.copyInto( path_components );
++
++			path_components_utf8 		= new byte[temp.size()][];
++
++			temp.copyInto( path_components_utf8 );
+ 			
+ 			checkComponents();
+ 			
+@@ -109,6 +114,31 @@ TOTorrentFileImpl
+ 		torrent				= _torrent;
+ 		file_length			= _len;
+ 		path_components		= _path_components;
++		path_components_utf8 = null;
++
++		first_piece_number 	= (int)( _torrent_offset / torrent.getPieceLength());
++		last_piece_number       = (int)(( _torrent_offset + file_length - 1 ) /  torrent.getPieceLength());
++
++		is_utf8                         = false;
++
++		checkComponents();
++	}
++
++	protected
++	TOTorrentFileImpl(
++		TOTorrent	_torrent,
++		long		_torrent_offset,
++		long		_len,
++		byte[][]	_path_components,
++		byte[][]	_path_components_utf8 )
++
++		throws TOTorrentException
++	{
++		torrent                         = _torrent;
++		file_length                     = _len;
++		path_components         = _path_components;
++		path_components_utf8 = _path_components_utf8;
++
+ 		
+ 		first_piece_number 	= (int)( _torrent_offset / torrent.getPieceLength());
+ 		last_piece_number	= (int)(( _torrent_offset + file_length - 1 ) /  torrent.getPieceLength());
+@@ -148,10 +178,24 @@ TOTorrentFileImpl
+ 	}
+ 	
+ 	public byte[][]
+-	getPathComponents()
++	getPathComponentsBasic()
+ 	{
+ 		return( path_components );
+ 	}
++
++	public byte[][]
++	getPathComponents()
++	{
++		return path_components_utf8 == null ? path_components : path_components_utf8;
++	}
++
++	public byte[][]
++	getPathComponentsUTF8()
++	{
++		return( path_components_utf8 );
++	}
++
++
+ 	
+ 	protected boolean
+ 	isUTF8()
+@@ -208,22 +252,23 @@ TOTorrentFileImpl
+ 		}
+ 
+ 		if (decoder != null) {
+-			for (int j = 0; j < path_components.length; j++) {
++			byte[][] components = getPathComponents();
++			for (int j = 0; j < components.length; j++) {
+ 
+ 				try {
+ 					String comp;
+ 					try {
+-						comp = decoder.decodeString(path_components[j]);
++						comp = decoder.decodeString(components[j]);
+ 					} catch (UnsupportedEncodingException e) {
+ 						System.out.println("file - unsupported encoding!!!!");
+ 						try {
+-							comp = new String(path_components[j]);
++							comp = new String(components[j]);
+ 						} catch (Exception e2) {
+ 							comp = "UnsupportedEncoding";
+ 						}
+ 					}
+ 	
+-					comp = FileUtil.convertOSSpecificChars(comp, j != path_components.length-1 );
++					comp = FileUtil.convertOSSpecificChars(comp, j != components.length-1 );
+ 	
+ 					sRelativePath += (j == 0 ? "" : File.separator) + comp;
+ 				} catch (Exception ex) {
+@@ -235,4 +280,67 @@ TOTorrentFileImpl
+ 		}
+ 		return sRelativePath;
+ 	}
++
++	/**
++	 * @return
++	 * 
++	 * @since 4.1.0.5
++	 */
++	public Map serializeToMap() {
++		Map	file_map = new HashMap();
++		
++		file_map.put( TOTorrentImpl.TK_LENGTH, new Long( getLength()));
++
++		List path = new ArrayList();
++		
++		file_map.put ( TOTorrentImpl.TK_PATH, path );
++		
++		byte[][] 	path_comps = getPathComponentsBasic();
++
++		for (int j=0;j<path_comps.length;j++) {
++			
++			path.add( path_comps[j] );
++		}
++
++		if ( isUTF8()) {
++			List utf8_path = new ArrayList();
++			
++			file_map.put( TOTorrentImpl.TK_PATH_UTF8, utf8_path );
++			
++			for (int j=0;j<path_comps.length;j++){
++				
++				utf8_path.add( path_comps[j]);
++			}
++		} else {
++			
++			byte[][]        utf8_path_comps = getPathComponentsUTF8();
++			
++			if (utf8_path_comps != null) {
++			List utf8_path = new ArrayList();
++
++			file_map.put( TOTorrentImpl.TK_PATH_UTF8, utf8_path );
++
++			for (int j=0;j<utf8_path_comps.length;j++){ 
++				
++				utf8_path.add( utf8_path_comps[j]);
++			}
++			}
++		}
++
++		Map file_additional_properties = getAdditionalProperties();
++
++		Iterator prop_it = file_additional_properties.keySet().iterator();
++
++		while( prop_it.hasNext()){
++
++			String  key = (String)prop_it.next();
++
++			file_map.put( key, file_additional_properties.get( key ));
++		}
++	
++		return file_map;
++	}
++			
+ }
++
++
+diff --git a/org/gudy/azureus2/core3/torrent/impl/TOTorrentImpl.java b/org/gudy/azureus2/core3/torrent/impl/TOTorrentImpl.java
+index 1fb54dd..676244d 100644
+--- a/org/gudy/azureus2/core3/torrent/impl/TOTorrentImpl.java
++++ b/org/gudy/azureus2/core3/torrent/impl/TOTorrentImpl.java
+@@ -409,45 +409,10 @@ TOTorrentImpl
+ 				
+ 				TOTorrentFileImpl	file	= files[i];
+ 				
+-				Map	file_map = new HashMap();
++				Map	file_map = file.serializeToMap();
+ 		
+ 				meta_files.add( file_map );
+ 				
+-				file_map.put( TK_LENGTH, new Long( file.getLength()));
+-				
+-				List path = new ArrayList();
+-				
+-				file_map.put( TK_PATH, path );
+-				
+-				byte[][]	path_comps = file.getPathComponents();
+-				
+-				for (int j=0;j<path_comps.length;j++){
+-					
+-					path.add( path_comps[j]);
+-				}
+-				
+-				if ( file.isUTF8()){
+-					
+-					List utf8_path = new ArrayList();
+-					
+-					file_map.put( TK_PATH_UTF8, utf8_path );
+-										
+-					for (int j=0;j<path_comps.length;j++){
+-						
+-						utf8_path.add( path_comps[j]);
+-					}
+-				}
+-				
+-				Map file_additional_properties = file.getAdditionalProperties();
+-				
+-				Iterator prop_it = file_additional_properties.keySet().iterator();
+-				
+-				while( prop_it.hasNext()){
+-					
+-					String	key = (String)prop_it.next();
+-					
+-					file_map.put( key, file_additional_properties.get( key ));
+-				}
+ 			}
+ 		}
+ 		
+@@ -505,6 +470,14 @@ TOTorrentImpl
+ 	{
+ 		torrent_name	= _name;
+ 	}
++
++	protected void
++	setNameUTF8(
++		byte[] _name)
++	{
++		torrent_name_utf8	= _name;
++	}
++		
+ 	
+ 	public boolean
+ 	isSimpleTorrent()
+@@ -1264,4 +1237,4 @@ TOTorrentImpl
+ 
+ 		return null;
+ 	}
+-}
+\ No newline at end of file
++}
+-- 
+tg: (320870a..) fixes/utf8-encoding (depends on: upstream)
diff --git a/debian/patches/series b/debian/patches/series
index 095156b..dbf34cd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ fixes/encoding.diff -p1
 fixes/multiuser.diff -p1
 fixes/platform.diff -p1
 fixes/sunsecurity.diff -p1
+fixes/utf8-encoding.diff -p1


hooks/post-receive
-- 
Azureus/Vuze packaging for Debian



More information about the pkg-java-commits mailing list