Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 70064 Details for
Bug 67768
Integrating Beagle into Portage
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
files/beagle-0.1.1-uri-serialization.patch
beagle-0.1.1-uri-serialization.patch (text/plain), 2.92 KB, created by
Daniel Drake (RETIRED)
on 2005-10-07 04:35:30 UTC
(
hide
)
Description:
files/beagle-0.1.1-uri-serialization.patch
Filename:
MIME Type:
Creator:
Daniel Drake (RETIRED)
Created:
2005-10-07 04:35:30 UTC
Size:
2.92 KB
patch
obsolete
>Convert Uri's to a constructable form before serialization. > >Index: Util/UriFu.cs >=================================================================== >RCS file: /cvs/gnome/beagle/Util/UriFu.cs,v >retrieving revision 1.12 >diff -u -B -p -r1.12 UriFu.cs >--- Util/UriFu.cs 16 May 2005 16:05:48 -0000 1.12 >+++ Util/UriFu.cs 5 Oct 2005 16:16:14 -0000 >@@ -42,58 +42,37 @@ namespace Beagle.Util { > > static public Uri UriStringToUri (string path) > { >- // Decode our pre-encoded 'odd' characters into their real values >- int i = 0, pos = 0; >- while ((i = path.IndexOf ('%', pos)) != -1) { >- pos = i; >- char unescaped = UriFu.HexUnescape (path, ref pos); >- if (unescaped < '!' || unescaped > '~') { >- path = path.Remove (i, 3); >- path = path.Insert (i, new String(unescaped, 1)); >- pos -= 2; >- } >- } >- >- // Paths from the file:// indexer need (re)quoting. For example, >- // valid characters such as @ need to be converted to their hex >- // values. >- if (path.StartsWith ("file://")) { >- // Remove the file:// prefix >- path = path.Substring (7); >- >- return PathToFileUri (path); >- } >- >- // Currently, no other protocols need extra processing >+ // 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); > } > > static public String UriToSerializableString (Uri uri) > { > int i; >- string ret; >+ string scheme, path; > StringBuilder builder = new StringBuilder (); >- >- // The ToString() of a file:// URI is not always representative of >- // what it was constructed from. For example, it will return a >- // # (which was inputted as %23) as %23, whereas the more standard >- // behaviour for other escaped-characters is to return them as >- // their actual character. (e.g. %40 gets returned as @) >- // On the other hand, the LocalPath of a file:// URI does seem to >- // return the literal # so we use that instead. >- if (uri.IsFile) >- ret = Uri.UriSchemeFile + Uri.SchemeDelimiter + uri.LocalPath; >- else >- ret = uri.ToString (); >+ >+ scheme = uri.Scheme; >+ path = StringFu.HexEscape (uri.LocalPath); > > // XmlSerializer is happy to serialize 'odd' characters, but doesn't > // like to deserialize them. So we encode all 'odd' characters now. >- for (i = 0; i < ret.Length; i++) >- if ((ret [i] < '!') || (ret [i] > '~' && ret [i] < 256)) >- builder.Append (Uri.HexEscape (ret [i])); >+ for (i = 0; i < path.Length; i++) >+ if ((path [i] < '!') || (path [i] > '~' && path [i] < 256)) >+ builder.Append (Uri.HexEscape (path [i])); > else >- builder.Append (ret [i]); >+ builder.Append (path [i]); >+ >+ if (scheme == "uid") >+ builder.Insert (0, ':'); >+ else >+ builder.Insert (0, Uri.SchemeDelimiter); > >+ builder.Insert (0, scheme); >+ builder.Append (uri.Fragment); >+ > return builder.ToString (); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 67768
:
49050
|
49344
|
49370
|
49493
|
49494
|
49642
|
49643
|
49665
|
49666
|
50200
|
51333
|
51351
|
51352
|
51361
|
51503
|
53262
|
53433
|
53512
|
53513
|
54241
|
54243
|
54293
|
54294
|
54415
|
54433
|
54520
|
54521
|
55523
|
55526
|
55862
|
56779
|
56780
|
57489
|
60197
|
60198
|
60216
|
60773
|
61241
|
61308
|
62741
|
63190
|
63206
|
68683
|
69812
|
70062
|
70063
| 70064 |
71527