#45 add support for SRPMLayout branches
Closed 2 years ago by tdawson. Opened 3 years ago by dcavalca.

c8s (and earlier) use the old "exploded SRPM" layout on dist-git. This is technically supported by rpkg as SRPMLayout (see https://pagure.io/rpkg/c/a95bad2ed57e500a9f9c1ec50d1c5cdacffca5f4?branch=master). It'd be great to integrate this in centpkg so it could be used to do work on c8s as well (this would be especially valuable for SIGs).


Metadata Update from @tdawson:
- Issue tagged with: Feature Request

2 years ago

Looking through the centpkg and rpkg code, it looks like more needs to be done.
Specifically the downloading of source from the lookaside.
The SRPMLayout allows rpkg (and it's various wrappers) to know where the SPEC file and SOURCES should be at when building, it doesn't do anything for figuring out what file should be downloaded from the lookaside cache.

Looking at the rpkg code for sources we see

   def sources(self, outdir=None):
        if not os.path.exists(self.sources_filename):
            self.log.info("sources file doesn't exist. Source files download skipped.")
            return

In short, no sources file, no download.

It looks like we have two paths to choose from (maybe more)
1 - have centpkg create a temporary sources file
2 - teach rpkg how to download from the git.centos.org lookaside cache.

SRPMLayout source packages look like .foo.metadata and it turns out that rpkg already has that functionality, almost. It has a bug so that when it is looking for the sources it is looking literally for .{0.repo_name}.metadata instead of .foo.metadata

A bug has been opened.
https://pagure.io/rpkg/issue/633

This should be fixed in centpkg 0.6.8 which is currently in fedora and epel-testing.

You should use centpkg-sig for this because it has the correct configurations for the look aside cache.

Examples:
# Classic CentOS packages
centpkg-sig clone tar ; cd tar
centpkg-sig sources # pulls down the source(s) and puts them in SOURCES directory
centpkg-sig srpm # pulls down the sources and creates a srpm which is placed in SRPM directory
# SIG only branches
centpkg-sig clone kmod-mpt3sas ; cd kmod-mpt3sas
git checkout c8s-sig-kmods # main is not a recognized branch
centpkg switch-branch c9s-sig-kmods
centpkg-sig sources # pulls down the source(s) and puts them in SOURCES directory
centpkg-sig srpm # pulls down the sources and creates a srpm which is placed in SRPM directory

centpkg 0.6.8, which fixes this issue is in stable.

Metadata Update from @tdawson:
- Issue status updated to: Closed (was: Open)

2 years ago

Log in to comment on this ticket.

Metadata