def create_package(session): """ Create some basic package for testing. """ package = model.Package( name='guake', namespace='rpms', summary='Top down terminal for GNOME', description='Top down terminal...', status='Approved', review_url='https://bugzilla.redhat.com/450189', upstream_url='http://guake.org', monitor=False, ) session.add(package) package = model.Package( name='fedocal', namespace='rpms', summary='A web-based calendar for Fedora', description='Web calendar ...', status='Approved', review_url='https://bugzilla.redhat.com/915074', upstream_url='http://fedorahosted.org/fedocal', monitor=False, ) session.add(package) package = model.Package( name='geany', namespace='rpms', summary='A fast and lightweight IDE using GTK2', description='Lightweight GNOME IDE...', status='Approved', review_url=None, upstream_url=None, monitor=False, ) session.add(package) package = model.Package( name='offlineimap', namespace='docker', summary='Powerful IMAP/Maildir synchronization and reader support', description='Powerful IMAP/Maildir synchronization...', status='Approved', review_url=None, upstream_url=None, monitor=False, ) session.add(package) session.commit()
def create_package(session): """ Create some basic package for testing. """ package = model.Package( name='guake', summary='Top down terminal for GNOME', description='Top down terminal...', status='Approved', review_url='https://bugzilla.redhat.com/450189', shouldopen=None, upstream_url='http://guake.org', ) session.add(package) package = model.Package( name='fedocal', summary='A web-based calendar for Fedora', description='Web calendar ...', status='Approved', review_url='https://bugzilla.redhat.com/915074', shouldopen=None, upstream_url='http://fedorahosted.org/fedocal', ) session.add(package) package = model.Package( name='geany', summary='A fast and lightweight IDE using GTK2', description='Lightweight GNOME IDE...', status='Approved', review_url=None, shouldopen=None, upstream_url=None, ) session.add(package) session.commit()
def convert_packages(pkg1_sess, pkg2_sess): ''' Convert the Packages from pkgdb1 to pkgdb2. ''' cnt = 0 for pkg in pkg1_sess.query(P1Package).all(): if pkg.statuscode == 17: continue new_pkg = model.Package( name=pkg.name, summary=pkg.summary, description=pkg.description, status=STATUS[pkg.statuscode], review_url=pkg.reviewurl, upstream_url=pkg.upstreamurl, ) new_pkg.id = pkg.id pkg2_sess.add(new_pkg) cnt += 1 pkg2_sess.commit() print '%s packages added' % cnt
def create_package_critpath(session): """ Create package in critpath. """ package = model.Package( name='kernel', namespace='rpms', summary='The Linux kernel', description='The kernel', status='Approved', review_url='https://bugzilla.redhat.com/123', upstream_url='http://www.kernel.org/', monitor=True, koschei=True, ) session.add(package) f18_collec = model.Collection.by_name(session, 'f18') devel_collec = model.Collection.by_name(session, 'master') # Pkg: geany - Collection: F18 - Approved pkgltg = model.PackageListing( point_of_contact='kernel-maint', status='Approved', package_id=package.id, collection_id=f18_collec.id, critpath=True, ) session.add(pkgltg) # Pkg: geany - Collection: devel - Approved pkgltg = model.PackageListing( point_of_contact='group::kernel-maint', status='Approved', package_id=package.id, collection_id=devel_collec.id, critpath=True, ) session.add(pkgltg) session.commit()
def create_docker_packages(session): """ Add packagers to packages. """ # Add packages cockpit_pkg = model.Package( name='cockpit', namespace='docker', summary='Server Management GUI', description='Server Management...', status='Approved', review_url='https://bugzilla.redhat.com/450189', upstream_url='http://cockpit.io', monitor=False, ) session.add(cockpit_pkg) fedocal_pkg = model.Package( name='fedocal', namespace='docker', summary='A web-based calendar for Fedora', description='Web calendar ...', status='Approved', review_url='https://bugzilla.redhat.com/915074', upstream_url='http://fedorahosted.org/fedocal', monitor=False, ) session.add(fedocal_pkg) session.commit() devel_collec = model.Collection.by_name(session, 'master') # Add PackageListing # Pkg: cockpit - Collection: devel - Approved pkgltg = model.PackageListing( point_of_contact='puiterwijk', status='Approved', package_id=cockpit_pkg.id, collection_id=devel_collec.id, ) session.add(pkgltg) # Pkg: guake - Collection: devel - Approved pkgltg = model.PackageListing( point_of_contact='pingou', status='Approved', package_id=fedocal_pkg.id, collection_id=devel_collec.id, ) session.add(pkgltg) session.commit() # Add PackageListingAcl cockpit_devel = model.PackageListing.by_pkgid_collectionid( session, cockpit_pkg.id, devel_collec.id) fedocal_devel = model.PackageListing.by_pkgid_collectionid( session, fedocal_pkg.id, devel_collec.id) packager = model.PackageListingAcl( fas_name='pingou', packagelisting_id=cockpit_devel.id, acl='commit', status='Approved', ) session.add(packager) packager = model.PackageListingAcl( fas_name='pingou', packagelisting_id=cockpit_devel.id, acl='watchbugzilla', status='Approved', ) session.add(packager) packager = model.PackageListingAcl( fas_name='pingou', packagelisting_id=fedocal_devel.id, acl='commit', status='Approved', ) session.add(packager) packager = model.PackageListingAcl( fas_name='pingou', packagelisting_id=fedocal_devel.id, acl='watchcommits', status='Approved', ) session.add(packager) packager = model.PackageListingAcl( fas_name='pingou', packagelisting_id=fedocal_devel.id, acl='watchbugzilla', status='Approved', ) session.add(packager) packager = model.PackageListingAcl( fas_name='toshio', packagelisting_id=fedocal_devel.id, acl='commit', status='Awaiting Review', ) session.add(packager) packager = model.PackageListingAcl( fas_name='spot', packagelisting_id=fedocal_devel.id, acl='watchbugzilla', status='Approved', ) session.add(packager) packager = model.PackageListingAcl( fas_name='group::gtk-sig', packagelisting_id=cockpit_devel.id, acl='commit', status='Approved', ) session.add(packager) packager = model.PackageListingAcl( fas_name='group::gtk-sig', packagelisting_id=cockpit_devel.id, acl='watchbugzilla', status='Approved', ) session.add(packager) session.commit()