1

We have a Sonatype Nexus repo, where we publish RPMs with the Maven RPM plugin. Snapshots and release versions are available. The issue here is around the mapping between versions.

First, I obtain a list of snapshots in Nexus:

yum --showduplicates --disablerepo=* --enablerepo=snapshot list myrpm
Loaded plugins: downloadonly, fastestmirror, security
Loading mirror speeds from cached hostfile
Available Packages
myrpm.noarch     0.10.6-SNAPSHOT20141128065137      snapshot
myrpm.noarch     0.10.6-SNAPSHOT20141128135713      snapshot
myrpm.noarch     0.10.6-SNAPSHOT20141128170402      snapshot
myrpm.noarch     0.10.6-SNAPSHOT20141201085055      snapshot

I want to fetch a specific version, for example 0.10.6-SNAPSHOT20141201085055:

yumdownloader --disablerepo=* --enablerepo=snapshot myrpm-0.10.6-SNAPSHOT20141201085055
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
wpsnapshot                                                         | 3.3 kB     00:00
myrpm-0.10.6-20141201.091715-23-rpm.rpm                            |  10 MB     00:11

My question is how is the mapping between the versions 'SNAPSHOT20141201085055' and '20141201.091715-23' worked out?

Jepper
  • 356
  • 1
  • 4
  • 13

1 Answers1

2

yum repositories have XML metadata which describes each package available in the repository. In your repository, you likely have something like the following:

<package type="rpm">
  <name>myrpm</name>
  <version epoch="0" rel="SNAPSHOT20141201085055" ver="0.10.6"/>

  <!-- other fields here -->

  <location href="myrpm-0.10.6-20141201.091715-23-rpm.rpm"/>
</package>

You can verify this by examining the metadata for your repository. To do this, you first need the URL of the repository, which you can find in the appropriate file for your repository in /etc/yum.repos.d/.

Once you have the base url, you can append "/repodata/primary.xml.gz" to the end of the URL. Make sure to substitute $basearch with your architecture. Then you can curl that URL and pipe it to zless to view it.

For example, on my system I have my custom repository of software with a base URL like this:

baseurl=https://packagecloud.io/joe/mystuff/el/6/$basearch

So, to view my primary.xml.gz for my x86_64 system, I would run this:

curl -L https://packagecloud.io/joe/mystuff/el/6/x86_64/repodata/primary.xml.gz | zless
Joe Damato
  • 180
  • 4