Mailinglist Archive: opensuse-commit (875 mails)

< Previous Next >
commit beagle
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Tue, 08 Jul 2008 16:23:27 +0200
  • Message-id: <20080708142327.77075678178@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package beagle
checked in at Tue Jul 8 16:23:27 CEST 2008.


--------
--- GNOME/beagle/beagle.changes 2008-06-27 22:50:13.000000000 +0200
+++ beagle/beagle.changes 2008-07-01 07:36:13.401735000 +0200
@@ -1,0 +2,8 @@
+Tue Jul 1 07:38:15 CEST 2008 - pwu@xxxxxxx
+
+- Add beagle-urifu-add-number-sign-unescaped.patch and
+ beagle-add-number-sign.patch from upstream:
+ http://bugzilla.gnome.org/show_bug.cgi?id=535020.
+ Avoid to escape '#' in uri to %23 (bnc #372186).
+
+-------------------------------------------------------------------



New:
----
beagle-add-number-sign.patch
beagle-urifu-add-number-sign-unescaped.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ beagle.spec ++++++
--- /var/tmp/diff_new_pack.Do6976/_old 2008-07-08 16:19:28.000000000 +0200
+++ /var/tmp/diff_new_pack.Do6976/_new 2008-07-08 16:19:28.000000000 +0200
@@ -19,7 +19,7 @@
Group: Productivity/Other
AutoReqProv: on
Version: 0.3.7
-Release: 26
+Release: 30
Summary: Desktop Search Application
Url: http://beagle-project.org
Source: %{name}-%{version}.tar.bz2
@@ -38,6 +38,9 @@
Patch11: beagle-firefox-error.patch
# PATCH-FIX-UPSTREAM beagle-new-camel-bindings.patch maw@xxxxxxxxxx -- See
http://mail.gnome.org/archives/svn-commits-list/2008-April/msg06080.html; this
will go away in a future release
Patch12: beagle-new-camel-bindings.patch
+# PATCH-FIX-UPSTREAM beagle-urifu-add-number-sign-unescaped.patch and
beagle-add-number-sign.patch pwu@xxxxxxxxxx -- see
http://bugzilla.gnome.org/show_bug.cgi?id=535020
+Patch13: beagle-urifu-add-number-sign-unescaped.patch
+Patch14: beagle-add-number-sign.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: /usr/sbin/groupadd /usr/sbin/useradd /bin/rm
Requires: mono-core >= 1.1.13.5
@@ -424,6 +427,8 @@
%patch10
%patch11
%patch12
+%patch13 -p1
+%patch14 -p1

%build
intltoolize --copy --force --automake
@@ -588,6 +593,11 @@
%{prefix}/lib/monodoc/sources/beagle-docs.*

%changelog
+* Tue Jul 01 2008 pwu@xxxxxxx
+- Add beagle-urifu-add-number-sign-unescaped.patch and
+ beagle-add-number-sign.patch from upstream:
+ http://bugzilla.gnome.org/show_bug.cgi?id=535020.
+ Avoid to escape '#' in uri to %%23 (bnc #372186).
* Sat Jun 28 2008 maw@xxxxxxx
- Add beagle-new-camel-bindings.patch to deal with changes
in evolution-sharp's API.

++++++ beagle-add-number-sign.patch ++++++
Index: beagle-0.3.7/beagled/IndexHelper/IndexHelper.cs
===================================================================
--- beagle-0.3.7.orig/beagled/IndexHelper/IndexHelper.cs
+++ beagle-0.3.7/beagled/IndexHelper/IndexHelper.cs
@@ -160,12 +160,14 @@ namespace Beagle.IndexHelper {
// Whether we should generate heap-shot
snapshots
heap_shot = (Environment.GetEnvironmentVariable
("_HEY_LETS_DO_A_HEAP_SHOT") != null);

- // Start the monitor thread, which keeps an eye
on memory usage and idle time.
- ExceptionHandlingThread.Start (new ThreadStart
(MemoryAndIdleMonitorWorker));
+ if (! run_by_hand) {
+ // Start the monitor thread, which
keeps an eye on memory usage and idle time.
+ ExceptionHandlingThread.Start (new
ThreadStart (MemoryAndIdleMonitorWorker));

- // Start a thread that watches the daemon and
begins a shutdown
- // if it terminates.
- ExceptionHandlingThread.Start (new ThreadStart
(DaemonMonitorWorker));
+ // Start a thread that watches the
daemon and begins a shutdown
+ // if it terminates.
+ ExceptionHandlingThread.Start (new
ThreadStart (DaemonMonitorWorker));
+ }

// Start the main loop
main_loop.Run ();
Index: beagle-0.3.7/beagled/IndexHelper/RemoteIndexerExecutor.cs
===================================================================
--- beagle-0.3.7.orig/beagled/IndexHelper/RemoteIndexerExecutor.cs
+++ beagle-0.3.7/beagled/IndexHelper/RemoteIndexerExecutor.cs
@@ -43,8 +43,6 @@ namespace Beagle.IndexHelper {
static public int Count = 0;
static Hashtable indexer_table = new Hashtable ();

- Indexable[] child_indexables;
-
public override ResponseMessage Execute (RequestMessage
raw_request)
{
RemoteIndexerRequest remote_request =
(RemoteIndexerRequest) raw_request;
Index: beagle-0.3.7/Filters/FilterDocbook.cs
===================================================================
--- beagle-0.3.7.orig/Filters/FilterDocbook.cs
+++ beagle-0.3.7/Filters/FilterDocbook.cs
@@ -58,7 +58,7 @@ namespace Beagle.Filters
public FilterDocbook ()
{
SnippetMode = false;
- SetVersion (4);
+ SetVersion (5);
SetFileType ("documentation");
}

@@ -159,7 +159,8 @@ namespace Beagle.Filters
if (entries_stack.Count > 0)
parent_entry =
(DocbookEntry) entries_stack.Peek ();

- Indexable indexable = new
Indexable (UriFu.PathToFileUri (String.Format ("{0}#{1}", base_path,
entry.Id)));
+ Indexable indexable;
+ indexable = new Indexable
(UriFu.AddFragment (Indexable.Uri, entry.Id, false));
indexable.HitType =
"DocbookEntry";
indexable.MimeType =
"text/x-docbook-entry";
indexable.Filtering =
IndexableFiltering.AlreadyFiltered;
Index: beagle-0.3.7/Filters/FilterArchive.cs
===================================================================
--- beagle-0.3.7.orig/Filters/FilterArchive.cs
+++ beagle-0.3.7/Filters/FilterArchive.cs
@@ -164,15 +164,10 @@ namespace Beagle.Filters {
++count;
total_size += a_entry.Size;

- // FIXME: For nested archives, create uid:foo#bar
- // instead of uid:foo#xxx#bar (avoid duplicates ?)
- // FIXME: Construct correct Uri
- // 1. Use Uri (foo, true): foo is not escaped. This
creates serialization error for uris containing non-ascii character
- // 2: Using Uri (foo): foo is escaped. This causes
foo.zip#b#c (file c in archive b in archive foo) to be escaped to
foo.zip#b%23c. This should be properly escaped back. Note that, file b#c in
archive foo.zip would also be escaped to foo.zip#b%23c. If there is any problem
about incorrect filename containing '#' in an archive, then System.Uri should
be abandoned and a custom Beagle.Uri should be created which can handle
multiple fragments.
- // If you read the Uri related FIXMEs and hacks in
beagled/*Queryable,
- // then you would see why creating Beagle.Uri class
over System.Uri
- // is not at all a bad idea :)
- child = new Indexable (new Uri (Indexable.Uri.ToString
() + "#" + a_entry.Name));
+ // Add "#<escaped-path-to-entry>" to the end of the
Indexable Uri
+ // So, file b#c in archive foo.zip becomes
file:///foo.zip#b%23c
+ // And file c in archive b in archive foo.zip becomes
file:///foo.zip#b#c
+ child = new Indexable (UriFu.AddFragment
(Indexable.Uri, a_entry.Name, false));

child.CacheContent = true;
child.MimeType = a_entry.MimeType;
Index: beagle-0.3.7/Filters/FilterMonodoc.cs
===================================================================
--- beagle-0.3.7.orig/Filters/FilterMonodoc.cs
+++ beagle-0.3.7/Filters/FilterMonodoc.cs
@@ -100,7 +100,7 @@ namespace Beagle.Filters {
if (type == null)
continue;

- Indexable type_indexable = TypeNodeToIndexable
(type, FileInfo);
+ Indexable type_indexable = TypeNodeToIndexable
(type, Indexable.Uri);
type_indexable.SetChildOf (this.Indexable);
type_indexable.StoreStream ();
type_indexable.CloseStreams ();
@@ -108,7 +108,7 @@ namespace Beagle.Filters {

foreach(XmlNode member in type.SelectNodes
("Members/Member")) {
Indexable member_indexable =
MemberNodeToIndexable (member,
-
FileInfo,
+
Indexable.Uri,

type.Attributes ["FullName"].Value);
member_indexable.SetChildOf
(this.Indexable);
member_indexable.StoreStream ();
@@ -120,9 +120,10 @@ namespace Beagle.Filters {
Finished ();
}

- static private Indexable TypeNodeToIndexable (XmlNode node,
FileInfo file)
+ static private Indexable TypeNodeToIndexable (XmlNode node, Uri
base_uri)
{
- Indexable indexable = new Indexable
(UriFu.PathToFileUri (file + "#T:" + node.Attributes ["FullName"].Value));
+ string fragment = "T:" + node.Attributes
["FullName"].Value;
+ Indexable indexable = new Indexable (UriFu.AddFragment
(base_uri, fragment, false));

indexable.MimeType = "text/html";
indexable.HitType = "MonodocEntry";
@@ -137,7 +138,7 @@ namespace Beagle.Filters {
return indexable;
}

- static private Indexable MemberNodeToIndexable(XmlNode node,
FileInfo file, string parentName)
+ static private Indexable MemberNodeToIndexable(XmlNode node,
Uri base_uri, string parentName)
{
char memberType = MemberTypeToChar
(node.SelectSingleNode ("MemberType").InnerText);
StringBuilder memberFullName = new StringBuilder ();
@@ -159,7 +160,7 @@ namespace Beagle.Filters {
memberFullName.Append (")");
}

- Indexable indexable = new Indexable
(UriFu.PathToFileUri (file + "#" + memberFullName));
+ Indexable indexable = new Indexable (UriFu.AddFragment
(base_uri, memberFullName.ToString (), false));

indexable.MimeType = "text/html";
indexable.HitType = "MonodocEntry";
Index: beagle-0.3.7/Filters/FilterMail.cs
===================================================================
--- beagle-0.3.7.orig/Filters/FilterMail.cs
+++ beagle-0.3.7/Filters/FilterMail.cs
@@ -423,8 +423,9 @@ namespace Beagle.Filters {
// attachments along with
(real) attachments.

if (Array.IndexOf
(blacklisted_mime_types, mime_type) == -1) {
- string sub_uri =
this.indexable.Uri.ToString () + "#" + this.count;
- Indexable child = new
Indexable (new Uri (sub_uri));
+ string sub_uri = "#" +
this.count;
+ Indexable child;
+ child = new Indexable
(UriFu.AddFragment (this.indexable.Uri, sub_uri, true));

child.DisplayUri = new
Uri (this.indexable.DisplayUri.ToString () + "#" + this.count);

Index: beagle-0.3.7/beagled/FileSystemQueryable/FileSystemQueryable.cs
===================================================================
--- beagle-0.3.7.orig/beagled/FileSystemQueryable/FileSystemQueryable.cs
+++ beagle-0.3.7/beagled/FileSystemQueryable/FileSystemQueryable.cs
@@ -1744,7 +1744,8 @@ namespace Beagle.Daemon.FileSystemQuerya
string is_child = hit [Property.IsChildPropKey];
string fragment = null;
if (is_child == "true") {
- hit.Uri = UriFu.PathToFileUri (path,
old_uri.Fragment);
+ Uri uri = UriFu.PathToFileUri (path);
+ hit.Uri = UriFu.AddFragment (uri, old_uri.Fragment, true);
hit.ParentUri = UriFu.PathToFileUri (path);
}

Index: beagle-0.3.7/beagled/DumpIndex.cs
===================================================================
--- beagle-0.3.7.orig/beagled/DumpIndex.cs
+++ beagle-0.3.7/beagled/DumpIndex.cs
@@ -117,7 +117,9 @@ class DumpIndexTool {
internal_uri = UriFu.UriToEscapedString
(hit.ParentUri);

hit.ParentUri = UriFu.PathToFileUri
(path);
- hit.Uri = UriFu.PathToFileUri (path,
hit.Uri.Fragment);
+ hit.Uri = UriFu.AddFragment (UriFu.PathToFileUri (path),
+ hit.Uri.Fragment,
+ true);
} else {
internal_uri = UriFu.UriToEscapedString
(hit.Uri);

++++++ beagle-urifu-add-number-sign-unescaped.patch ++++++
Index: beagle/Util/UriFu.cs
===================================================================
--- beagle/Util/UriFu.cs (revision 4776)
+++ beagle/Util/UriFu.cs (revision 4777)
@@ -1,6 +1,7 @@
//
// UriFu.cs
//
+// Copyright (C) 2008 D Bera <dbera.web@xxxxxxxxx>
// Copyright (C) 2004 Novell, Inc.
//

@@ -31,70 +32,93 @@

namespace Beagle.Util {

- public class UriFu {
+ /* Beagle URIs : A bunch of hacks
+ * ------------------------------
+ *
+ * Every indexed document is identified by a URI.
+ * In general URI format is not very flexible so we
+ * construct our own URI format and convince System.Uri
+ * to use that. Also, we do our own URI<->string conversion
+ * and use that during XML serialization/deserialization.
+ *
+ * The format is similar to the Uri RFC:
+ *
+ * Scheme
+ * SchemeDelimiter
+ * Userinfo
+ * Host (case sensitive - different from the RFC)
+ * Absolute path and query (escaped)
+ * Zero or more fragments: each fragment is
+ * - '#' (unescaped)
+ * - fragment path (escaped)
+ *
+ * The difference is the presence of multiple fragments
+ * and case-sensitive hostname.
+ *
+ * Also there are a bunch of functions for converting a
+ * file path to a file:/// URI. This is needed because
+ * sometimes path can contain characters prohibited
+ * in the path component of a URI. These paths first need
+ * to be escaped. Otherwise Uri() will think these are
+ * special characters!
+ *
+ * Note: Beagle internal uris are of the form "uid:xyz".
+ *
+ */

- private UriFu () { } // class is static
+ public static class UriFu {

static public Uri PathToFileUri (string path)
{
- return PathToFileUri (path, null);
+ return new Uri (PathToFileUriString (path), true);
}

- static public Uri PathToFileUri (string path, string fragment)
+ // DEPRECATED! path is always escaped but escaping of fragment
is
+ // context dependent.
+ //static public Uri PathToFileUri (string path, string fragment)
+ //
+
+ // Whether fragment should be escaped or not is crucial and
depends on the context.
+ // Hence the caller of the method should set it accordingly and
no default
+ // value for escape_fragment is provided.
+ static public Uri AddFragment (Uri uri, string fragment, bool
dont_escape_fragment)
{
- return new Uri (PathToFileUriString (path, fragment),
true);
+ if (fragment [0] == '#')
+ fragment = fragment.Substring (1);
+
+ if (! dont_escape_fragment)
+ fragment = StringFu.HexEscape (fragment);
+
+ fragment = String.Concat (uri.Fragment,
+ '#',
+ fragment); // Append to
existing fragment
+
+ return new Uri (uri, fragment, true /* dont escape*/);
}

static public string PathToFileUriString (string path)
{
- return PathToFileUriString (path, null);
+ return String.Concat (Uri.UriSchemeFile,
+ Uri.SchemeDelimiter,
+ StringFu.HexEscape
(Path.GetFullPath (path)));
}

- static public string PathToFileUriString (string path, string
fragment)
+ static public Uri EscapedStringToUri (string uri_string)
{
- string str = String.Concat (Uri.UriSchemeFile,
- Uri.SchemeDelimiter,
- StringFu.HexEscape
(Path.GetFullPath (path)));
- if (fragment != null)
- str = str + fragment;
- return str;
+ return new Uri (uri_string, true);
}

- static public Uri EscapedStringToUri (string path)
- {
- // Our current hackery attempts to serialize Uri
strings in
- // escaped and constructable form, so we don't require
any
- // extra processing on deserialization right now.
- return new Uri (path, true);
- }
-
- // UriBuilder is a piece of shit so we have to do this
ourselves.
static public string UriToEscapedString (Uri uri)
{
- StringBuilder builder = new StringBuilder ();
+ if (uri.UserEscaped)
+ return uri.OriginalString;

- builder.Append (uri.Scheme);
-
- if (uri.ToString ().IndexOf (Uri.SchemeDelimiter) ==
uri.Scheme.Length)
- builder.Append (Uri.SchemeDelimiter);
- else
- builder.Append (':');
-
- if (uri.Host != String.Empty) {
- if (uri.UserInfo != String.Empty)
- builder.Append (uri.UserInfo + "@");
-
- builder.Append (uri.Host);
- }
-
- if (! uri.IsDefaultPort)
- builder.Append (":" + uri.Port);
-
- // Both PathAndQuery and Fragment are escaped for us
- builder.Append (uri.PathAndQuery);
- builder.Append (uri.Fragment);
-
- return builder.ToString ();
+ // Do not use uri.ToString(), it actually unescapes
certain characters.
+ // uri.AbsoluteUri also returns "uid:xxx" from the
beagle internal
+ // uid:xxx URIs.
+ // If AbsoluteUri is found to skip any information in
the URI, then
+ // manually the string needs to be constructed.
+ return uri.AbsoluteUri;
}

// Get a uri of our liking from a user-entered uri
@@ -135,6 +159,8 @@

//////////////////////////////////

+ // Uri.ToString() should not be used. Use Uri.AbsoluteUri
+
static public bool Equals (Uri uri1, Uri uri2)
{
return uri1.ToString () == uri2.ToString ();


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread