auto-import changelog data from gettext-0.10.38-4.src.rpm
Thu Jul 19 2001 Trond Eivind Glomsrd <teg@redhat.com> - New msghack - from scratch, in python Tue Jul 17 2001 Trond Eivind Glomsrd <teg@redhat.com> - msghack is back Mon Jun 04 2001 Trond Eivind Glomsrd <teg@redhat.com> - Include some docfiles Sun Jun 03 2001 Florian La Roche <Florian.LaRoche@redhat.de> - 0.10.38 - do not include charset.alias Wed May 02 2001 Nalin Dahyabhai <nalin@redhat.com> - Build statically. Mon Apr 30 2001 Trond Eivind Glomsrd <teg@redhat.com> - 0.10.37 - Disable all but two patches
This commit is contained in:
parent
eeb8d5ea83
commit
2b5159386c
@ -1 +1 @@
|
||||
gettext-0.10.35.tar.gz
|
||||
gettext-0.10.38.tar.gz
|
||||
|
49
gettext.spec
49
gettext.spec
@ -1,11 +1,12 @@
|
||||
Summary: GNU libraries and utilities for producing multi-lingual messages.
|
||||
Name: gettext
|
||||
Version: 0.10.35
|
||||
Release: 31
|
||||
Version: 0.10.38
|
||||
Release: 4
|
||||
License: GPL
|
||||
Group: Development/Tools
|
||||
Source: ftp://ftp.gnu.org/gnu/gettext/%{name}-%{version}.tar.gz
|
||||
Source1: po-mode-init.el
|
||||
Source2: msghack.py
|
||||
Patch0: gettext-0.10-misc.patch
|
||||
Patch1: gettext-0.10.35-jbj.patch
|
||||
Patch2: gettext-0.10.35-arm.patch
|
||||
@ -15,8 +16,10 @@ Patch5: gettext-0.10.35-buildroot.patch
|
||||
Patch6: gettext-0.10.35-destdir.patch
|
||||
Patch7: gettext-0.10.35-drepper.patch
|
||||
Patch8: gettext-0.10.35-oka-plus.patch
|
||||
Patch9: gettext-0.10.38-msghack.patch
|
||||
Prereq: /sbin/install-info
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-droot
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-root
|
||||
BuildRequires: emacs
|
||||
|
||||
%description
|
||||
The GNU gettext package provides a set of tools and documentation for
|
||||
@ -34,23 +37,13 @@ programs.
|
||||
%prep
|
||||
rm -rf %{buildroot}
|
||||
%setup -q
|
||||
#%patch0 -p1 -b .misc
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1 -b .buildroot
|
||||
%patch6 -p0
|
||||
%patch7 -p1
|
||||
%patch8 -p1 -b .oka
|
||||
#patch9 -p1
|
||||
|
||||
%build
|
||||
libtoolize --copy --force
|
||||
aclocal
|
||||
automake
|
||||
autoconf
|
||||
export EMACS=emacs
|
||||
%configure --enable-shared --with-included-gettext
|
||||
%configure --disable-shared --with-included-gettext
|
||||
make
|
||||
|
||||
%install
|
||||
@ -63,11 +56,10 @@ rm -rf %{buildroot}
|
||||
mkdir -p %{buildroot}/bin
|
||||
mv %{buildroot}/%{_bindir}/gettext %{buildroot}/bin
|
||||
ln -s ../../bin/gettext %{buildroot}/%{_bindir}/gettext
|
||||
install -m 755 %SOURCE2 $RPM_BUILD_ROOT/%{_bindir}/msghack
|
||||
|
||||
pushd %{buildroot}
|
||||
rm -f .%{_infodir}/dir .%{_includedir}/libintl.h
|
||||
gzip -9nf .%{_infodir}/*
|
||||
strip .%{_bindir}/* || :
|
||||
popd
|
||||
|
||||
pushd %{buildroot}/%{_datadir}/locale
|
||||
@ -95,14 +87,37 @@ exit 0
|
||||
|
||||
%files -f trans.list
|
||||
%defattr(-,root,root)
|
||||
%doc ABOUT-NLS AUTHORS BUGS COPYING DISCLAIM README
|
||||
%doc README-alpha NEWS THANKS TODO
|
||||
/bin/*
|
||||
%{_bindir}/*
|
||||
%{_infodir}/*
|
||||
#%config %{_libdir}/charset.alias
|
||||
%{_datadir}/gettext
|
||||
%{_datadir}/aclocal/*
|
||||
%{_datadir}/emacs/site-lisp/*
|
||||
|
||||
%changelog
|
||||
* Thu Jul 19 2001 Trond Eivind Glomsrød <teg@redhat.com>
|
||||
- New msghack - from scratch, in python
|
||||
|
||||
* Tue Jul 17 2001 Trond Eivind Glomsrød <teg@redhat.com>
|
||||
- msghack is back
|
||||
|
||||
* Mon Jun 4 2001 Trond Eivind Glomsrød <teg@redhat.com>
|
||||
- Include some docfiles
|
||||
|
||||
* Sun Jun 03 2001 Florian La Roche <Florian.LaRoche@redhat.de>
|
||||
- 0.10.38
|
||||
- do not include charset.alias
|
||||
|
||||
* Wed May 2 2001 Nalin Dahyabhai <nalin@redhat.com>
|
||||
- Build statically.
|
||||
|
||||
* Mon Apr 30 2001 Trond Eivind Glomsrød <teg@redhat.com>
|
||||
- 0.10.37
|
||||
- Disable all but two patches
|
||||
|
||||
* Sun Feb 25 2001 Trond Eivind Glomsrød <teg@redhat.com>
|
||||
- Initialize proper fonts when entering po-mode (#29152)
|
||||
|
||||
|
299
msghack.py
Executable file
299
msghack.py
Executable file
@ -0,0 +1,299 @@
|
||||
#!/usr/bin/python
|
||||
## Copyright (C) 2001 Red Hat, Inc.
|
||||
## Copyright (C) 2001 Trond Eivind Glomsrød <teg@redhat.com>
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
"""
|
||||
A msghack replacement
|
||||
"""
|
||||
|
||||
|
||||
import string
|
||||
import sys
|
||||
|
||||
class GTMessage:
|
||||
"""
|
||||
A class containing a message, its msgid and various references pointing at it
|
||||
"""
|
||||
|
||||
def __init__(self,id=None,message=None,refs=[]):
|
||||
"""
|
||||
The constructor for the GTMessage class
|
||||
@self The object instance
|
||||
@message The message
|
||||
@id The messageid associated with the object
|
||||
"""
|
||||
self._message=string.strip(message)
|
||||
self._id=string.strip(id)
|
||||
self._refs=[]
|
||||
for ref in refs:
|
||||
self._refs.append(ref)
|
||||
|
||||
def __str__(self):
|
||||
"""
|
||||
Return a string representation of the object
|
||||
@self The object instance
|
||||
"""
|
||||
res=""
|
||||
for ref in self._refs:
|
||||
res=res+ref+"\n"
|
||||
res=res+"msgid \"%s\"\nmsgstr \"%s\"\n" % (self._id,self._message)
|
||||
return res
|
||||
|
||||
def invertedStrings(self):
|
||||
"""
|
||||
Returns a string representation, but with msgid and msgstr inverted
|
||||
@self The object instance
|
||||
"""
|
||||
res=""
|
||||
for ref in self._refs:
|
||||
res=res+ref+"\n"
|
||||
res=res+"msgid \"%s\"\nmsgstr \"%s\"\n" % (self._message,self._id)
|
||||
return res
|
||||
|
||||
def emptyMsgStrings(self):
|
||||
"""
|
||||
Return a string representation of the object, but leave the msgstr
|
||||
empty - create a pot file from a po file
|
||||
@self The object instance
|
||||
"""
|
||||
res=""
|
||||
for ref in self._refs:
|
||||
res=res+ref+"\n"
|
||||
res=res+"msgid \"%s\"\nmsgstr \"\"\n" % (self._id)
|
||||
return res
|
||||
|
||||
class GTMasterMessage:
|
||||
"""
|
||||
A class containing a message, its msgid and various references pointing at it
|
||||
The difference between GTMessage and GTMasterMessage is that this class
|
||||
can do less operations, but is able to store multiple msgstrs with identifiers
|
||||
(usually language, like 'msgst(no)'
|
||||
"""
|
||||
|
||||
def __init__(self,id=None,refs=[]):
|
||||
"""
|
||||
The constructor for the GTMessage class
|
||||
@self The object instance
|
||||
@id The messageid associated with the object
|
||||
"""
|
||||
self._id=id
|
||||
self._refs=[]
|
||||
self._messages=[]
|
||||
for ref in refs:
|
||||
self._refs.append(ref)
|
||||
|
||||
def addMessage(self,message,identifier):
|
||||
"""
|
||||
Add a new message and identifier to the GTMasterMessage object
|
||||
@self The object instance
|
||||
@message The message to append
|
||||
@identifier The identifier of the message
|
||||
"""
|
||||
self._messages.append((identifier,message))
|
||||
|
||||
def __str__(self):
|
||||
"""
|
||||
Return a string representation of the object
|
||||
@self The object instance
|
||||
"""
|
||||
res=""
|
||||
for ref in self._refs:
|
||||
res=res+ref+"\n"
|
||||
res=res+"msgid \"%s\"\n" % self._id
|
||||
for message in self._messages:
|
||||
res=res+"msgstr(%s) \"%s\"\n" %(message[0],message[1])
|
||||
res=res+"\n"
|
||||
return res
|
||||
|
||||
class GTFile:
|
||||
"""
|
||||
A class containing the GTMessages contained in a file
|
||||
"""
|
||||
|
||||
def __init__(self,filename):
|
||||
"""
|
||||
The constructor of the GTMFile class
|
||||
@self The object instance
|
||||
@filename The file to initialize from
|
||||
"""
|
||||
self._filename=filename
|
||||
self._messages=[]
|
||||
self.readFile(filename)
|
||||
|
||||
def __str__(self):
|
||||
"""
|
||||
Return a string representation of the object
|
||||
@self The object instance
|
||||
"""
|
||||
res=""
|
||||
for message in self._messages:
|
||||
res=res+str(message)+"\n"
|
||||
return res
|
||||
|
||||
def invertedStrings(self):
|
||||
"""
|
||||
Return a string representation of the object, with msgid and msgstr
|
||||
swapped
|
||||
@self The object instance
|
||||
"""
|
||||
res=""
|
||||
for message in self._messages:
|
||||
res=res+message.invertedStrings()+"\n"
|
||||
return res
|
||||
|
||||
def getMsgstr(self,msgid):
|
||||
"""
|
||||
Return the msgstr matching the given id. 'None' if missing
|
||||
@self The object instance
|
||||
@msgid The msgid key
|
||||
"""
|
||||
|
||||
for message in self._messages:
|
||||
if msgid == message._id:
|
||||
return message._message
|
||||
return None
|
||||
|
||||
def emptyMsgStrings(self):
|
||||
"""
|
||||
Return a string representation of the object, but leave the msgstr
|
||||
empty - create a pot file from a po file
|
||||
@self The object instance
|
||||
"""
|
||||
|
||||
res=""
|
||||
for message in self._messages:
|
||||
res=res+message.emptyMsgStrings()+"\n"
|
||||
return res
|
||||
|
||||
def readFile(self,filename):
|
||||
"""
|
||||
Read the contents of a file into the GTFile object
|
||||
@self The object instance
|
||||
@filename The name of the file to read
|
||||
"""
|
||||
|
||||
file=open(filename,"r")
|
||||
msgid=""
|
||||
msgstr=""
|
||||
refs=[]
|
||||
lines=[]
|
||||
inmsgid=0
|
||||
inmsgstr=0
|
||||
templines=file.readlines()
|
||||
for line in templines:
|
||||
lines.append(string.strip(line))
|
||||
for line in lines:
|
||||
pos=string.find(line,'"')
|
||||
pos2=string.rfind(line,'"')
|
||||
if line and line[0]=="#":
|
||||
refs.append(string.strip(line))
|
||||
if inmsgstr==0 and line[:6]=="msgstr":
|
||||
msgstr=""
|
||||
inmsgstr=1
|
||||
inmsgid=0
|
||||
if inmsgstr==1:
|
||||
if pos==-1:
|
||||
inmsgstr=0
|
||||
message=GTMessage(msgid,msgstr,refs)
|
||||
self._messages.append(message)
|
||||
msgstr=""
|
||||
msgid=""
|
||||
refs=[]
|
||||
else:
|
||||
msgstr=msgstr+line[pos+1:pos2]+"\n"
|
||||
if inmsgid==0 and line[:5]=="msgid":
|
||||
msgid=""
|
||||
inmsgid=1
|
||||
if inmsgid==1:
|
||||
if pos==-1:
|
||||
inmsgid=0
|
||||
else:
|
||||
msgid=msgid+line[pos+1:pos2]+"\n"
|
||||
if msgstr and msgid:
|
||||
message=GTMessage(msgid,msgstr)
|
||||
self._messages.append(message)
|
||||
|
||||
|
||||
class GTMaster:
|
||||
"""
|
||||
A class containing a master catalogue of gettext dictionaries
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self,dicts):
|
||||
"""
|
||||
The constructor for the GTMaster class
|
||||
@self The object instance
|
||||
@dicts An array of dictionaries to merge
|
||||
"""
|
||||
self._messages=[]
|
||||
self.createMaster(dicts)
|
||||
|
||||
def createMaster(self,dicts):
|
||||
"""
|
||||
Create the master catalogue
|
||||
@self The object instance
|
||||
@dicts An array of dictionaries to merge
|
||||
"""
|
||||
|
||||
self._master=dicts[0]
|
||||
self._dicts=dicts[1:]
|
||||
|
||||
for message in self._master._messages:
|
||||
gtm=GTMasterMessage(message._id,message._refs)
|
||||
gtm.addMessage(message._message,self._master._filename[:-3])
|
||||
for dict in self._dicts:
|
||||
res=dict.getMsgstr(message._id)
|
||||
if(res):
|
||||
gtm.addMessage(res,dict._filename[:-3])
|
||||
self._messages.append(gtm)
|
||||
|
||||
def __str__(self):
|
||||
"""
|
||||
Return a string representation of the object
|
||||
@self The object instance
|
||||
"""
|
||||
res=""
|
||||
for message in self._messages:
|
||||
res=res+str(message)+"\n"
|
||||
return res
|
||||
|
||||
|
||||
if __name__=="__main__":
|
||||
if("--invert") in sys.argv:
|
||||
file=sys.argv[sys.argv.index("--invert")+1]
|
||||
gtf=GTFile(file)
|
||||
print gtf.invertedStrings()
|
||||
sys.exit(0)
|
||||
if("--empty") in sys.argv:
|
||||
file=sys.argv[sys.argv.index("--empty")+1]
|
||||
gtf=GTFile(file)
|
||||
print gtf.emptyMsgStrings()
|
||||
sys.exit(0)
|
||||
if("--master") in sys.argv:
|
||||
loc=sys.argv.index("--master")+1
|
||||
gtfs=[]
|
||||
for file in sys.argv[loc:]:
|
||||
gtfs.append(GTFile(file))
|
||||
|
||||
master=GTMaster(gtfs)
|
||||
print master
|
||||
sys.exit(0)
|
||||
|
||||
print "Not implemented: "+`sys.argv`
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user