Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 1 commit comment
  • 1 contributor
Commits on Mar 14, 2012
@mikewallace1979 mikewallace1979 Fix missing re import 03703c6
@mikewallace1979 mikewallace1979 Don't return component as reponame if component is "."
Using a component name of "." in sources.xml means we end up with
correctly resolving URLs for repositories that don't use components
(e.g. http://dl.fedoraproject.org/pub/epel), however get_repo_name
would then return a reponame of ".". If multiple sources were used with
"." components, Yum.get_config would then hit a
ConfigParser.DuplicateSectionError, and then enter an infinite loop.

This patch modifies get_repo_name so that component names of "." are not
returned as the reponame, which then produces the correct behaviour
in Yum.get_config.
2e69f91
Showing with 2 additions and 1 deletion.
  1. +1 −1 src/lib/Server/Plugins/Packages/Source.py
  2. +1 −0 src/lib/Server/Plugins/Packages/Yum.py
View
2 src/lib/Server/Plugins/Packages/Source.py
@@ -135,7 +135,7 @@ def setup_data(self, force_update=False):
def get_repo_name(self, url_map):
# try to find a sensible name for a repo
- if url_map['component']:
+ if url_map['component'] and url_map['component'] != '.':
return url_map['component']
else:
name = None
View
1 src/lib/Server/Plugins/Packages/Yum.py
@@ -7,6 +7,7 @@
import random
import logging
import threading
+import re
import lxml.etree
from UserDict import DictMixin
from subprocess import Popen, PIPE, STDOUT

Showing you all comments on commits in this comparison.

@mikewallace1979

Ok, no need for this change. The trick is to specify the url as rawurl in sources.xml. See https://gist.github.com/2036883#comments.

Something went wrong with that request. Please try again.