2 commits - java/code java/spacewalk-java.spec rel-eng/packages
by Mike McCune
java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml | 6 ++--
java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java | 15 ++++++++++
java/spacewalk-java.spec | 5 ++-
rel-eng/packages/spacewalk-java | 2 -
4 files changed, 23 insertions(+), 5 deletions(-)
New commits:
commit e58121cbd40d047700e8875714588215ed0b8c1e
Author: Mike McCune <mmccune(a)gmail.com>
Date: Mon Mar 30 15:29:18 2009 -0700
Automatic commit of package [spacewalk-java] release [0.5.43-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index a6423ce..37a3bf9 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -10,7 +10,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 0.5.42
+Version: 0.5.43
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -235,7 +235,8 @@ fi
%attr(644, root, root) %{_datadir}/rhn/lib/rhn.jar
%changelog
-* Mon Mar 30 2009 Mike McCune <mmccune(a)gmail.com> 0.5.42-1
+* Mon Mar 30 2009 Mike McCune <mmccune(a)gmail.com> 0.5.43-1
+- 472595 - ported query forgot to check child channels
- 144325 - converting system probe list to the new list tag, featuring all the bells and
whistles the new list tag has to offer
- 492478 - modifying the system applicable errata page so that you can filter on the
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 29807a7..f6db4d9 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-0.5.42-1 java/
+0.5.43-1 java/
commit 862a56d78734d05e93fdc2d9eafaf3b36ead96ed
Author: Mike McCune <mmccune(a)gmail.com>
Date: Mon Mar 30 15:25:33 2009 -0700
472595 - ported query forgot to check child channels
diff --git a/java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml b/java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml
index 3a53ab8..c6803d5 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml
@@ -291,8 +291,10 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
FROM rhnPackage {p}
left join rhnSolarisPatchSet P_2_ on p.id = P_2_.package_id
left join rhnSolarisPatch P_1_ on p.id = P_1_.package_id,
- rhnChannelPackage CP
- WHERE CP.channel_id = :channel_id
+ rhnChannelPackage CP,
+ rhnChannel C
+ WHERE (C.id = :channel_id OR C.parent_channel = :channel_id)
+ AND (CP.channel_id = C.id OR CP.channel_id = C.parent_channel)
AND CP.package_id = P.id
AND P.path LIKE :pathlike
]]>
diff --git a/java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java b/java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java
index 70a94d8..dca4ede 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java
@@ -362,5 +362,20 @@ public class ChannelFactoryTest extends RhnBaseTestCase {
fileName);
assertNotNull(lookedUp);
assertEquals(p.getId(), lookedUp.getId());
+
+ // Test in child channel.
+ Channel child = ChannelTestUtils.createChildChannel(user, channel);
+ Package cp = PackageManagerTest.addPackageToChannel("some-package-child", child);
+ String fileNameChild = "some-package-child-2.13.1-6.fc9.x86_64.rpm";
+ cp.setPath("redhat/1/c7d/some-package-child/2.13.1-6.fc9/" +
+ "x86_64/c7dd5e9b6975bc7f80f2f4657260af53/" +
+ fileNameChild);
+
+ Package lookedUpChild = ChannelFactory.lookupPackageByFilename(channel,
+ fileNameChild);
+ assertNotNull(lookedUpChild);
+ assertEquals(cp.getId(), lookedUpChild.getId());
+
+
}
}
15 years
rel-eng/bin
by Dennis Gilmore
rel-eng/bin/sign_unsigned.py | 739 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 739 insertions(+)
New commits:
commit 759e33b2164c91f3cbc7e7196e53f4671c23e407
Author: Dennis Gilmore <dennis(a)ausil.us>
Date: Mon Mar 30 15:12:48 2009 -0500
add sign_unsigned.py to sign our packages
diff --git a/rel-eng/bin/sign_unsigned.py b/rel-eng/bin/sign_unsigned.py
new file mode 100755
index 0000000..5da2af1
--- /dev/null
+++ b/rel-eng/bin/sign_unsigned.py
@@ -0,0 +1,739 @@
+#!/usr/bin/python2
+
+# copied from fedora releng git
+# modified by Dennis Gilmore for spacewalk needs.
+#
+# Copyright (c) 2009 Red Hat
+
+import base64
+import koji
+import md5
+import os
+import os.path
+import shutil
+import sys
+import tempfile
+import time
+import optparse
+import inspect
+import getpass
+
+# AbstractTool class
+# parent for all classes, just to define the options only once
+#
+# Copyright (c) 2006 Red Hat
+#
+# Authors:
+# Daniel Mach <dmach(a)redhat.com>
+
+class AbstractTool:
+ def __init__(self):
+ # create 'options' instance just once
+ if not hasattr(self, 'options'):
+ self.options = optparse.Values()
+
+ # fill some default values
+ self.options.verbose = False
+ self.options.debug = False
+ self.options.show_time = False
+ self.options.retries = 5
+
+# CliTool
+# Copyright (c) 2006 Red Hat
+#
+# Authors:
+# Daniel Mach <dmach(a)redhat.com>
+
+class CliTool(AbstractTool):
+
+ def __init__(self, opts=None):
+ AbstractTool.__init__(self)
+
+ # option parser
+ usage = "%prog [help] <command> [options and arguments] ...]"
+ self.parser = optparse.OptionParser(usage)
+
+ self.parser.add_option("-v", "--verbose", action="store_true", default=False,
+ help="Increase verbosity")
+ self.parser.add_option("-d", "--debug", action="store_true", default=False,
+ help="Show debug output")
+ self.parser.add_option("-Y", "--yes", action="store_true", default=False,
+ help="Answer 'yes' for all [y/N] questions. Use carefully!")
+
+
+
+ ################################################################################
+ # methods for printing to the output
+
+ def print_msg(self, msg):
+ if self.options.show_time:
+ print "%s %s" % (time.asctime(), msg)
+ else:
+ print msg
+
+
+ def print_verbose(self, msg):
+ if self.options.verbose or self.options.debug:
+ self.print_msg(msg)
+
+
+ def print_debug(self, msg):
+ if self.options.debug:
+ self.print_msg("DEBUG: %s" % (msg))
+
+
+ def process_cmd_options(self):
+ command = 'default'
+
+ # first argument is the command; it cannot begin begin with '-'
+ if len(sys.argv) > 1 and not sys.argv[1].startswith('-'):
+ command = sys.argv[1]
+ del sys.argv[1]
+
+# # replace '-' by '_'
+# command = command.replace('-', '_')
+
+ # add command-specific options
+ self.run_options(command, self.parser)
+
+ # parse arguments
+ (opts, args) = self.parser.parse_args()
+
+ opts.options = args
+ opts.command = command
+
+ # copy opts to self.options
+ self.options.__dict__.update(opts.__dict__)
+
+ self.print_debug('command is "%s"' % command)
+
+
+
+ ################################################################################
+ # check_admin
+ #
+ # checks if the user is admin
+ # override to make it really work
+
+ def check_admin(self):
+ return False
+
+
+
+ ################################################################################
+ # userconfirm
+ #
+ # gets a yes or no from the user, defaults to No
+ # this function is originally from yum
+
+ def userconfirm(self):
+ # skip the question and answer 'yes' automatically
+ if (self.options.yes):
+ return True
+
+ while True:
+ choice = raw_input('Is this ok? [y/N]: ')
+ choice = choice.lower()
+ if len(choice) == 0 or choice[0] in ['y', 'n']:
+ break
+
+ if len(choice) == 0 or choice[0] != 'y':
+ return False
+
+ return True
+
+
+
+ ################################################################################
+ # getuserpass
+ #
+ # prompt user for his password
+ # if 'defaultPass' is set, no prompt will be done and 'defaultPass' is returned
+
+ def getuserpass(self, prompt=None, defaultPass=None):
+ if defaultPass != None:
+ return defaultPass
+
+ if prompt == None:
+ prompt = "Enter your password: "
+
+ return getpass.getpass(prompt)
+
+
+
+ ################################################################################
+ # default command
+ #
+ # default action when no (or wrong) command is going to be executed
+ # override if you need some custom default action handling
+ # can be used also to handle scripts with no commands
+
+ def parse_default(self):
+ pass
+
+
+ def help_default(self):
+ return "Error: command '%s' not found.\n" % self.options.command + \
+ "Use 'help' command to get help."
+
+
+ def cmd_default(self):
+ print self.help_default()
+ sys.exit(1)
+
+
+
+ ################################################################################
+ # help command
+ #
+ # just handle everything about help ;)
+
+ def parse_help(self):
+ self.options.help = self.options.options
+
+
+ def help_help(self):
+ return "Print this help."
+
+
+ def cmd_help(self):
+ self.parser.print_help()
+ commands = {}
+
+ # help for all commands
+ result = "\ncommands:\n"
+ for (key, value) in inspect.getmembers(self):
+ if key != "cmd_commands" and key != "cmd_default":
+ if key.startswith('cmd_'):
+ # admin commands have greater priority, skip the normal ones
+ if not commands.has_key(key[4:]):
+ commands[key[4:]] = ' '
+ elif key.startswith('admincmd_'):
+ if not self.check_admin():
+ continue
+ # mark admin commands with '*'
+ commands[key[9:]] = '*'
+
+ commandlist = commands.keys()
+ commandlist.sort()
+
+ for cmd in commandlist:
+ parser = optparse.OptionParser()
+ self.run_options(cmd, parser)
+
+ # remove 'help' option
+ parser.remove_option('-h')
+
+ parser.formatter.indent()
+ parser.formatter.indent()
+
+ # this ugly command splits the option help and joins it excluding the first line (containing 'options:')
+ result += "\n".join(parser.format_option_help().split('\n')[1:])
+
+ help = self.run_help(cmd)
+ usage = self.run_usage(cmd)
+ result += "%s %-21s %-45s %-30s\n" % (commands[cmd], cmd.replace('_', '-'), usage, help)
+ print result
+
+
+
+ ################################################################################
+ # run_* commands
+
+ def run_help(self, command):
+ help = getattr(self, 'help_%s' % command, None)
+ if callable(help):
+ return help()
+ return ""
+
+
+ def run_usage(self, command):
+ help = getattr(self, 'usage_%s' % command, None)
+ if callable(help):
+ return help()
+ return ""
+
+
+ def run_options(self, command, optparser):
+ opts = getattr(self, 'options_%s' % command, None)
+ if callable(opts):
+ opts(optparser)
+
+
+ def run_parse(self, command):
+ parse = getattr(self, 'parse_%s' % command, None)
+ if callable(parse):
+ parse()
+
+
+ def run_command(self, command=None):
+ if command == None:
+ command = self.options.command.replace('-', '_')
+
+ # get command-specific options
+# self.run_options(command, self.parser)
+
+ # parse arguments for given command
+ self.run_parse(command)
+
+
+ # try to run the ADMIN command (method: admincmd_*)
+ if self.check_admin():
+ cmd = getattr(self, 'admincmd_%s' % command, None)
+ if callable(cmd):
+ cmd()
+ return
+
+ # try to run the command (method: cmd_*)
+ cmd = getattr(self, 'cmd_%s' % command, None)
+ if callable(cmd):
+ cmd()
+ return
+
+ # try to run the 'default' command
+ cmd = getattr(self, 'cmd_default')
+ if callable(cmd):
+ cmd()
+ return
+
+ # die if everything fails
+ self.print_msg("ERROR: cannot run command '%s'!" % command.replace('_', '-'))
+ self.print_msg("ERROR: There's definitely something wrong with the script, even the default command handler is missing!")
+ sys.exit(1)
+
+# KojiTool class
+# interface to Koji
+#
+# Copyright (c) 2007 Red Hat
+#
+# Authors:
+# Daniel Mach <dmach(a)redhat.com>
+# Jesse Keating <jkeating(a)redhat.com>
+
+class KojiTool(AbstractTool):
+ def __init__(self,):
+ AbstractTool.__init__(self)
+ self.options.debug_xmlrpc = False
+ self.options.password = None
+ self.options.user = None
+ self.options.kojihub = 'http://koji.rhndev.redhat.com/kojihub'
+ self.options.regex = False
+ self.options.ignore = []
+
+ def create_koji_session(self):
+ # used options: debug, debug_xmlrpc, user, password
+ self.koji_session = koji.ClientSession(self.options.kojihub, self.options.__dict__)
+
+ def close_koji_session(self):
+ self.koji_session.logout()
+
+ def get_latest_rpms(self, tag, archlist, pkglist=[None]):
+ result = []
+ for pkg in pkglist:
+ for arch in archlist:
+ self.print_debug("Getting latest for %s (%s-%s)" % (tag, pkg, arch))
+ rpmlist, buildlist = self.koji_session.getLatestRPMS(tag, package=pkg, arch=arch)
+ self.print_debug("Got %s rpms (%s builds)" % (len(rpmlist), len(buildlist)))
+ for rpm in rpmlist:
+ rpm['tag'] = tag
+ rpm['filename'] = '%s-%s-%s.%s.rpm' % (rpm['name'], rpm['version'], rpm['release'], rpm['arch'])
+ rpm['name-arch'] = '%s-%s' % (rpm['name'], rpm['arch'])
+ result.append(rpm)
+ return result
+
+ def pattern_match(self, x, patternlist):
+ '''
+ determine if x matches some pattern from patternlist
+ this function switches between glob and regex matching, depending on options
+ '''
+
+ # patternlist must be a list of patterns -> convert single pattern to a list
+ if not isinstance(patternlist, list):
+ patternlist = [patternlist]
+
+ for pattern in patternlist:
+ if self.options.regex:
+ # use RE matching
+ if re.compile(pattern).match(x):
+ return True
+ else:
+ # use glob matching
+ if fnmatch.fnmatchcase(x, pattern):
+ return True
+
+ # nothing matched
+ return False
+
+class SignUnsigned(CliTool, KojiTool):
+ def __init__(self):
+ CliTool.__init__(self)
+ KojiTool.__init__(self)
+
+ self.parser.add_option("--builds", action="store_true")
+ self.parser.add_option("--exact", action="store_true")
+ self.parser.add_option("--inherit", action="store_true")
+ self.parser.add_option("--just-show", action="store_true") # deprecated
+ self.parser.add_option("--just-write-rpms", action="store_true")
+ self.parser.add_option("--level")
+ self.parser.add_option("--server", action="store_true")
+ self.parser.add_option("--test", action="store_true")
+ self.parser.add_option("--show-time", action="store_true")
+ self.parser.add_option("--workdir")
+ self.parser.add_option("--write-rpms", action="store_true")
+ self.gpg_keys = {'430A1C35': { 'name': 'spacewalk',
+ 'description': 'Spacewalk <spacewalk-devel(a)redhat.com>',
+ 'size': 1024 },
+ }
+ self.body_header_tags = ['siggpg', 'sigpgp']
+ self.head_header_tags = ['dsaheader', 'rsaheader']
+
+
+ def get_key_name(self, keyid):
+ return self.gpg_keys[keyid.upper()]['name']
+
+ def sig_level(self, sigs, level='spacewalk', exact=False):
+ """Check if signature(s) satisfy required level"""
+
+ orderings = [['spacewalk']]
+ if not sigs:
+ return False
+ sigs = [ x for x in sigs if x ]
+ if not sigs:
+ return False
+ for i in range(0, len(sigs)):
+ try:
+ sigs[i] = self.get_key_name(sigs[i])
+ except KeyError:
+ pass
+ if exact:
+ valid = [level]
+ else:
+ valid = None
+ for ordering in orderings:
+ if level in ordering:
+ valid = ordering[ordering.index(level):]
+ break
+ if not valid:
+ #raise RuntimeError, "could not find level %s" % level
+ valid = [level]
+ for lvl in valid:
+ if lvl.lower() in sigs or lvl.upper() in sigs:
+ return True
+ return False
+
+ def find_uncached(self, rpms, level='rawhide'):
+ """Return the rpms that do not have a cached signature of sufficient level"""
+ ret = []
+ self.print_debug("Reading signature data")
+ sigdata = []
+ self.koji_session.multicall = True
+ for rinfo in rpms:
+ self.koji_session.queryRPMSigs(rpm_id=rinfo['id'])
+ results = self.koji_session.multiCall()
+ for result in results:
+ sigdata.extend(result[0])
+ sig_idx = {}
+ #index by rpm and sigkey
+ self.print_debug("Indexing %d signatures" % len(sigdata))
+ for row in sigdata:
+ sig_idx.setdefault(row['rpm_id'], []).append(row['sigkey'])
+ i = 0
+ for rpminfo in rpms:
+ i += 1
+ self.print_debug("%d/%d: checking %s" % (i, len(rpms), self.rpm_nvra(rpminfo)))
+ sigs = sig_idx.get(rpminfo['id'], [])
+ self.print_debug("found sigs: %r" % sigs)
+ if not self.sig_level(sigs, level=level):
+ self.print_debug("uncached")
+ ret.append(rpminfo)
+ return ret
+
+ def rpm_path(self, rpminfo):
+ build = rpminfo['build']
+ return os.path.join(koji.pathinfo.build(build), koji.pathinfo.rpm(rpminfo))
+
+ def rpm_nvra(self, rpminfo):
+ return "%(name)s-%(version)s-%(release)s.%(arch)s" % rpminfo
+
+ def rip_sighdr(self, path):
+ sigkey = ""
+ sighdr = koji.rip_rpm_sighdr(path)
+ rawhdr = koji.RawHeader(sighdr)
+ sigpkt = rawhdr.get(koji.RPM_SIGTAG_GPG)
+ if not sigpkt:
+ sigpkt = rawhdr.get(koji.RPM_SIGTAG_PGP)
+ if sigpkt:
+ sigkey = koji.get_sigpacket_key_id(sigpkt)
+ return sighdr, sigkey
+
+ def write_sigs(self, rpmlist, sigkey):
+ self.koji_session.multicall = True
+ signable = False
+ for rpminfo in rpmlist:
+ x = os.path.join(koji.pathinfo.build(rpminfo['build']),
+ koji.pathinfo.signed(rpminfo, sigkey))
+ if not os.path.exists(x):
+ signable = True
+ if self.options.test:
+ self.print_msg("Would have written: %s" % x)
+ continue
+ self.koji_session.writeSignedRPM(rpminfo, sigkey)
+
+ if signable:
+ self.print_debug("Writing rpms...")
+ results = self.koji_session.multiCall()
+
+ for rpm, result in zip(rpmlist, results):
+ if isinstance(result, dict):
+ print "Error writing out %s" % self.rpm_nvra(rpm)
+
+ def write_sig(self, rpminfo, sigkey):
+ x = os.path.join(koji.pathinfo.build(rpminfo['build']),
+ koji.pathinfo.signed(rpminfo, sigkey))
+ if not os.path.exists(x):
+ if self.options.test:
+ self.print_msg("Would have written: %s" % x)
+ return
+ self.print_debug("Writing %s" % x)
+ try:
+ self.koji_session.writeSignedRPM(rpminfo, sigkey)
+ except koji.KojiError, e:
+ self.print_msg(e)
+
+ def import_sig(self, rpminfo, sighdr, sigkey):
+ previous = self.koji_session.queryRPMSigs(rpminfo['id'], sigkey=sigkey)
+ if previous:
+ sighash = md5.new(sighdr).hexdigest()
+ if previous[0]['sighash'] != sighash:
+ self.print_msg("Warning: signature hash mismatch: %s" % rpminfo)
+ else:
+ self.print_msg("Warning: signature already imported: %r" % previous)
+ elif self.options.test:
+ self.print_msg("Would have imported signature '%s' from %s" % (sigkey, self.rpm_nvra(rpminfo)))
+ else:
+ self.koji_session.addRPMSig(rpminfo['id'], base64.encodestring(sighdr))
+
+ def import_sigs(self, importdict, sigkey):
+ self.koji_session.multicall = True
+ for rpm in importdict.keys():
+ if self.options.test:
+ self.print_msg("Would have imported signature '%s' from %s" % (sigkey, importdict[rpm][2]))
+ else:
+ self.koji_session.addRPMSig(rpm, base64.encodestring(importdict[rpm][0]))
+
+ self.koji_session.multiCall()
+
+ def get_key_id(self, keyname):
+ for id, data in self.gpg_keys.items():
+ if keyname.lower() in (data.get('name', ""), data.get('signing_server_id', "")):
+ return id
+
+ def import_sig_from_files(self, rpminfos, level, workdir):
+ importdict = {}
+ # Verify that sigs are correct
+ for rpm in rpminfos:
+ src = self.rpm_path(rpm)
+ fn = "%s.rpm" % self.rpm_nvra(rpm)
+ path = "%s/%s" % (workdir, fn)
+ sighdr, sigkey = self.rip_sighdr(path)
+ if self.get_key_id(level).lower() != sigkey.lower():
+ self.print_msg("Error: unexpected signature key [%s], skipping import from %s" % (sigkey, path))
+ continue
+ importdict[rpm['id']] = (sighdr, sigkey.lower(), self.rpm_nvra(rpm))
+ self.import_sigs(importdict, self.get_key_id(level).lower())
+
+ def import_sig_from_file(self, rpminfo, path=None, level=None):
+ if path is None:
+ path = self.rpm_path(rpminfo)
+ sighdr, sigkey = self.rip_sighdr(path)
+ if level is not None:
+ #verify that signature is what we expect
+ if self.get_key_id(level).lower() != sigkey.lower():
+ self.print_msg("Error: unexpected signature key [%s], skipping import from %s" % (sigkey, path))
+ return
+ self.import_sig(rpminfo, sighdr, sigkey)
+
+ def try_import(self, rpms, level='rawhide'):
+ """See if the main copy of the rpm has the signature we need
+
+ If sufficient signature is found, it is imported
+ Returns the rpms still without needed signature
+ """
+ ret = []
+ for rpminfo in rpms:
+ path = self.rpm_path(rpminfo)
+ sighdr, sigkey = self.rip_sighdr(path)
+ self.print_debug("Current sig '%s' for %s" % (sigkey, path))
+ if self.sig_level([sigkey], level=level):
+ #key is sufficient, import it
+ self.import_sig(rpminfo, sighdr, sigkey)
+ else:
+ ret.append(rpminfo)
+ return ret
+
+ def get_key_id(self, keyname):
+ for id, data in self.gpg_keys.items():
+ if keyname.lower() in (data.get('name', ""), data.get('signing_server_id', "")):
+ return id
+
+ def get_key_description(self, keyid):
+ return self.gpg_keys.get(keyid.upper(), {}).get('description')
+
+ def get_signing_command(self, key, paths, server=False):
+ keyid = self.get_key_id(key)
+ if server:
+ ssid = self.gpg_keys[keyid].get('signing_server_id')
+ if not ssid:
+ raise RuntimeError, "%s is not set up for the signing server" % key
+ cmd = "rpm-sign --key=%s %s" % (ssid, ' '.join(paths))
+ else:
+ if self.gpg_keys[keyid]['size'] == 4096:
+ cmd = """rpm --define '__gpg_sign_cmd %%{__gpg} gpg --force-v3-sigs --digest-algo sha256 --batch --no-verbose --no-armor --passphrase-fd 3 --no-secmem-warning -u "%%{_gpg_name}" -sbo %%{__signature_filename} %%{__plaintext_filename}' --define '_gpg_name %s' --define '_signature gpg' --resign %s""" % (self.get_key_description(keyid), ' '.join(paths))
+ else:
+ cmd = "rpm --define '_gpg_name %s' --define '_signature gpg' --resign %s" % (self.get_key_description(keyid), ' '.join(paths))
+ return cmd
+
+ def do_signing(self, pathargs, level):
+ """Use rpm to sign packages"""
+ mypaths = list(pathargs)
+ while len(mypaths):
+ if self.options.server:
+ nlen = 25
+ else:
+ nlen = 1000
+ cmd = self.get_signing_command(level, mypaths[:nlen], server=self.options.server)
+ del mypaths[:nlen]
+ if self.options.test:
+ self.print_msg("would have run: %s" % cmd)
+ else:
+ self.print_debug("Running: %s" % cmd)
+ # loop in case password is mistyped
+ while os.system(cmd):
+ # sleep briefly (give user a chance to ctrl-C)
+ time.sleep(2)
+
+ def sign_to_cache(self, rpms, level):
+ """Sign and cache the signatures
+
+ We sign duplicate copies and import the signature headers. The original rpms
+ remain unchanged.
+ """
+ if not rpms:
+ self.print_debug("No unsigned rpms")
+ if not self.options.write_rpms:
+ return
+ if self.options.test:
+ self.print_msg("Would have signed:")
+ for rpminfo in rpms:
+ self.print_msg(self.rpm_nvra(rpminfo))
+ workdir = tempfile.mkdtemp(prefix='sign_unsigned.', dir=self.options.workdir)
+ self.print_debug("Using workdir: %s" % workdir)
+ self.print_debug("Copying packages")
+ pkglist = []
+ for rpminfo in rpms:
+ src = self.rpm_path(rpminfo)
+ fn = "%s.rpm" % self.rpm_nvra(rpminfo)
+ dst = "%s/%s" % (workdir, fn)
+ if not self.options.test:
+ shutil.copyfile(src, dst)
+ pkglist.append(dst)
+ self.print_debug("Signing copies")
+ self.do_signing(pkglist, level)
+ if self.options.test:
+ return
+ self.print_msg("Importing signatures")
+ self.import_sig_from_files(rpms, level, workdir)
+ if self.options.write_rpms:
+ self.print_msg("Writing RPMs")
+ self.write_sigs(rpms, self.get_key_id(level).lower())
+ #clean up
+ for fn in os.listdir(workdir):
+ path = "%s/%s" % (workdir,fn)
+ os.unlink(path)
+ os.rmdir(workdir)
+
+ def get_build_rpms(self, builds):
+ ret = []
+ self.koji_session.multicall = True
+ for b in builds:
+ self.koji_session.getBuild(b, strict=True)
+ binfos = self.koji_session.multiCall()
+ self.koji_session.multicall = True
+ for binfo in binfos:
+ self.koji_session.listRPMs(buildID=binfo[0]['id'])
+ results = self.koji_session.multiCall()
+ for binfo, rpms in zip(binfos, results):
+ for r in rpms[0]:
+ r['build'] = binfo[0]
+ ret.extend(rpms[0])
+ return ret
+
+ def get_koji_rpms(self, tag, pkg=None):
+ rpms, builds = self.koji_session.listTaggedRPMS(tag, latest=True, inherit=self.options.inherit, package=pkg)
+ build_idx = {}
+ for build in builds:
+ build['name'] = build['package_name']
+ build_idx[build['id']] = build
+ for rpminfo in rpms:
+ rpminfo['build'] = build_idx[rpminfo['build_id']]
+ return rpms
+
+ def is_fedora(self, tag):
+ if tag.startswith('dist-fc') or tag.startswith('f'):
+ return True
+ return False
+
+ def tweak_options(self):
+ if self.options.just_show:
+ self.options.test = True
+ if self.options.builds:
+ self.options.builds = self.options.options
+ if not self.options.level:
+ self.parser.error("--level required unless a tag is specified")
+ else:
+ args = self.options.options
+ if len(args) < 1 or len(args) > 2:
+ self.parser.error("incorrect number of arguments")
+ if len(args) == 2:
+ self.options.pkg = args[1]
+ else:
+ self.options.pkg = None
+ self.options.tag = args[0]
+ if not self.options.level:
+ if self.is_fedora(self.options.tag):
+ self.options.level = 'fedora-gold'
+ else:
+ self.options.level = 'gold'
+
+ def cmd_default(self):
+ self.tweak_options()
+ clientcert = '/etc/pki/pkgsigner/pkgsigner.pem'
+ clientca = '/etc/pki/pkgsigner/spacewalk-upload-ca.cert'
+ serverca = '/etc/pki/pkgsigner/spacewalk-upload-ca.cert'
+ self.koji_session.ssl_login(clientcert, clientca, serverca) # NEEDSWORK
+ self.print_msg("Getting rpm list from koji")
+ if self.options.builds:
+ rpms = self.get_build_rpms(self.options.builds)
+ else:
+ rpms = self.get_koji_rpms(self.options.tag, self.options.pkg)
+ rpms.sort(lambda a,b: cmp(a['name'], b['name']))
+ self.print_debug("got %d rpms" % len(rpms))
+ if self.options.just_write_rpms:
+ sigkey = self.get_key_id(self.options.level).lower()
+ self.write_sigs(rpms, sigkey)
+ else:
+ self.print_debug("Checking cached signatures")
+ uncached = self.find_uncached(rpms, level=self.options.level)
+ #because we're in transition, some rpms may be signed, but not have that signature cached
+ #self.print_debug("Checking for uncached signatures (%d rpms)" % len(uncached))
+ #unsigned = self.try_import(uncached, level=self.options.level)
+ self.print_debug("Signing to cache (%d rpms)" % len(uncached))
+ self.sign_to_cache(uncached, self.options.level)
+
+if __name__ == '__main__':
+ x = SignUnsigned()
+ x.process_cmd_options()
+ x.create_koji_session()
+ x.run_command()
+ x.close_koji_session()
+
15 years
3 commits - rel-eng/global.build.py.props rel-eng/koji-missing-builds.py rel-eng/lib rel-eng/tito.props
by Devan Goodwin
rel-eng/global.build.py.props | 19 -------------------
rel-eng/koji-missing-builds.py | 4 ++--
rel-eng/lib/spacewalk/releng/builder.py | 17 +++++++++++++----
rel-eng/lib/spacewalk/releng/cli.py | 8 +++++++-
rel-eng/tito.props | 12 ++++++++++++
5 files changed, 34 insertions(+), 26 deletions(-)
New commits:
commit aa0fa396eca4d732f656bd1afc5cfd9bd146b137
Author: Devan Goodwin <dgoodwin(a)redhat.com>
Date: Mon Mar 30 16:52:03 2009 -0300
Add support for koji tag whitelist in tito.props.
If present implies all packages *not* listed in the whitelist are
blacklisted.
diff --git a/rel-eng/lib/spacewalk/releng/builder.py b/rel-eng/lib/spacewalk/releng/builder.py
index 954000c..67b794e 100644
--- a/rel-eng/lib/spacewalk/releng/builder.py
+++ b/rel-eng/lib/spacewalk/releng/builder.py
@@ -268,12 +268,21 @@ class Builder(object):
for koji_tag in koji_tags:
# Lookup the disttag configured for this Koji tag:
disttag = self.global_config.get(koji_tag, "disttag")
- if self.global_config.has_option(koji_tag, "blacklist"):
+ if self.global_config.has_option(koji_tag, "whitelist"):
+ # whitelist implies only those packages can be built to the
+ # tag,regardless if blacklist is also defined.
+ if self.project_name not in self.global_config.get(koji_tag,
+ "whitelist").strip().split(" "):
+ print("WARNING: %s not specified in whitelist for %s" % (
+ self.project_name, koji_tag))
+ print(" Package *NOT* submitted to Koji.")
+ continue
+ elif self.global_config.has_option(koji_tag, "blacklist"):
if self.project_name in self.global_config.get(koji_tag,
"blacklist").strip().split(" "):
print("WARNING: %s specified in blacklist for %s" % (
self.project_name, koji_tag))
- print("WARNING: NOT submitting this srpm to koji.")
+ print(" Package *NOT* submitted to Koji.")
continue
# Getting tricky here, normally Builder's are only used to
commit e81d9ffee3b32018c8b1d6308475f87df1f5594d
Author: Devan Goodwin <dgoodwin(a)redhat.com>
Date: Mon Mar 30 15:47:46 2009 -0300
tito: Change ignore_pkgs option to blacklist.
Doing this to jive with whitelist option coming soon.
diff --git a/rel-eng/koji-missing-builds.py b/rel-eng/koji-missing-builds.py
index cfc4514..424ad38 100755
--- a/rel-eng/koji-missing-builds.py
+++ b/rel-eng/koji-missing-builds.py
@@ -42,8 +42,8 @@ distsuffix = ''
tag = args[0]
disttag = distmap[tag.split('-')[1]]
pkgstoignore = []
-if config.has_section(tag) and config.has_option(tag, 'ignore_pkgs'):
- pkgstoignore = config.get(tag, 'ignore_pkgs').split(' ')
+if config.has_section(tag) and config.has_option(tag, 'blacklist'):
+ pkgstoignore = config.get(tag, 'blacklist').split(' ')
if opts.brew:
mysession = koji.ClientSession("http://brewhub.devel.redhat.com/brewhub")
diff --git a/rel-eng/lib/spacewalk/releng/builder.py b/rel-eng/lib/spacewalk/releng/builder.py
index 5a42d24..954000c 100644
--- a/rel-eng/lib/spacewalk/releng/builder.py
+++ b/rel-eng/lib/spacewalk/releng/builder.py
@@ -268,10 +268,10 @@ class Builder(object):
for koji_tag in koji_tags:
# Lookup the disttag configured for this Koji tag:
disttag = self.global_config.get(koji_tag, "disttag")
- if self.global_config.has_option(koji_tag, "ignore_pkgs"):
+ if self.global_config.has_option(koji_tag, "blacklist"):
if self.project_name in self.global_config.get(koji_tag,
- "ignore_pkgs").strip().split(" "):
- print("WARNING: %s specified in ignore_pkgs for %s" % (
+ "blacklist").strip().split(" "):
+ print("WARNING: %s specified in blacklist for %s" % (
self.project_name, koji_tag))
print("WARNING: NOT submitting this srpm to koji.")
continue
diff --git a/rel-eng/tito.props b/rel-eng/tito.props
index 7da0f88..ce9e025 100644
--- a/rel-eng/tito.props
+++ b/rel-eng/tito.props
@@ -5,13 +5,6 @@ default_tagger = spacewalk.releng.tagger.VersionTagger
[koji]
autobuild_tags = dist-f10-sw-0.5-candidate dist-5E-sw-0.5-candidate
-# to exclude packages from being listed in a missing
-# builds report simply add the package name to the
-# list in the appropriate tag section
-# [kojiorbrewtag]
-# ignore_missing=space seperated list of packagenames
-# i.e. ignore_missing=yum-rhn-plugin oracle-selinux
-
[dist-f10-sw-0.5-candidate]
disttag = .fc10
commit caea7085c7bfab65aa71155226a077a32b047f04
Author: Devan Goodwin <dgoodwin(a)redhat.com>
Date: Mon Mar 30 15:28:22 2009 -0300
tito: Use tito.props instead of global.build.py.props.
diff --git a/rel-eng/global.build.py.props b/rel-eng/global.build.py.props
deleted file mode 100644
index 7da0f88..0000000
--- a/rel-eng/global.build.py.props
+++ /dev/null
@@ -1,19 +0,0 @@
-[globalconfig]
-default_builder = spacewalk.releng.builder.Builder
-default_tagger = spacewalk.releng.tagger.VersionTagger
-
-[koji]
-autobuild_tags = dist-f10-sw-0.5-candidate dist-5E-sw-0.5-candidate
-
-# to exclude packages from being listed in a missing
-# builds report simply add the package name to the
-# list in the appropriate tag section
-# [kojiorbrewtag]
-# ignore_missing=space seperated list of packagenames
-# i.e. ignore_missing=yum-rhn-plugin oracle-selinux
-
-[dist-f10-sw-0.5-candidate]
-disttag = .fc10
-
-[dist-5E-sw-0.5-candidate]
-disttag = .el5
diff --git a/rel-eng/lib/spacewalk/releng/cli.py b/rel-eng/lib/spacewalk/releng/cli.py
index 9105678..7b40068 100644
--- a/rel-eng/lib/spacewalk/releng/cli.py
+++ b/rel-eng/lib/spacewalk/releng/cli.py
@@ -37,7 +37,7 @@ from spacewalk.releng.common import find_git_root, run_command, \
check_tag_exists, get_latest_tagged_version
BUILD_PROPS_FILENAME = "build.py.props"
-GLOBAL_BUILD_PROPS_FILENAME = "global.build.py.props"
+GLOBAL_BUILD_PROPS_FILENAME = "tito.props"
GLOBALCONFIG_SECTION = "globalconfig"
DEFAULT_BUILDER = "default_builder"
DEFAULT_TAGGER = "default_tagger"
@@ -175,6 +175,12 @@ class BaseCliModule(object):
"""
rel_eng_dir = os.path.join(find_git_root(), "rel-eng")
filename = os.path.join(rel_eng_dir, GLOBAL_BUILD_PROPS_FILENAME)
+ if not os.path.exists(filename):
+ # HACK: Try the old filename location, pre-tito rename:
+ filename = os.path.join(rel_eng_dir, "global.build.py.props")
+ if not os.path.exists(filename):
+ error_out("Unable to locate branch configuration: %s" %
+ filename)
config = ConfigParser.ConfigParser()
config.read(filename)
diff --git a/rel-eng/tito.props b/rel-eng/tito.props
new file mode 100644
index 0000000..7da0f88
--- /dev/null
+++ b/rel-eng/tito.props
@@ -0,0 +1,19 @@
+[globalconfig]
+default_builder = spacewalk.releng.builder.Builder
+default_tagger = spacewalk.releng.tagger.VersionTagger
+
+[koji]
+autobuild_tags = dist-f10-sw-0.5-candidate dist-5E-sw-0.5-candidate
+
+# to exclude packages from being listed in a missing
+# builds report simply add the package name to the
+# list in the appropriate tag section
+# [kojiorbrewtag]
+# ignore_missing=space seperated list of packagenames
+# i.e. ignore_missing=yum-rhn-plugin oracle-selinux
+
+[dist-f10-sw-0.5-candidate]
+disttag = .fc10
+
+[dist-5E-sw-0.5-candidate]
+disttag = .el5
15 years
Changes to 'refs/tags/spacewalk-config-0.5.9-1'
by Pradeep Kilambi
Tag 'spacewalk-config-0.5.9-1' created by Pradeep Kilambi <pkilambi(a)redhat.com> at 2009-03-30 19:42 +0000
Tagging package [spacewalk-config] version [0.5.9-1] in directory [spacewalk/config/].
Changes since spacewalk-java-0.5.42-1-4:
---
0 files changed
---
15 years
rel-eng/packages spacewalk/config
by Pradeep Kilambi
rel-eng/packages/spacewalk-config | 2 +-
spacewalk/config/spacewalk-config.spec | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit f85ba6ad2f5a0da7e49a0bfd2f34636b556d22a0
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Mon Mar 30 15:41:59 2009 -0400
Automatic commit of package [spacewalk-config] release [0.5.9-1].
diff --git a/rel-eng/packages/spacewalk-config b/rel-eng/packages/spacewalk-config
index a2e7042..1547362 100644
--- a/rel-eng/packages/spacewalk-config
+++ b/rel-eng/packages/spacewalk-config
@@ -1 +1 @@
-0.5.8-1 spacewalk/config/
+0.5.9-1 spacewalk/config/
diff --git a/spacewalk/config/spacewalk-config.spec b/spacewalk/config/spacewalk-config.spec
index 1d640f3..4308bd8 100644
--- a/spacewalk/config/spacewalk-config.spec
+++ b/spacewalk/config/spacewalk-config.spec
@@ -2,7 +2,7 @@
Name: spacewalk-config
Summary: Spacewalk Configuration
-Version: 0.5.8
+Version: 0.5.9
Release: 1%{?dist}
URL: http://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -115,7 +115,7 @@ fi
%changelog
-* Mon Mar 30 2009 Pradeep Kilambi <pkilambi(a)redhat.com>
+* Mon Mar 30 2009 Pradeep Kilambi <pkilambi(a)redhat.com> 0.5.9-1
- 487618 - fixing jabberd to use mysql db by default instead of sqlite
* Tue Mar 24 2009 Dennis Gilmore <dennis(a)ausil.us> 0.5.8-1
15 years
spacewalk/config
by Pradeep Kilambi
spacewalk/config/spacewalk-config.spec | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit e21cd9ac99b0135fe5327b5e4d2007c9a914da23
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Mon Mar 30 15:40:55 2009 -0400
new build for 487618
diff --git a/spacewalk/config/spacewalk-config.spec b/spacewalk/config/spacewalk-config.spec
index 4729849..1d640f3 100644
--- a/spacewalk/config/spacewalk-config.spec
+++ b/spacewalk/config/spacewalk-config.spec
@@ -115,6 +115,9 @@ fi
%changelog
+* Mon Mar 30 2009 Pradeep Kilambi <pkilambi(a)redhat.com>
+- 487618 - fixing jabberd to use mysql db by default instead of sqlite
+
* Tue Mar 24 2009 Dennis Gilmore <dennis(a)ausil.us> 0.5.8-1
- Requires(pre) jabberd so we can set the password in %%post
15 years
spacewalk/config
by Pradeep Kilambi
spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml | 2 +-
spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 9c5aae8db19a18856f6001195490eb68afef616b
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Mon Mar 30 15:39:19 2009 -0400
487618 - fixing jabberd configs to use mysql instead of sqlite by default since sqlite usage takes an extra manual step
diff --git a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml
index 09eff11..ba1aa82 100644
--- a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml
+++ b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml
@@ -321,7 +321,7 @@
<path>/usr/lib/jabberd</path>
<!-- Backend module to use -->
- <module>sqlite</module>
+ <module>db</module>
<!-- Available authentication mechanisms -->
<mechanisms>
diff --git a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml
index 5959539..4b95480 100644
--- a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml
+++ b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml
@@ -71,8 +71,8 @@
<!-- Dynamic storage modules path -->
<path>/usr/lib/jabberd</path>
- <!-- By default, we use the sqlite driver for all storage -->
- <driver>sqlite</driver>
+ <!-- By default, we use the MySQL driver for all storage -->
+ <driver>db</driver>
<!-- Its also possible to explicitly list alternate drivers for
specific data types. -->
15 years
2 commits - rel-eng/lib
by Devan Goodwin
rel-eng/lib/spacewalk/releng/cli.py | 3 +
rel-eng/lib/spacewalk/releng/tagger.py | 77 ++++++++++++++++++++++++++++++---
2 files changed, 75 insertions(+), 5 deletions(-)
New commits:
commit 9b424fdb7e710feb73f0e458cdc88e75abbcab2e
Author: James Bowes <jbowes(a)redhat.com>
Date: Wed Mar 25 22:40:18 2009 -0400
Teach tito to let you use an editor on changelogs
An addendum to the previous patch; launch $EDITOR or vi to allow
for modification to the changelog entry before commiting it.
diff --git a/rel-eng/lib/spacewalk/releng/tagger.py b/rel-eng/lib/spacewalk/releng/tagger.py
index b56e71c..995402f 100644
--- a/rel-eng/lib/spacewalk/releng/tagger.py
+++ b/rel-eng/lib/spacewalk/releng/tagger.py
@@ -20,6 +20,8 @@ import sys
import commands
import StringIO
import shutil
+import subprocess
+import tempfile
import textwrap
from time import strftime
@@ -128,28 +130,37 @@ class VersionTagger(object):
(last_tag, "HEAD", ".")
output = run_command(patch_command)
- print "No changelog entry found; adding the following for you:"
- print
-
+ fd, name = tempfile.mkstemp()
+ os.write(fd, "# No changelog entry found; please edit the following\n")
header = "* %s %s <%s>\n" % (self.today, self.git_user,
self.git_email)
- sys.stdout.write(header)
- out_f.write(header)
+ os.write(fd, header)
for cmd_out in output.split("\n"):
- out_f.write("- ")
- out_f.write("\n ".join(textwrap.wrap(cmd_out, 77)))
- out_f.write("\n")
+ os.write(fd, "- ")
+ os.write(fd, "\n ".join(textwrap.wrap(cmd_out, 77)))
+ os.write(fd, "\n")
- sys.stdout.write("- ")
- sys.stdout.write("\n ".join(textwrap.wrap(cmd_out, 77)))
- sys.stdout.write("\n")
+ os.write(fd, "\n")
- out_f.write("\n")
- sys.stdout.write("\n")
+ editor = 'vi'
+ if os.environ.has_key("EDITOR"):
+ editor = os.environ["EDITOR"]
- found_match = True
+ subprocess.call([editor, name])
+
+ os.lseek(fd, 0, 0)
+ file = os.fdopen(fd)
+
+ for line in file.readlines():
+ if not line.startswith("#"):
+ out_f.write(line)
+
+ output = file.read()
+
+ file.close()
+ os.unlink(name)
in_f.close()
out_f.close()
commit a0d27856d488fd6837bf1db60e0dde0ab7899d64
Author: James Bowes <jbowes(a)redhat.com>
Date: Wed Mar 25 21:13:13 2009 -0400
Teach tito to generate specfile changelog entries
If tito doesn't find a changelog entry in the specfile during a tag
operation, he can now create one himself from the git logs. The entry
line items are made from the subject and email of committer for all
untagged commits of the package in question.
If you don't like tito doing your work for you, you can stop him from
doing so by passing --no-auto-changelog on the command line.
diff --git a/rel-eng/lib/spacewalk/releng/cli.py b/rel-eng/lib/spacewalk/releng/cli.py
index d46d0d3..9105678 100644
--- a/rel-eng/lib/spacewalk/releng/cli.py
+++ b/rel-eng/lib/spacewalk/releng/cli.py
@@ -413,6 +413,9 @@ class TagModule(BaseCliModule):
action="store_true",
help="Use spec file version/release exactly as specified in spec file to tag package.")
+ self.parser.add_option("--no-auto-changelog", action="store_true",
+ default=False,
+ help="Don't automatically create a changelog entry for this tag if none is found")
def main(self):
BaseCliModule.main(self)
diff --git a/rel-eng/lib/spacewalk/releng/tagger.py b/rel-eng/lib/spacewalk/releng/tagger.py
index 186b7d6..b56e71c 100644
--- a/rel-eng/lib/spacewalk/releng/tagger.py
+++ b/rel-eng/lib/spacewalk/releng/tagger.py
@@ -19,6 +19,8 @@ import re
import sys
import commands
import StringIO
+import shutil
+import textwrap
from time import strftime
@@ -54,6 +56,8 @@ class VersionTagger(object):
self.changelog_regex = re.compile('\\*\s%s\s%s(\s<%s>)?' % (self.today,
self.git_user, self.git_email))
+ self._no_auto_changelog = False
+
def run(self, options):
"""
Perform the actions requested of the tagger.
@@ -63,6 +67,8 @@ class VersionTagger(object):
"""
if options.tag_release:
print("WARNING: --tag-release option no longer necessary, 'tito tag' will accomplish the same thing.")
+ if options.no_auto_changelog:
+ self._no_auto_changelog=True
self._tag_release()
def _tag_release(self):
@@ -92,14 +98,64 @@ class VersionTagger(object):
f.close()
if not found_changelog:
- # TODO: Instead of dying here, we could try to add one automatically
- # and generate the changelog entries from the first line of the git commit
- # history for all commits since the last package version was tagged.
- error_out("No changelog entry found: '* %s %s <%s>'" % (
- self.today, self.git_user, self.git_email))
+ if self._no_auto_changelog:
+ error_out("No changelog entry found: '* %s %s <%s>'" % (
+ self.today, self.git_user, self.git_email))
+ else:
+ self._make_changelog()
else:
debug("Found changelog entry.")
+ def _make_changelog(self):
+ """
+ Create a new changelog entry in the spec, with line items from git
+ """
+ in_f = open(self.spec_file, 'r')
+ out_f = open(self.spec_file + ".new", 'w')
+
+ found_changelog = False
+ for line in in_f.readlines():
+ out_f.write(line)
+
+ if not found_changelog and line.startswith("%changelog"):
+ found_changelog = True
+
+ old_version = get_latest_tagged_version(self.project_name)
+ last_tag = "%s-%s" % (self.project_name, old_version)
+ patch_command = \
+ "git log --pretty=format:%%s\ \(%%ae\)" \
+ " --relative %s..%s -- %s" % \
+ (last_tag, "HEAD", ".")
+ output = run_command(patch_command)
+
+ print "No changelog entry found; adding the following for you:"
+ print
+
+ header = "* %s %s <%s>\n" % (self.today, self.git_user,
+ self.git_email)
+
+ sys.stdout.write(header)
+ out_f.write(header)
+
+ for cmd_out in output.split("\n"):
+ out_f.write("- ")
+ out_f.write("\n ".join(textwrap.wrap(cmd_out, 77)))
+ out_f.write("\n")
+
+ sys.stdout.write("- ")
+ sys.stdout.write("\n ".join(textwrap.wrap(cmd_out, 77)))
+ sys.stdout.write("\n")
+
+ out_f.write("\n")
+ sys.stdout.write("\n")
+
+ found_match = True
+
+ in_f.close()
+ out_f.close()
+
+ shutil.move(self.spec_file + ".new", self.spec_file)
+
def _update_changelog(self, new_version):
"""
Update the changelog with the new version.
15 years
Changes to 'refs/tags/spacewalk-java-0.5.42-1'
by Mike McCune
Tag 'spacewalk-java-0.5.42-1' created by Mike McCune <mmccune(a)gmail.com> at 2009-03-30 17:21 +0000
Tagging package [spacewalk-java] version [0.5.42-1] in directory [java/].
Changes since rhn-client-tools-0.4.24-1-2:
---
0 files changed
---
15 years
java/spacewalk-java.spec rel-eng/packages
by Mike McCune
java/spacewalk-java.spec | 13 ++++++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 13 insertions(+), 2 deletions(-)
New commits:
commit d8eb928fc1b286a77d9b300f40c8479ed206e6b1
Author: Mike McCune <mmccune(a)gmail.com>
Date: Mon Mar 30 10:21:16 2009 -0700
Automatic commit of package [spacewalk-java] release [0.5.42-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index e21e2b0..a6423ce 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -10,7 +10,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 0.5.41
+Version: 0.5.42
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -235,6 +235,17 @@ fi
%attr(644, root, root) %{_datadir}/rhn/lib/rhn.jar
%changelog
+* Mon Mar 30 2009 Mike McCune <mmccune(a)gmail.com> 0.5.42-1
+- 144325 - converting system probe list to the new list tag, featuring all the bells and
+ whistles the new list tag has to offer
+- 492478 - modifying the system applicable errata page so that you can filter on the
+ type of errata you want to see, also linking a couple of critical errata li
+- 467063 - Port of clone errata functionality to new list tag
+- 492418 - adding missing channel title when creating new software channels
+- 492476 - fixing issue where critical plus non-critical errata for a system (on the system details page) did not total errata
+- 492146 - fixing issue where system icons are not clickable
+
+
* Thu Mar 26 2009 jesus m. rodriguez <jesusr(a)redhat.com> 0.5.41-1
- 437359 - redirect org creation to the orgsystemsubscription page
- 489007 - add system.getConnectionPath for listing proxies a server connected through
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 00a9c44..29807a7 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-0.5.41-1 java/
+0.5.42-1 java/
15 years