From 249f17b40818dbd035b3ef3bbfdc98f3234f4e7c Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Sat, 2 Apr 2005 16:50:27 +0000 Subject: - Update to 0.16 --- misc/shared-mime-info/Makefile | 12 +- misc/shared-mime-info/distinfo | 6 +- .../files/patch-freedesktop.org.xml.in | 794 --------------------- .../files/patch-update-mime-database.c | 295 +------- 4 files changed, 10 insertions(+), 1097 deletions(-) delete mode 100644 misc/shared-mime-info/files/patch-freedesktop.org.xml.in (limited to 'misc/shared-mime-info') diff --git a/misc/shared-mime-info/Makefile b/misc/shared-mime-info/Makefile index d1ca89c345fc..1684d76cc4fa 100644 --- a/misc/shared-mime-info/Makefile +++ b/misc/shared-mime-info/Makefile @@ -5,19 +5,13 @@ # $FreeBSD$ PORTNAME= shared-mime-info -PORTVERSION= 0.15 -PORTREVISION= 9 +PORTVERSION= 0.16 +PORTREVISION= 1 CATEGORIES= misc gnome MASTER_SITES= http://www.marcuscom.com/downloads/ \ - http://www.freedesktop.org/software/shared-mime-info/ + http://freedesktop.org/~jrb/ DISTNAME= shared-mime-info-${PORTVERSION} -PATCH_SITES= http://www.marcuscom.com/downloads/ \ - http://people.FreeBSD.org/~marcus/ \ - ${MASTER_SITE_LOCAL} -PATCH_SITE_SUBDIR= marcus -PATCHFILES= patch-0159-freedesktop.org.xml - MAINTAINER= gnome@FreeBSD.org COMMENT= A MIME type database from the FreeDesktop project diff --git a/misc/shared-mime-info/distinfo b/misc/shared-mime-info/distinfo index 692d77c5dd43..bd2a9c80db61 100644 --- a/misc/shared-mime-info/distinfo +++ b/misc/shared-mime-info/distinfo @@ -1,4 +1,2 @@ -MD5 (shared-mime-info-0.15.tar.gz) = 51793b041edc68717c3f87e26a4bc087 -SIZE (shared-mime-info-0.15.tar.gz) = 422311 -MD5 (patch-0159-freedesktop.org.xml) = 99d3a5f1ac16042717fe0fbe80abb7cc -SIZE (patch-0159-freedesktop.org.xml) = 722446 +MD5 (shared-mime-info-0.16.tar.gz) = 255a20bae753ebd41e2286b01e7b86d0 +SIZE (shared-mime-info-0.16.tar.gz) = 753513 diff --git a/misc/shared-mime-info/files/patch-freedesktop.org.xml.in b/misc/shared-mime-info/files/patch-freedesktop.org.xml.in deleted file mode 100644 index a59b4dbf7334..000000000000 --- a/misc/shared-mime-info/files/patch-freedesktop.org.xml.in +++ /dev/null @@ -1,794 +0,0 @@ -=================================================================== -RCS file: /cvs/mime/shared-mime-info/freedesktop.org.xml.in,v -retrieving revision 1.21 -retrieving revision 1.50 -diff -u -r1.21 -r1.50 ---- freedesktop.org.xml.in 2004/08/16 10:29:23 1.21 -+++ freedesktop.org.xml.in 2005/03/19 12:15:55 1.50 -@@ -68,6 +68,10 @@ - - - -+ -+ Mathematica Notebook -+ -+ - - <_comment>unknown - -@@ -89,6 +93,7 @@ - - - -+ - - - <_comment>PGP message -@@ -133,6 +138,15 @@ - - - -+ -+ <_comment>StuffIt archive -+ -+ -+ -+ -+ -+ -+ - - <_comment>Corel Draw drawing - -@@ -151,7 +165,7 @@ - - <_comment>Lotus 1-2-3 spreadsheet - -- -+ - - - -@@ -159,7 +173,12 @@ - - - -- -+ -+ -+ <_comment>XML User Interface Language document -+ -+ -+ - <_comment>Microsoft Excel spreadsheet - - -@@ -184,8 +203,8 @@ - - - -- -- <_comment>Microsoft Word document -+ -+ <_comment>Microsoft Word document - - - -@@ -195,7 +214,7 @@ - - - -- -+ - - - <_comment>Palmpilot database/document -@@ -275,6 +294,62 @@ - <_comment>OpenOffice.org Writer document template - - -+ -+ <_comment>OpenDocument Text -+ -+ -+ -+ <_comment>OpenDocument Text Template -+ -+ -+ -+ <_comment>OpenDocument HTML Document Template -+ -+ -+ -+ <_comment>OpenDocument Master Document -+ -+ -+ -+ <_comment>OpenDocument Drawing -+ -+ -+ -+ <_comment>OpenDocument Drawing Template -+ -+ -+ -+ <_comment>OpenDocument Presentation -+ -+ -+ -+ <_comment>OpenDocument Presentation Template -+ -+ -+ -+ <_comment>OpenDocument Spreadsheet -+ -+ -+ -+ <_comment>OpenDocument Spreadsheet Template -+ -+ -+ -+ <_comment>OpenDocument Chart -+ -+ -+ -+ <_comment>OpenDocument Formula -+ -+ -+ -+ <_comment>OpenDocument Database -+ -+ -+ -+ <_comment>OpenDocument Image -+ -+ - - - -@@ -419,6 +494,10 @@ - <_comment>PGN chess game - - -+ -+ Compiled HTML Help Format -+ -+ - - <_comment>Java byte code - -@@ -468,8 +547,16 @@ - - - -+ - - <_comment>C shell script -+ -+ -+ -+ -+ -+ -+ - - - <_comment>dBASE document -@@ -694,7 +781,7 @@ - - - -- -+ - <_comment>Glade project - - -@@ -765,6 +852,14 @@ - - - -+ -+ -+ <_comment>Java Network Launched Application -+ -+ -+ -+ -+ - - - <_comment>Javascript program -@@ -1111,6 +1206,14 @@ - - <_comment>Palm OS database - -+ -+ PAR2 Parity File -+ -+ -+ -+ -+ -+ - - <_comment>PEF executable - -@@ -1118,6 +1221,7 @@ - - - -+ - - <_comment>Perl script - -@@ -1154,23 +1258,6 @@ - <_comment>Pathetic Writer document - - -- -- -- <_comment>Python script -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - <_comment>Python bytecode - -@@ -1209,6 +1296,7 @@ - - - -+ - - <_comment>Ruby script - -@@ -1253,25 +1341,18 @@ - - <_comment>shell script - -- -- -- - - - -- -- - - -+ - - -- -- - -- -+ - - -- - - - <_comment>Shockwave Flash file -@@ -1407,12 +1488,13 @@ - - - -- -+ - <_comment>XHTML page - - - - -+ - <_comment>ZIP archive - - -@@ -1497,6 +1579,13 @@ - - - -+ -+ <_comment>MP4 audio -+ -+ -+ -+ -+ - - <_comment>Amiga SoundTracker audio - -@@ -1507,12 +1596,12 @@ - - - -- -+ -+ - <_comment>MP3 audio - - - -- - - - -@@ -1525,6 +1614,9 @@ - - <_comment>MP3 audio (streamed) - -+ -+ -+ - - - <_comment>Playlist -@@ -1557,6 +1649,11 @@ - - - <_comment>MP3 ShoutCast playlist -+ -+ -+ -+ -+ - - - -@@ -1568,6 +1665,8 @@ - - - -+ -+ - <_comment>WAV audio - - -@@ -1649,6 +1748,7 @@ - - - -+ - <_comment>scalable SVG image - - -@@ -1695,11 +1795,11 @@ - - - -- -+ - <_comment>Digital Imaging and Communications in Medicine image - - -- -+ - - - -@@ -1993,10 +2093,13 @@ - <_comment>stream of data (server push) - - -- <_comment>iCalendar file -+ -+ <_comment>vCalendar interchange file - - -+ - -+ - - - -@@ -2005,47 +2108,24 @@ - - - -- <_comment>directory information file -+ -+ <_comment>Electronic Business Card -+ -+ -+ -+ -+ -+ -+ - - - <_comment>enriched text document - -- -- <_comment>translated messages -- -- -- -- <_comment>message translation template -- -- -- -- <_comment>HTML page -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - <_comment>help page - - -+ - <_comment>MathML document - - -@@ -2059,6 +2139,7 @@ - - - -+ - <_comment>Resource Description Framework (RDF) file - - -@@ -2066,10 +2147,12 @@ - <_comment>email headers - - -+ - <_comment>rich text document - - - -+ - <_comment>RDF Site Summary - - -@@ -2087,6 +2170,7 @@ - - - -+ - <_comment>text document (with tab-separated values) - - -@@ -2095,23 +2179,28 @@ - - - -+ - <_comment>Ada source code - - - - -+ - <_comment>author list - - - -+ - <_comment>Bibtex bibliographic data - - - -+ - <_comment>C++ source code header - - - -+ - <_comment>C++ source code - - -@@ -2120,32 +2209,39 @@ - - - -+ - <_comment>C source code header - - - - - -+ - <_comment>text document (with comma-separated values) - - - -+ - <_comment>software license terms - - - -+ - <_comment>software author credits - - - -+ - <_comment>C source code - - - -+ - <_comment>C# source code - - - -+ - <_comment>DCL script - - -@@ -2153,11 +2249,18 @@ - <_comment>DSSSL document - - -+ -+ -+ <_comment>D source code -+ -+ - -+ - <_comment>document type definition - - - -+ - <_comment>Emacs Lisp source code - - -@@ -2166,68 +2269,110 @@ - - - -+ - <_comment>Fortran source code - - -+ -+ -+ <_comment>translated messages -+ -+ -+ -+ -+ <_comment>message translation template -+ -+ -+ -+ <_comment>HTML page -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -+ - <_comment>GTK configuration - - - - -+ - <_comment>Haskell source code - - - -+ - <_comment>IDL document - - - -+ - <_comment>software installation instructions - - - -+ - <_comment>Java source code - - -- -- <_comment>Korn shell script -- -- -- -- - -+ - - - - - -+ - <_comment>Literate haskell source code - - - -+ - <_comment>application log - - - -+ - <_comment>Makefile - - - - -+ - <_comment>Qt Meta Object file - - - -+ - <_comment>Objective-C source code - - - -+ - <_comment>Pascal source code - - - - -+ - <_comment>differences between files - - -@@ -2242,15 +2387,36 @@ - - - -+ -+ -+ -+ <_comment>Python script -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -+ - <_comment>README document - - - -+ - <_comment>Scheme source code - - - -+ - <_comment>Setext document - - -@@ -2258,15 +2424,18 @@ - <_comment>Speech document - - -+ - <_comment>SQL code - - - -+ - <_comment>Tcl script - - - - -+ - <_comment>TeX document - - -@@ -2274,6 +2443,7 @@ - - - -+ - <_comment>TeXInfo document - - -@@ -2300,24 +2470,6 @@ - - - -- -- <_comment>vCalendar interchange file -- -- -- -- -- -- -- -- -- <_comment>electronic business card -- -- -- -- -- -- -- - - <_comment>XML Metadata Interchange file - -@@ -2328,7 +2480,9 @@ - - - -+ - <_comment>XSLT stylesheet -+ - - - -@@ -2338,6 +2492,7 @@ - - - -+ - <_comment>eXtensible Markup Language document - - diff --git a/misc/shared-mime-info/files/patch-update-mime-database.c b/misc/shared-mime-info/files/patch-update-mime-database.c index bbddab3d2097..a9837e64314c 100644 --- a/misc/shared-mime-info/files/patch-update-mime-database.c +++ b/misc/shared-mime-info/files/patch-update-mime-database.c @@ -1,216 +1,16 @@ ---- update-mime-database.c.orig Sat Mar 19 15:29:41 2005 -+++ update-mime-database.c Sat Mar 19 15:29:45 2005 -@@ -94,6 +94,12 @@ static GHashTable *globs_hash = NULL; - /* 'magic' nodes */ - static GPtrArray *magic_array = NULL; - -+/* Maps MIME type names to superclass names */ -+static GHashTable *subclass_hash = NULL; -+ -+/* Maps aliases to Types */ -+static GHashTable *alias_hash = NULL; -+ - /* Static prototypes */ - static Magic *magic_new(xmlNode *node, Type *type, GError **error); - -@@ -295,12 +301,37 @@ static gboolean process_freedesktop_node - { - char *other_type; - gboolean valid; -+ GSList *list, *nlist; -+ - other_type = xmlGetNsProp(field, "type", NULL); - valid = other_type && strchr(other_type, '/'); -- xmlFree(other_type); - if (valid) -- return FALSE; /* Copy through */ -+ { -+ char *typename; - -+ typename = g_strdup_printf("%s/%s", -+ type->media, -+ type->subtype); -+ -+ if (strcmp(field->name, "alias") == 0) -+ g_hash_table_insert(alias_hash, -+ g_strdup(other_type), type); -+ -+ else -+ { -+ list = g_hash_table_lookup(subclass_hash, typename); -+ nlist = g_slist_append (list, g_strdup(other_type)); -+ if (list == NULL) -+ g_hash_table_insert(subclass_hash, -+ g_strdup(typename), nlist); -+ } -+ g_free(typename); -+ xmlFree(other_type); -+ -+ return FALSE; /* Copy through */ -+ } -+ -+ xmlFree(other_type); - g_set_error(error, MIME_ERROR, 0, - _("Incorrect or missing 'type' attribute " - "in <%s>"), field->name); -@@ -377,7 +408,8 @@ static void remove_old(Type *type, xmlNo +--- update-mime-database.c.orig Fri Dec 3 15:46:28 2004 ++++ update-mime-database.c Fri Mar 25 14:51:30 2005 +@@ -408,7 +408,8 @@ } } - xmlFree(lang); + if (lang) -+ xmlFree(lang); ++ xmlFree(lang); } /* 'node' is a node from a source file, whose type is 'type'. -@@ -809,7 +841,14 @@ static void parse_int_value(int bytes, c - unsigned long value; - int b; - -- value = strtol(in, &end, 0); -+ value = strtoul(in, &end, 0); -+ if (errno == ERANGE) { -+ g_set_error(error, MIME_ERROR, 0, -+ "Number out-of-range (%s should fit in %d bytes)", -+ in, bytes); -+ return; -+ } -+ - if (*end != '\0') - { - g_set_error(error, MIME_ERROR, 0, "Value is not a number"); -@@ -834,9 +873,17 @@ static void parse_int_value(int bytes, c - if (in_mask) - { - int b; -- long mask; -+ unsigned long mask; - -- mask = strtol(in_mask, &end, 0); -+ mask = strtoul(in_mask, &end, 0); -+ if (errno == ERANGE) { -+ g_set_error(error, MIME_ERROR, 0, -+ "Mask out-of-range (%s should fit in %d bytes)", -+ in_mask, bytes); -+ return; -+ } -+ -+ - if (*end != '\0') - { - g_set_error(error, MIME_ERROR, 0, -@@ -847,7 +894,7 @@ static void parse_int_value(int bytes, c - out_mask = g_new(char, bytes); - for (b = 0; b < bytes; b++) - { -- int shift = (bytes - b - 1) * 8; -+ int shift = (big_endian ? (bytes - b - 1) : b) * 8; - out_mask[b] = (mask >> shift) & 0xff; - } - } -@@ -991,11 +1038,33 @@ static void match_offset(Match *match, x - } - - match->range_start = strtol(offset, &end, 10); -+ if (errno == ERANGE) { -+ char *number; -+ number = g_strndup(offset, end-offset); -+ g_set_error(error, MIME_ERROR, 0, -+ "Number out-of-range (%s should fit in 4 bytes)", -+ number); -+ g_free(number); -+ return; -+ } -+ - if (*end == ':' && end[1] && match->range_start >= 0) - { - int last; -+ char *begin; -+ -+ begin = end + 1; -+ last = strtol(begin, &end, 10); -+ if (errno == ERANGE) { -+ char *number; -+ number = g_strndup(begin, end-begin); -+ g_set_error(error, MIME_ERROR, 0, -+ "Number out-of-range (%s should fit in 8 bytes)", -+ number); -+ g_free(number); -+ return; -+ } - -- last = strtol(end + 1, &end, 10); - if (*end == '\0' && last >= match->range_start) - match->range_length = last - match->range_start + 1; - else -@@ -1310,6 +1379,66 @@ static void write_namespaces(FILE *strea - g_ptr_array_free(lines, TRUE); - } - -+static void write_subclass(gpointer key, gpointer value, gpointer data) -+{ -+ GSList *list = value; -+ FILE *stream = data; -+ GSList *l; -+ char *line; -+ -+ for (l = list; l; l = l->next) -+ { -+ line = g_strconcat (key, " ", l->data, "\n", NULL); -+ fwrite(line, 1, strlen(line), stream); -+ g_free (line); -+ } -+} -+ -+/* Write all the collected subclass information to 'subclasses' */ -+static void write_subclasses(FILE *stream) -+{ -+ g_hash_table_foreach(subclass_hash, write_subclass, stream); -+} -+ -+/* Extract one entry from alias_hash and put it in the GPtrArray so -+ * we can sort it. -+ */ -+static void add_alias(gpointer key, gpointer value, gpointer data) -+{ -+ GPtrArray *lines = (GPtrArray *) data; -+ const guchar *alias = (guchar *) key; -+ Type *type = (Type *) value; -+ -+ g_ptr_array_add(lines, g_strconcat(alias, " ", type->media, -+ "/", type->subtype, "\n", -+ NULL)); -+} -+ -+/* Write all the collected aliases */ -+static void write_aliases(FILE *stream) -+{ -+ GPtrArray *lines; -+ int i; -+ -+ lines = g_ptr_array_new(); -+ -+ g_hash_table_foreach(alias_hash, add_alias, lines); -+ -+ g_ptr_array_sort(lines, strcmp2); -+ -+ for (i = 0; i < lines->len; i++) -+ { -+ char *line = (char *) lines->pdata[i]; -+ -+ fwrite(line, 1, strlen(line), stream); -+ -+ g_free(line); -+ } -+ -+ g_ptr_array_free(lines, TRUE); -+} -+ -+ - /* Issue a warning if 'path' won't be found by applications */ - static void check_in_path_xdg_data(const char *mime_path) - { -@@ -1330,7 +1459,7 @@ static void check_in_path_xdg_data(const +@@ -1458,7 +1459,7 @@ env = getenv("XDG_DATA_DIRS"); if (!env) @@ -219,88 +19,3 @@ dirs = g_strsplit(env, ":", 0); g_return_if_fail(dirs != NULL); for (n = 0; dirs[n]; n++) -@@ -1371,6 +1500,14 @@ out: - g_free(path); - } - -+static void free_string_list(gpointer data) -+{ -+ GSList *list = data; -+ -+ g_slist_foreach(list, (GFunc)g_free, NULL); -+ g_slist_free(list); -+} -+ - int main(int argc, char **argv) - { - char *mime_dir = NULL; -@@ -1442,7 +1579,11 @@ int main(int argc, char **argv) - namespace_hash = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, NULL); - magic_array = g_ptr_array_new(); -- -+ subclass_hash = g_hash_table_new_full(g_str_hash, g_str_equal, -+ g_free, free_string_list); -+ alias_hash = g_hash_table_new_full(g_str_hash, g_str_equal, -+ g_free, NULL); -+ - scan_source_dir(package_dir); - g_free(package_dir); - -@@ -1494,7 +1635,7 @@ int main(int argc, char **argv) - atomic_update(magic_path); - g_free(magic_path); - } -- -+ - { - FILE *stream; - char *ns_path; -@@ -1510,12 +1651,47 @@ int main(int argc, char **argv) - atomic_update(ns_path); - g_free(ns_path); - } -+ -+ { -+ FILE *stream; -+ char *path; -+ -+ path = g_strconcat(mime_dir, "/subclasses.new", NULL); -+ stream = fopen(path, "wb"); -+ if (!stream) -+ g_error("Failed to open '%s' for writing\n", -+ path); -+ -+ write_subclasses(stream); -+ -+ atomic_update(path); -+ g_free(path); -+ } -+ -+ { -+ FILE *stream; -+ char *path; -+ -+ path = g_strconcat(mime_dir, "/aliases.new", NULL); -+ stream = fopen(path, "wb"); -+ if (!stream) -+ g_error("Failed to open '%s' for writing\n", -+ path); -+ -+ write_aliases(stream); -+ -+ atomic_update(path); -+ g_free(path); -+ } -+ - - g_ptr_array_free(magic_array, TRUE); - - g_hash_table_destroy(types); - g_hash_table_destroy(globs_hash); - g_hash_table_destroy(namespace_hash); -+ g_hash_table_destroy(subclass_hash); -+ g_hash_table_destroy(alias_hash); - - g_print("***\n"); - -- cgit v1.2.3