Not sure exactly why sanitize_repo() was written this way; annotate traces it to a rename from an earlier file and I was too lazy to go back farther.
Anyways, I want to use https, so rework this code to add it. --- src/sbin/lorax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
On Thu, Jul 31, 2014 at 03:41:08PM -0400, Colin Walters wrote:
Not sure exactly why sanitize_repo() was written this way; annotate traces it to a rename from an earlier file and I was too lazy to go back farther.
Anyways, I want to use https, so rework this code to add it.
src/sbin/lorax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
From 1080ba885b70ed89f875415806011fced3c5bc28 Mon Sep 17 00:00:00 2001 From: Colin Walters walters@verbum.org Date: Thu, 31 Jul 2014 15:39:06 -0400 Subject: [PATCH] main: https is a sane package source URL scheme
Not sure exactly why sanitize_repo() was written this way; annotate traces it to a rename from an earlier file and I was too lazy to go back farther.
Anyways, I want to use https, so rework this code to add it.
src/sbin/lorax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/sbin/lorax b/src/sbin/lorax index 8dfd20f..8978a64 100755 --- a/src/sbin/lorax +++ b/src/sbin/lorax @@ -214,13 +214,13 @@ def get_yum_base_object(installroot, repositories, mirrorlists=None, tempdir="/var/tmp", proxy=None, excludepkgs=None):
def sanitize_repo(repo):
"""Convert bare paths to file:/// URIs, and silently reject protocols unhandled by yum""" if repo.startswith("/"): return "file://{0}".format(repo)
elif (repo.startswith("http://") or repo.startswith("ftp://")or repo.startswith("file://")):
c = repo.find('://')if c > 0 and repo[:c] in ('http', 'https', 'ftp', 'file'): return repo
else:return None
return Nonemirrorlists = mirrorlists or [] excludepkgs = excludepkgs or []
-- 1.8.3.1
I like the idea, but's that, umm, kinda ugly :)
elif any(repo.startswith(p) for p in ('http://', 'https://', 'ftp://', 'file'://)):
is more pythonic.
On Thu, Jul 31, 2014 at 05:10:19PM -0400, Colin Walters wrote:
On Thu, Jul 31, 2014, at 04:39 PM, Brian C. Lane wrote:
elif any(repo.startswith(p) for p in ('http://', 'https://', 'ftp://', 'file'://)):
is more pythonic.
Ok, new patch attached.
From c9be2562fd2cc3b170b66b2255b71e25c3ffbf77 Mon Sep 17 00:00:00 2001 From: Colin Walters walters@verbum.org Date: Thu, 31 Jul 2014 15:39:06 -0400 Subject: [PATCH] main: https is a sane package source URL scheme
Not sure exactly why sanitize_repo() was written this way; annotate traces it to a rename from an earlier file and I was too lazy to go back farther.
Anyways, I want to use https, so rework this code to add it.
src/sbin/lorax | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sbin/lorax b/src/sbin/lorax index 8dfd20f..8937c63 100755 --- a/src/sbin/lorax +++ b/src/sbin/lorax @@ -214,10 +214,10 @@ def get_yum_base_object(installroot, repositories, mirrorlists=None, tempdir="/var/tmp", proxy=None, excludepkgs=None):
def sanitize_repo(repo):
"""Convert bare paths to file:/// URIs, and silently reject protocols unhandled by yum""" if repo.startswith("/"): return "file://{0}".format(repo)
elif (repo.startswith("http://") or repo.startswith("ftp://")or repo.startswith("file://")):
elif any(repo.startswith(p) for p in ('http://', 'https://', 'ftp://', 'file://')): return repo else: return None-- 1.8.3.1
Ack, I'll get this added to lorax for you.
anaconda-patches@lists.fedorahosted.org