rpms/rpm/devel desktop-file.prov, NONE, 1.1 rpm-4.6.0-extra-provides.patch, NONE, 1.1 rpm.spec, 1.320, 1.321
Panu Matilainen
pmatilai at fedoraproject.org
Wed Feb 4 14:51:27 UTC 2009
Author: pmatilai
Update of /cvs/pkgs/rpms/rpm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20289
Modified Files:
rpm.spec
Added Files:
desktop-file.prov rpm-4.6.0-extra-provides.patch
Log Message:
- extract mimehandler provides from .desktop files
- preliminaries for extracting font provides (not enabled yet)
- dont classify font metrics data as fonts
- only run script dep extraction once per file, duh
--- NEW FILE desktop-file.prov ---
#!/bin/sh
#
# Transform desktop mimetype info into RPM mimehandler(type) provides
#
# Author: Richard Hughes <richard at hughsie.com>
# Based on other provides scripts from RPM
OLD_IFS="$IFS"
while read instfile ; do
case "$instfile" in
*.desktop)
mime=`cat $instfile | grep MimeType= | cut -d'=' -f2`
IFS=';'
for type in $mime ; do
echo 'mimehandler('$type')'
done
;;
esac
done
IFS=$OLD_IFS
rpm-4.6.0-extra-provides.patch:
--- NEW FILE rpm-4.6.0-extra-provides.patch ---
diff -up rpm-4.6.0-rc4/build/rpmfc.c.extra-prov rpm-4.6.0-rc4/build/rpmfc.c
--- rpm-4.6.0-rc4/build/rpmfc.c.extra-prov 2009-02-04 15:18:05.000000000 +0200
+++ rpm-4.6.0-rc4/build/rpmfc.c 2009-02-04 15:20:46.000000000 +0200
@@ -485,6 +485,7 @@ static const struct rpmfcTokens_s const
{ "RPM v4", RPMFC_ARCHIVE|RPMFC_INCLUDE },
{ " image", RPMFC_IMAGE|RPMFC_INCLUDE },
+ { " font metrics", RPMFC_WHITE|RPMFC_INCLUDE },
{ " font", RPMFC_FONT|RPMFC_INCLUDE },
{ " Font", RPMFC_FONT|RPMFC_INCLUDE },
@@ -1189,6 +1190,31 @@ exit:
#endif
}
+static int rpmfcMISC(rpmfc fc)
+{
+ struct stat st;
+ int rc = -1;
+ const char *what = NULL;
+ const char * fn = fc->fn[fc->ix];
+ /* this part is enumerated, compare equality not bit flags */
+ int ftype = fc->fcolor->vals[fc->ix] & 0x000F0000;
+
+ if (ftype == RPMFC_FONT) {
+ what = "fontconfig";
+ } else if (ftype == RPMFC_TEXT && rpmFileHasSuffix(fn, ".desktop")) {
+ what = "desktop";
+ }
+
+ if (what == NULL || stat(fn, &st) < 0 || !S_ISREG(st.st_mode)) {
+ goto exit;
+ }
+
+ (void) rpmfcHelper(fc, 'P', what);
+ rc = 0;
+
+exit:
+ return rc;
+}
typedef const struct rpmfcApplyTbl_s {
int (*func) (rpmfc fc);
int colormask;
@@ -1198,12 +1224,11 @@ typedef const struct rpmfcApplyTbl_s {
*/
static const struct rpmfcApplyTbl_s const rpmfcApplyTable[] = {
{ rpmfcELF, RPMFC_ELF },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PKGCONFIG) },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_LIBTOOL) },
- { rpmfcSCRIPT, RPMFC_MONO },
- { rpmfcSYMLINK, RPMFC_SYMLINK },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_BOURNE|
+ RPMFC_PERL|RPMFC_PYTHON|RPMFC_MONO|
+ RPMFC_PKGCONFIG|RPMFC_LIBTOOL) },
+ { rpmfcMISC, RPMFC_FONT|RPMFC_TEXT },
+ { rpmfcSYMLINK, RPMFC_SYMLINK },
{ NULL, 0 }
};
@@ -1322,7 +1347,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t arg
size_t slen;
int fcolor;
int xx;
- int msflags = MAGIC_CHECK; /* XXX MAGIC_COMPRESS flag? */
+ int msflags = MAGIC_CHECK | MAGIC_COMPRESS;
magic_t ms = NULL;
if (fc == NULL || argv == NULL)
diff -up rpm-4.6.0-rc4/macros.in.extra-prov rpm-4.6.0-rc4/macros.in
--- rpm-4.6.0-rc4/macros.in.extra-prov 2009-02-04 15:18:05.000000000 +0200
+++ rpm-4.6.0-rc4/macros.in 2009-02-04 15:18:05.000000000 +0200
@@ -463,6 +463,9 @@ print (t)\
%__pkgconfig_provides @RPMCONFIGDIR@/pkgconfigdeps.sh --provides
%__pkgconfig_requires @RPMCONFIGDIR@/pkgconfigdeps.sh --requires
+#%__fontconfig_provides /usr/lib/rpm/fontconfig.prov
+%__desktop_provides /usr/lib/rpm/desktop-file.prov
+
#==============================================================================
# ---- Database configuration macros.
# Macros used to configure Berkley db parameters.
Index: rpm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rpm/devel/rpm.spec,v
retrieving revision 1.320
retrieving revision 1.321
diff -u -r1.320 -r1.321
--- rpm.spec 31 Jan 2009 11:50:27 -0000 1.320
+++ rpm.spec 4 Feb 2009 14:50:56 -0000 1.321
@@ -18,13 +18,14 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
-Release: 0.%{snapver}.2%{?dist}
+Release: 0.%{snapver}.3%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
%if %{with int_bdb}
Source1: db-%{bdbver}.tar.gz
%endif
+Source10: desktop-file.prov
Patch0: rpm-4.5.90-devel-autodep.patch
Patch1: rpm-4.5.90-pkgconfig-path.patch
@@ -34,7 +35,7 @@
Patch200: rpm-4.6.0-rc1-defaultdocdir.patch
# These are not yet upstream
-Patch300: rpm-4.5.90-posttrans.patch
+Patch300: rpm-4.6.0-extra-provides.patch
# Partially GPL/LGPL dual-licensed and some bits with BSD
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
@@ -169,8 +170,7 @@
# upstream but not on 4.6.x branch yet, oops
%patch200 -p1 -b .defaultdocdir
-# needs a bit of upstream love first...
-#%patch300 -p1 -b .posttrans
+%patch300 -p1 -b .extra-prov
%if %{with int_bdb}
ln -s db-%{bdbver} db
@@ -213,6 +213,8 @@
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
install -m 644 scripts/rpm.log ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/rpm
+install -p -m 755 %{SOURCE10} ${RPM_BUILD_ROOT}%{rpmhome}/
+
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm
mkdir -p $RPM_BUILD_ROOT/var/lib/rpm
@@ -341,6 +343,7 @@
%{rpmhome}/config.sub
%{rpmhome}/mkinstalldirs
%{rpmhome}/rpmdiff*
+%{rpmhome}/desktop-file.prov
%{rpmhome}/macros.perl
%{rpmhome}/macros.python
@@ -367,7 +370,13 @@
%doc doc/librpm/html/*
%changelog
-* Sat Jan 31 2009 Panu Matilainen <pmatilai at redhat.com>
+* Wed Feb 04 2009 Panu Matilainen <pmatilai at redhat.com> - 4.6.0-0.rc4.3
+- extract mimehandler provides from .desktop files
+- preliminaries for extracting font provides (not enabled yet)
+- dont classify font metrics data as fonts
+- only run script dep extraction once per file, duh
+
+* Sat Jan 31 2009 Panu Matilainen <pmatilai at redhat.com> - 4.6.0-0.rc4.2
- change platform sharedstatedir to something more sensible (#185862)
- add rpmdb_foo links to db utils for documentation compatibility
More information about the fedora-extras-commits
mailing list