diff --git a/builder/kojid b/builder/kojid index ef19b007..e2b80cae 100755 --- a/builder/kojid +++ b/builder/kojid @@ -2109,7 +2109,7 @@ class NewRepoTask(BaseTaskHandler): repo_id, event_id = self.wait(preptask)[preptask] path = koji.pathinfo.repo(repo_id, tinfo['name']) if not os.path.isdir(path): - raise koji.GenericError, "Repo directory missing: %s" % repodir + raise koji.GenericError, "Repo directory missing: %s" % path arches = [] for fn in os.listdir(path): if fn != 'groups' and os.path.isdir("%s/%s/RPMS" % (path, fn)): @@ -2141,7 +2141,7 @@ class PrepRepoTask(BaseTaskHandler): repo_id, event_id = session.host.repoInit(tinfo['id']) path = koji.pathinfo.repo(repo_id, tinfo['name']) if not os.path.isdir(path): - raise koji.GenericError, "Repo directory missing: %s" % repodir + raise koji.GenericError, "Repo directory missing: %s" % path #create and upload meta rpm spec = "%s/groups/groups.spec" % path #the repoInit call should have created groups.spec @@ -2157,7 +2157,7 @@ class PrepRepoTask(BaseTaskHandler): status = log_output(cmd[0], cmd, logfile, uploadpath, logerror=True) if not _isSuccess(status): raise koji.GenericError, "failed to build groups rpm: %s" \ - % _parseStatus(status, pkgcmd) + % _parseStatus(status, ' '.join(cmd)) #upload file and return path fn = 'buildsys-build-1-1.noarch.rpm' pkg = "%s/noarch/%s" % (self.workdir, fn) @@ -2191,15 +2191,17 @@ class CreaterepoTask(BaseTaskHandler): if os.path.exists("%s/comps.xml" % repodir): cmd.extend(['-g', 'comps.xml']) #attempt to recycle repodata from last repo - if oldrepo: - oldpath = pathinfo.repo(oldrepo['id'], rinfo['tag_name']) - olddatadir = "%s/%s/repodata" % (oldpath, arch) - if not os.path.isdir(olddatadir): - self.logger.warn("old repodata is missing: %s" % olddatadir) - else: - koji.ensuredir(datadir) - os.system('cp -a %s/* %s' % (olddatadir, datadir)) - cmd.append('--update') + # XXX re-enable this if statement when --update support appears in + # upstream createrepo + # if oldrepo: + # oldpath = pathinfo.repo(oldrepo['id'], rinfo['tag_name']) + # olddatadir = "%s/%s/repodata" % (oldpath, arch) + # if not os.path.isdir(olddatadir): + # self.logger.warn("old repodata is missing: %s" % olddatadir) + # else: + # koji.ensuredir(datadir) + # os.system('cp -a %s/* %s' % (olddatadir, datadir)) + # cmd.append('--update') # note: we can't easily use a cachedir because we do not have write # permission. The good news is that with --update we won't need to # be scanning many rpms. @@ -2211,7 +2213,7 @@ class CreaterepoTask(BaseTaskHandler): status = log_output(cmd[0], cmd, logfile, uploadpath, logerror=True) if not _isSuccess(status): raise koji.GenericError, "failed to create repo: %s" \ - % _parseStatus(status, pkgcmd) + % _parseStatus(status, ' '.join(cmd)) files = [] for f in os.listdir(datadir): diff --git a/cli/koji b/cli/koji index 67642531..07c99969 100755 --- a/cli/koji +++ b/cli/koji @@ -1029,14 +1029,14 @@ def handle_list_permissions(options, session, args): if len(args) > 0: parser.error(_("This command takes no arguments")) assert False - if not options.user: - parser.error(_("A user must be specified")) - assert False activate_session(session) - user = session.getUser(options.user) - if not user: - raise koji.GenericError("%s can not be found" % options.user) - perms = session.getUserPerms(user['id']) + if options.user: + user = session.getUser(options.user) + if not user: + raise koji.GenericError("%s can not be found" % options.user) + perms = session.getUserPerms(user['id']) + else: + perms = [p['name'] for p in session.getAllPerms()] print perms def handle_list_signed(options, session, args): diff --git a/hub/kojihub.py b/hub/kojihub.py index e026770d..c59a0b48 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -2911,6 +2911,7 @@ def import_rpm(fn,buildinfo=None,brootid=None): for (filename,filesize,filemd5,fileflags) in \ zip(hdr[rpm.RPMTAG_FILENAMES],hdr[rpm.RPMTAG_FILESIZES], hdr[rpm.RPMTAG_FILEMD5S],hdr[rpm.RPMTAG_FILEFLAGS]): + filename = koji.fixEncoding(filename) q = """INSERT INTO rpmfiles (rpm_id,filename,filesize,filemd5,fileflags) VALUES (%(rpminfo_id)d,%(filename)s,%(filesize)d,%(filemd5)s,%(fileflags)d) """ @@ -2947,13 +2948,8 @@ def import_changelog(buildinfo, rpmfile, replace=False): for cltime, clauthor, cltext in zip(cltimelist, hdr['CHANGELOGNAME'], hdr['CHANGELOGTEXT']): cltime = datetime.datetime.fromtimestamp(cltime).isoformat(' ') - # XXX FIXME! - # Use koji.fixEncoding() instead of koji._forceAscii() - # once the database is in UTF-8 - # clauthor = koji.fixEncoding(clauthor) - # cltext = koji.fixEncoding(cltext) - clauthor = koji._forceAscii(clauthor) - cltext = koji._forceAscii(cltext) + clauthor = koji.fixEncoding(clauthor) + cltext = koji.fixEncoding(cltext) q = """INSERT INTO changelogs (build_id, date, author, text) VALUES (%(build_id)d, %(cltime)s, %(clauthor)s, %(cltext)s) """ diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index 0243db1a..aee222bb 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -92,7 +92,7 @@ def _genHTML(req, fileName): else: req._values['currentUser'] = None - return str(Cheetah.Template.Template(file=fileName, searchList=[req._values])) + return Cheetah.Template.Template(file=fileName, searchList=[req._values], filter='EncodeUnicode').respond() def _getServer(req): serverURL = req.get_options()['KojiHubURL']