[packages/rpm] updated desktop file mimetype() support patch to 5.4
baggins
baggins at pld-linux.org
Sat Aug 25 19:31:56 CEST 2012
commit c50e9031f1f5a02531ef0e10de8684cda20182f4
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Aug 25 19:30:57 2012 +0200
updated desktop file mimetype() support patch to 5.4
rpm-mimetype.patch | 50 ++++++++++++++++++++++++--------------------------
rpm.spec | 3 +--
2 files changed, 25 insertions(+), 28 deletions(-)
---
diff --git a/rpm.spec b/rpm.spec
index 10064bd..6df65b4 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -726,8 +726,7 @@ install %{SOURCE12} scripts/perl.prov
%patch18 -p1
# Maybe, at last we can remove this?
#patch19 -p1
-# port to new implementation
-#%patch60 -p1
+%patch60 -p1
%ifarch sparc64
%patch61 -p1
%endif
diff --git a/rpm-mimetype.patch b/rpm-mimetype.patch
index da2b3ed..ed51d83 100644
--- a/rpm-mimetype.patch
+++ b/rpm-mimetype.patch
@@ -10,26 +10,25 @@ diff -urN rpm-5.1.4/lib/rpmfc.c rpm-5.1.4.new/lib/rpmfc.c
{ "perl script text", RPMFC_PERL|RPMFC_INCLUDE },
{ "Perl5 module source text", RPMFC_PERL|RPMFC_MODULE|RPMFC_INCLUDE },
-@@ -875,6 +877,10 @@
- xx = rpmfcHelper(fc, 'P', "java", fc->noautoprov, fc->noautoprov_c);
- if (fc->findreq)
- xx = rpmfcHelper(fc, 'R', "java", fc->noautoreq, fc->noautoreq_c);
+@@ -875,6 +877,9 @@
+ if (fc->fcolor->vals[fc->ix] & RPMFC_JAVA) {
+ xx = rpmfcHelper(fc, 'P', "java");
+ xx = rpmfcHelper(fc, 'R', "java");
+ } else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_DESKTOP_FILE) {
-+ if (fc->findprov)
-+ xx = rpmfcHelper(fc, 'P', "mimetype", fc->noautoprov, fc->noautoprov_c);
++ xx = rpmfcHelper(fc, 'P', "mimetype");
}
- return 0;
+ /*@-observertrans@*/
@@ -957,7 +963,7 @@
/*@unchecked@*/
static struct rpmfcApplyTbl_s rpmfcApplyTable[] = {
{ rpmfcELF, RPMFC_ELF },
-- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO) },
-+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_DESKTOP_FILE) },
- { NULL, 0 }
- };
-
+- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB) },
++ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB|RPMFC_DESKTOP_FILE) },
+ #if defined(RPM_VENDOR_MANDRIVA)
+ { rpmfcSYMLINK, RPMFC_SYMLINK },
+ #endif
@@ -1311,6 +1317,9 @@
else if (_suffix(s, ".php"))
ftype = "PHP script text";
@@ -37,27 +36,26 @@ diff -urN rpm-5.1.4/lib/rpmfc.c rpm-5.1.4.new/lib/rpmfc.c
+ else if (_suffix(s, ".desktop"))
+ ftype = "Desktop Entry";
+
- /* XXX skip all files in /dev/ which are (or should be) %dev dummies. */
- else if (slen >= fc->brlen+sizeof("/dev/") && !strncmp(s+fc->brlen, "/dev/", sizeof("/dev/")-1))
- ftype = "";
+ /* XXX files with extension ".typelib" are GNOME typelib for now. */
+ else if (_suffix(s, ".typelib"))
+ ftype = "G-IR binary database";
diff -urN rpm-5.1.4/lib/rpmfc.h rpm-5.1.4.new/lib/rpmfc.h
--- rpm-5.1.4/lib/rpmfc.h 2008-07-29 19:36:38.000000000 +0200
+++ rpm-5.1.4.new/lib/rpmfc.h 2008-07-29 19:44:27.000000000 +0200
-@@ -28,7 +28,8 @@
+@@ -28,7 +28,7 @@
#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
/* (1 << 3) leaks into package headers, reserved */
-- /* bits 4-7 unused */
-+ /* bits 4-6 unused */
-+ RPMFC_DESKTOP_FILE = (1 << 7),
- RPMFC_PKGCONFIG = (1 << 8),
- RPMFC_LIBTOOL = (1 << 9),
- RPMFC_BOURNE = (1 << 10),
-diff -urN rpm-5.1.4/macros.in rpm-5.1.4.new/macros.in
---- rpm-5.1.4/macros.in 2008-07-29 19:36:38.000000000 +0200
-+++ rpm-5.1.4.new/macros.in 2008-07-29 19:45:45.000000000 +0200
+- /* bit 4 unused */
++ RPMFC_DESKTOP_FILE = (1 << 4),
+ RPMFC_TYPELIB = (1 << 5),
+ RPMFC_HASKELL = (1 << 6),
+ RPMFC_RUBY = (1 << 7),
+diff -urN rpm-5.1.4/macros/macros.in rpm-5.1.4.new/macros/macros.in
+--- rpm-5.1.4/macros/macros.in 2008-07-29 19:36:38.000000000 +0200
++++ rpm-5.1.4.new/macros/macros.in 2008-07-29 19:45:45.000000000 +0200
@@ -1617,6 +1617,16 @@
- %__mono_requires %{nil}
+ #}1}%{rpm_license_check}
#------------------------------------------------------------------------
+# mimetype(...) configuration.
More information about the pld-cvs-commit
mailing list