Bug 1123022 - createrepo needs to provide proper support for subscription-manager
Summary: createrepo needs to provide proper support for subscription-manager
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: createrepo
Version: 6.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Valentina Mukhamedzhanova
QA Contact: BaseOS QE Security Team
Depends On:
Blocks: 1172231
TreeView+ depends on / blocked
Reported: 2014-07-24 15:55 UTC by Dave Sullivan
Modified: 2016-07-26 22:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-07-26 10:08:00 UTC

Attachments (Terms of Use)

Description Dave Sullivan 2014-07-24 15:55:48 UTC
Description of problem:

If you createrepo then build a client/server from that repo then try to use subscription-manager on that client/server you will have problems.

See Bug 962547

Do some change to createrepo so that it automatically sets things up correctly for subscription-manager.

This is problematic because traditionally createrepo has just been a reference implementation of taking a directory structure of rpms and making repodata so you can install them. Lots of questions would need to be answered, like where would createrepo look for the pem file ... if it finds that file does it just assume it's correct or does it check it in some way, what does it do if the checks fail. Is the subscription-manager maintainer ready to monitor createrepo and make sure that any changes are always compatible. What does this do for people creating "normal" (non-subscription-manager) repos., how do they disable it etc. etc.

Version-Release number of selected component (if applicable):


How reproducible:

see above

Additional info:

We have a lot of customer using reposync, there's a workaround but it can be very painful to figure this out.

Can not update a system that is registered with subscription-manager

I don't see createrepo on ACL list but I see it listed as fasttrack.


Comment 2 Dave Sullivan 2014-07-24 16:13:00 UTC
createrepo --subscription-manager-support true

Comment 3 Dave Sullivan 2014-07-24 16:16:11 UTC
per hartsjc

  # Unzip productid, obtain checksum see if already in repomd.xml
  [[ -f ${DIR}/${repo}/productid.gz ]] && gunzip -c ${DIR}/${repo}/productid.gz > ${DIR}/${repo}/productid
  if [[ -f ${DIR}/${repo}/productid ]] ; then
    FileSUM=$(sha256sum ${DIR}/${repo}/productid | cut -d\  -f1)
    RepoSUM=$(grep -e 'type="productid"' -e '<open-checksum' ${DIR}/${repo}/repodata/repomd.xml  | grep -A1 productid | grep checksum | sed -e 's/<\/open-checksum.*$//' -e 's/^.*>//')
    if [[ ${FileSUM} != ${RepoSUM:=none} ]] ; then
      echo -e "Adding productid to ${DIR}/${repo}/repodata/repomd.xml"
      modifyrepo ${DIR}/${repo}/productid ${DIR}/${repo}/repodata/ >/dev/null

Comment 4 James Hartsock 2014-08-15 03:29:46 UTC
if using yum-security, need to also account fro updateinfo...

  # Unzip latest updateinfo.xml, obtain checksum see if already in repomd.xml
  UpdateInfo=$(ls -t ${DIR}/${repo}/*updateinfo.xml.gz* 2>/dev/null | head -n 1)
  [[ -f ${UpdateInfo} ]] && gunzip -c ${UpdateInfo} > ${DIR}/${repo}/updateinfo.xml
  if [[ -f ${DIR}/${repo}/updateinfo.xml ]] ; then
    FileSUM=$(sha256sum ${DIR}/${repo}/updateinfo.xml | cut -d\  -f1)
    RepoSUM=$(grep -e 'type="updateinfo"' -e '<open-checksum' ${DIR}/${repo}/repodata/repomd.xml  | grep -A1 updateinfo | grep checksum | sed -e 's/<\/open-checksum.*$//' -e 's/^.*>//')
    if [[ ${FileSUM} != ${RepoSUM:=none} ]] ; then
      echo -e "Adding updateinfo.xml to repomd.xml"
      modifyrepo ${DIR}/${repo}/updateinfo.xml ${DIR}/${repo}/repodata/ >/dev/null


Comment 5 Dave Sullivan 2015-01-12 14:06:05 UTC
Just to put a note here.

I could see this becoming obsolete with fixes from this BZ.


As fundamentally not sure creatrepo should have a subscription-manager product key understanding.

Comment 6 Valentina Mukhamedzhanova 2016-07-26 10:08:00 UTC
Red Hat Enterprise Linux version 6 is entering the Production 2 phase of its lifetime and this bug doesn't meet the criteria for it, i.e. only high severity issues will be fixed. Please see https://access.redhat.com/support/policy/updates/errata/ for further information.

Comment 7 James Hartsock 2016-07-26 22:03:29 UTC
Probably could move/clone this to RHEL 7.

Note You need to log in before you can comment on or make changes to this bug.