rpms/viewvc/devel viewvc-lexer-mimetypes.py, NONE, 1.1 viewvc.spec, 1.18, 1.19

bojan bojan at fedoraproject.org
Tue Aug 11 03:21:21 UTC 2009


Author: bojan

Update of /cvs/pkgs/rpms/viewvc/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29670

Modified Files:
	viewvc.spec 
Added Files:
	viewvc-lexer-mimetypes.py 
Log Message:
Install and populate mimetypes.conf.


--- NEW FILE viewvc-lexer-mimetypes.py ---
#!/usr/bin/python

import sys
import re
from pygments.lexers import get_all_lexers

for fullname, names, exts, mimetype in get_all_lexers():
  if len(exts) > len(mimetype):
    for j in range(len(mimetype)):
      for i in range(len(exts)):
        if re.match('\*\.',exts[i]):
          if i == 0:
            print mimetype[j],
          if re.search('\[[0-9]+\]',exts[i]):
            s=re.search('\[[0-9]+\]',exts[i]).span()[0]+1
            e=re.search('\[[0-9]+\]',exts[i]).span()[1]-1
            for k in range(s,e):
              print exts[i][2:s-1]+exts[i][k]+exts[i][e+1:],
          else:
            print exts[i][2:],
          if i == len(exts)-1:
            print
  else:
    for i in range(len(mimetype)):
      if len(exts) > i:
        if re.match('\*\.',exts[i]):
          if re.search('\[[0-9]+\]',exts[i]):
            s=re.search('\[[0-9]+\]',exts[i]).span()[0]+1
            e=re.search('\[[0-9]+\]',exts[i]).span()[1]-1
            print mimetype[i],
            for k in range(s,e):
              print exts[i][2:s-1]+exts[i][k]+exts[i][e+1:],
            print
          else:
            print mimetype[i], exts[i][2:]


Index: viewvc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/viewvc/devel/viewvc.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- viewvc.spec	27 Jul 2009 06:52:23 -0000	1.18
+++ viewvc.spec	11 Aug 2009 03:21:21 -0000	1.19
@@ -2,7 +2,7 @@
 
 Name:           viewvc
 Version:        1.1.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Browser interface for CVS and SVN version control repositories
 
 Group:          Development/Tools
@@ -11,13 +11,14 @@ URL:            http://www.viewvc.org/
 Source0:        http://www.viewvc.org/%{name}-%{version}.tar.gz
 Source1:        viewvc.conf
 Source2:        README.httpd
+Source3:        viewvc-lexer-mimetypes.py 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Obsoletes:      %{name}-selinux < 1.0.3-13
 Conflicts:      selinux-policy < 2.5.10-2
 
 BuildArch:      noarch
-BuildRequires:  python-devel >= 2.0
+BuildRequires:  python-devel >= 2.0, python-pygments
 Requires:       webserver, rcs, diffutils
 Requires:       subversion >= 1.2
 Requires:       cvsgraph
@@ -79,6 +80,10 @@ with decent performance when run under A
 %{__rm} -f %{buildroot}%{python_sitelib}/viewvc/viewvc.conf
 %{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/cvsgraph.conf %{buildroot}%{_sysconfdir}/viewvc/cvsgraph.conf
 %{__rm} -f %{buildroot}%{python_sitelib}/viewvc/cvsgraph.conf
+%{__install} -Dp -m0644 %{buildroot}%{python_sitelib}/viewvc/mimetypes.conf %{buildroot}%{_sysconfdir}/viewvc/mimetypes.conf
+%{__rm} -f %{buildroot}%{python_sitelib}/viewvc/mimetypes.conf
+
+%{SOURCE3} >> %{buildroot}%{_sysconfdir}/viewvc/mimetypes.conf
 
 # Install Apache configuration and README
 %{__sed} -e s,__datadir__,%{_datadir}, \
@@ -113,6 +118,10 @@ with decent performance when run under A
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/viewvc.conf
 
 %changelog
+* Tue Aug 11 2009 Bojan Smojver <bojan at rexursive.com> - 1.1.1-3
+- install mimetypes.conf
+- populate mimetypes.conf with what pygments understands
+
 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.1.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 




More information about the scm-commits mailing list