#!/usr/bin/python -t # -*- mode: Python; indent-tabs-mode: nil; -*- # # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import errno, os, sys import Utils def do_repoview(cfg,dist,repodir,title,sources=False): print 'Generating repoview in %s' % repodir # This option requires a modified repoview script! if sources: if dist == 'development': # hack for rawhide/releases repo path scheme srcpath = '-s ../../../source/SRPMS' else: srcpath = '-s ../../SRPMS' else: srcpath = '' cmd = '%s -t \"%s\" %s %s' % (cfg.repoview,title,srcpath,repodir) Utils.run_and_check(cmd) def main(cfg,dist): title = cfg.project_hr+' %s Source RPM Packages'%dist repodir = Utils.srpm_repodir(cfg,dist) do_repoview(cfg,dist,repodir,title) # arch repo creation for arch in cfg.archdict[dist]: title = cfg.project_hr+' %s (%s)'%(dist,arch) repodir = Utils.rpm_repodir(cfg,dist,arch) do_repoview(cfg,dist,repodir,title,True) if __name__ == '__main__': if len(sys.argv) < 3: print 'Usage: %s [release]...\n' % os.path.basename(sys.argv[0]) sys.exit(errno.EINVAL) cfg = Utils.load_config_module(sys.argv[1]) me = os.getcwd() Utils.signer_gid_check(cfg.signersgid) os.umask(cfg.signersumask) for dist in sys.argv[2:]: if not cfg.archdict.has_key(dist): print "No distribution release named '%s' found" % dist continue main(cfg,dist) os.chdir(me)