extras-buildsys/utils/pushscript RCNeedsign.py,NONE,1.1

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Wed Feb 28 23:18:19 UTC 2007


Author: mschwendt

Update of /cvs/fedora/extras-buildsys/utils/pushscript
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28863

Added Files:
	RCNeedsign.py 
Log Message:
Work-in-progress test script that runs extras-repoclosure for
a given dist release *including* unreleased packages in the needsign
queue.



--- NEW FILE RCNeedsign.py ---
#!/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

## Run extras-repoclosure for a given dist release *including*
## packages in the needsign queue. Mail findings only to the package
## owners.

import errno, os, sys
import fnmatch, shutil, time

import Utils, Push, WhatsNew, RepoSupport
from BuildSys import LocalPlague


if __name__ == '__main__':
    if len(sys.argv) < 2:
        print 'Usage: %s <project> <release>\n' % os.path.basename(sys.argv[0])
        sys.exit(errno.EINVAL)

    cfg = Utils.load_config_module(sys.argv[1])
    os.umask(cfg.signersumask)
    Utils.signer_gid_check(cfg.signersgid)

    dist = sys.argv[2]
    distdir = '%s-%s-%s' % (cfg.distro, dist, cfg.project)
    needsignroot = os.path.join(cfg.stagesdir, distdir)
    
    br = LocalPlague(needsignroot)
    br.PruneBuildResults()  # optional
    results = br.GetBuildResults()
    for br in results:
        br.origin = None  # disconnect from needsign (very important!)

    import tempfile
    print 'Installing into temporary repository:'
    Push.cfg = cfg
    Push.srpmlocdict = {}
    tmpdir = tempfile.mkdtemp('','tmp-repo-')
    tmprepo = os.path.join(tmpdir,dist)
    os.makedirs(tmprepo)
    Utils.make_std_repodirs(cfg,dist,tmprepo)
    try:
        WhatsNew.load(cfg.rundir)
        for br in results:
            Push.push(br,dist,tmprepo,False)
        for arch in cfg.archdict[dist]:
            Utils.create_repository(cfg,os.path.join(tmprepo,arch),False)
    except: # everything is fatal
        print 'ERROR: Creating temporary working copy failed.'
        shutil.rmtree(tmpdir)
        raise

    cmd = '/srv/extras-push/work/extras-repoclosure/rc-run.py --mail=owners --needsign=file://%s %s' % (tmpdir+'/%s/%s/',dist)
    print 'Running', cmd
    rc = os.system(cmd)

    shutil.rmtree(tmpdir)
    sys.exit(0)




More information about the scm-commits mailing list