Repo file generation II. + URL Question
Tomas Radej
tradej at redhat.com
Tue May 28 10:56:26 UTC 2013
Hi,
On Mon, 27 May 2013 08:07:44 -0400 (EDT)
Bohuslav Kabrda <bkabrda at redhat.com> wrote:
> > + at coprs_ns.route('/detail/<username>/<coprname>/<chrootname>.repo', methods =
> > ['GET'])
>
> - methods = ['GET'] is default, you don't need to specify that explicitly
> - If I get it correctly, the .repo filename is only chroot_name? That would mean something like "fedora-18-x86_64.repo"? If so, this would only allow you to have one copr in your yum.repos.d, right?
>
Well, the idea was that you probably won't want to have 2 repos of the
same name from two different people, but if you do, I can easily
change it to point to <username>-<coprname>-<chrootname>.repo or the
like. State your preferences, please, because this is merely a matter
of specification.
> > + urls = [build.results for build in copr.builds if build.results != None]
>
> - I don't really like this. This will take _all_ the builds and traverse and create a list of possibly all of them (since you can assume that almost all builds are complete after the copr has lived for some time). I'd suggest using a generator with the same expression and use it to traverse builds - something along the lines of:
>
> urls = (<the same that you have>)
> for u in urls:
> if u:
> break
> else:
> # all traversed, but no finished build found => page_not_found
>
> # if we get here, u is a finished build => render repofile
>
> > + if not urls:
> > + return page_not_found('Repository not initialized: No builds in
> > {0}/{1} have finished.'.format(username, coprname))
> > +
> > + response =
> > flask.make_response(flask.render_template('coprs/coprchroot.repo',
> > copr=copr, url=urls[0]))
> > + response.mimetype='text/plain'
> > + return response
Done.
> Could you please fix these nits before committing?
I will delay committing until I get a final word on how the (base)URL
is supposed to look like.
Regards, TR
>
> --
> Regards,
> Bohuslav "Slavek" Kabrda.
> _______________________________________________
> copr-devel mailing list
> copr-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/copr-devel
--
Tomas Radej <tradej at redhat.com>
More information about the copr-devel
mailing list