#!/usr/bin/python """ Small example filter: make sure the templates of spec files are not stored in the database """ # 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 Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Copyright 2004 Dries Verachtert # The rpmforge subversion also contains some templates of spec files and we do not want them in # the database. This filter only accepts SpecRepositorySpecFile objects which do not match # any of the tempate spec files. def NoRpmforgeTemplatesFilter(specRepoSpecFile): #print "called with obj " + str(specRepoSpecFile) # needs to be converted to 1 encoding otherencodings = ["a52dec.spec","acroread.spec","akfquiz.spec","avifile.spec","bind.spec","bluez-bluefw.spec","dd2.spec","directfb.spec","easytag2.spec","easytag.spec","echoping.spec","fslint.spec","gambas-dag.spec","gambas.spec","gammu.spec","gcombust.spec","gkrellm.spec","gkrellm-plugins.spec","gnomeradio.spec","gpm.spec","grip.spec","Gtk-Perl.spec","gtoaster.spec","id3lib.spec","ifstat.spec","ipw2100-firmware.spec","ipw2200-firmware.spec","lftp.spec","libbraille.spec","libdvdread.spec","libsnack.spec","libtar.spec","libtc.spec","libXvMCW.spec","lumiere.spec","mc.spec","memcached.spec","micq.spec","mod_gzip.spec","netscape4.spec","netspeed_applet.spec","ogle_gui.spec","ogle.spec","ogmtools.spec","oidentd.spec","partimage-0.6.spec","partimage.spec","perl-RPM-Specfile.spec","perl-Text-Unaccent.spec","perl-XML-SAX.spec","pine.spec","pointless.spec","qemu.spec","rte.spec","sendmail-old.spec","sendmail.spec","spit.spec","sqlitemanager.spec","tcpreen.spec","transcode.spec","unrar.spec","uudeview.spec","xine-skins.spec","xmame-roms.spec","xmms.spec","xmule.spec","xvattr.spec","zapping.spec"] fn = specRepoSpecFile.getFileName() if fn in otherencodings: return False if fn == "_template.spec" or fn == "_template-fr.spec" or fn == "_perl-template.spec": return False else: return True