Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the usage of the file types when creating a repository #19

Closed
ghost opened this issue Jun 9, 2015 · 0 comments
Closed

Simplify the usage of the file types when creating a repository #19

ghost opened this issue Jun 9, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 9, 2015

In my case (I don't create the sqlite files), it's much easier/nicer to use createrepo_c.XmlFile than createrepo_c.PrimaryXmlFile and friends. However:

  • to create an instance of createrepo_c.XmlFile, I need a type constant (e.g. createrepo_c.XMLFILE_PRIMARY)
  • I need the name of the type (e.g. primary) as well to compose the file name (e.g. path/primary.xml.gz) - (Well, I don't need it. The name can be arbitrary. But it's a common practice to use these names.)
  • I need the name of the type to refer to the file in a createrepo_c.RepomdRecord instance

I can think of multiple solutions:

  • there can be a mapping from type constants to their names and/or the opposite mapping
  • there can be a factory function that creates file instances for given type constant (optionally with the default file name)
  • there can be a "builder" that has an add_pkg method and a dump method (it will create all the needed files in a given directory)
  • there can be a function that transforms a metadata file into a createrepo_c.RepomdRecord
  • the createrepo_c.Repomd class can have a method that does the same as set_record but accepts metadata files
  • the createrepo_c.XmlFile.__init__ can accept type names
  • the createrepo_c.RepomdRecord.__init__ can accept the type constants

but I don't insist on any of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant