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

Add a parser for updateinfo.xml #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

thutterer
Copy link
Collaborator

@thutterer thutterer commented Dec 10, 2020

This PR adds a new RepomdParser::UpdateinfoXmlParser and with it, a RepomdParser::Update class, representing individual updates. Each update comes with a list of packages. Details in the README.md changes.

@ikapelyukhin Please review and advise on the following questions:

  • I haven't finished writing the specs. I wanted to ask you first if you could provide the real updateinfo.xml for your "apples and oranges" repo. I guess you have this somewhere on OBS, or did you handcraft it?

  • Any caveats I might have missed?

Thanks!

@thutterer thutterer force-pushed the updateinfo_xml_parser branch 4 times, most recently from a08395e to 7a7b8d9 Compare December 14, 2020 10:20
@thutterer thutterer force-pushed the updateinfo_xml_parser branch from 7a7b8d9 to 092a9fe Compare December 14, 2020 10:31
@ikapelyukhin
Copy link
Owner

ikapelyukhin commented Dec 14, 2020

Hey, @thutterer.

This PR adds a new RepomdParser::UpdateinfoXmlParser and with it, a RepomdParser::Update class, representing individual updates. Each update comes with a list of packages. Details in the README.md changes.

* I haven't finished writing the specs. I wanted to ask you first if you could provide the real updateinfo.xml for your "apples and oranges" repo. I guess you have this somewhere on OBS, or did you handcraft it?

You can actually see where the repo came from in its metadata:

So a long time ago, when dinosaurs roamed the earth and RMT was still called Potato, there was Devel:SCC:rmt-dummy in IBS. But in our infinite wisdom we have nuked it, so it's gone now (an by "we" I mean "it probably was me who did it, but I don't remember for sure" 😬)

Since then I have created home:ikapelyukhin:dummy_repo in OBS, which has the same packages but the metadata is slightly different (build times, etc.).

It doesn't have updateinfo.xml, however. I'm not sure how to force OBS to generate it, might be some dark prjconf magic. It seems to be generating only for release real release projects. Feel free to ask OBS or build/maintenance folks about how to enable it for a random OBS home project.

Another option would be to just get an updateinfo.xml from some repo (e.g. Leap 15.2) and trim it, leaving only 5-10 patches. I don't think we actually care in specs if those RPMs are present in primary.xml or not, as long as updateinfo.xml parses it should be all good. So that'd be another fixture dir with just updateinfo.xml in it.

* Any caveats I might have missed?

No, not really. I've taken a look at the current code and it LGTM. Just needs specs and we are good to go. :shipit:

@thutterer
Copy link
Collaborator Author

Hi @ikapelyukhin, happy new year!

I haven't finished this one before the holidays as I ran into one small problem with the code in its current state.

An update section in an updateinfo.xml lists its packages, but each package only gives the filename, not the full location within the repo.

In my current code, I treat that filename as the location, which is a bug, I think, since the location should also have the relative path.

In most SUSE repos I've checked the folder name is just the arch, but is this an assumption I can make to fix my code? Or would this be just another bug waiting to manifest?

@ikapelyukhin
Copy link
Owner

Hi @ikapelyukhin, happy new year!

Thanks, to you too! 🌲

An update section in an updateinfo.xml lists its packages, but each package only gives the filename, not the full location within the repo.

In my current code, I treat that filename as the location, which is a bug, I think, since the location should also have the relative path.

In most SUSE repos I've checked the folder name is just the arch, but is this an assumption I can make to fix my code? Or would this be just another bug waiting to manifest?

Hmm, you have to provide examples.

    <pkglist>
      <collection>
        <package
                name="ruby2.5-rubygem-bundler"
                epoch="0"
                version="1.16.1"
                release="lp152.4.3.1"
                arch="x86_64"
                src="x86_64/ruby2.5-rubygem-bundler-1.16.1-lp152.4.3.1.x86_64.rpm"
         >
          <filename>ruby2.5-rubygem-bundler-1.16.1-lp152.4.3.1.x86_64.rpm</filename>
        </package>
      </collection>
    </pkglist>

Something like this? Isn't the full path in //package[@src], rather than //package/filename/text()?

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

Successfully merging this pull request may close these issues.

2 participants