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

Fix local package location xml href #109

Merged
merged 1 commit into from Oct 22, 2019

Conversation

dekimsey
Copy link
Contributor

Package remote location is mangled if it's name contains the same as the root directory path. We noticed this when a new package 'reporting-service' was added to our createrepo pipeline and the location href= became mangled.

What currently happens:

$ mkdir -p /repo/rpms
$ cp ~/reporting-service-0.1.3-1.el7.noarch.rpm /repo/rpms
$ createrepo --pretty --simple-md-filenames /repo
$ zgrep location /repo/repodata/primary.xml.gz
  <location href="rpmsrting-service-0.1.3-1.el7.noarch.rpm"/>

After patch:

...
$ zgrep location /repo/repodata/primary.xml.gz
  <location href="rpms/reporting-service-0.1.3-1.el7.noarch.rpm"/>

If a local package's name starts with the same character as the package's local path, the return XML filename is mangled.
@james-antill
Copy link
Contributor

In theory we should probably do something clever/obvious like:

https://stackoverflow.com/questions/16891340/remove-a-prefix-from-a-string

...but this is obviously fine, and is a two character change.

@james-antill james-antill merged commit 3b07f4c into rpm-software-management:master Oct 22, 2019
@dekimsey dekimsey deleted the patch-1 branch October 22, 2019 15:15
@dekimsey
Copy link
Contributor Author

Just for completion's sake, if anyone runs into this bug there is a trivial work-around. Add a trailing slash to the createrepo command's directory argument.

# broken
createrepo --pretty --simple-md-filenames /repo
# works
createrepo --pretty --simple-md-filenames /repo/

Also, this issue was found on CentOS 7.

  • yum-3.4.3-163.el7.centos.noarch
  • createrepo-0.9.9-28.el7.noarch

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.

None yet

2 participants