diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-05-31 19:44:14 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-05-31 19:44:14 +0200 |
commit | c22a3cdf9c61e6abc4e107ec9932b061f53d69f3 (patch) | |
tree | 6452b90d18243e8034867a0db1df5af91ce9aeff | |
parent | dedb9339ef45810daff2b068ff8d434927547c27 (diff) | |
download | scripts-c22a3cdf9c61e6abc4e107ec9932b061f53d69f3.tar.gz |
arch-proxy.py: drop leading slash
The path already starts with a slash, do not concatenate it with another
slash from the mirror URL.
-rwxr-xr-x | arch-proxy.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch-proxy.py b/arch-proxy.py index 9da960c..a8f5fd0 100755 --- a/arch-proxy.py +++ b/arch-proxy.py @@ -259,12 +259,12 @@ class SomeServer(http.server.HTTPServer): super().__init__(addr, handler) self.cachedir = args.cachedir self.is_readonly = args.readonly - self.mirrors = args.mirrors + self.mirrors = [m.rstrip('/') for m in args.mirrors] if not args.date: self.archive_url = None else: archive_mirror = "https://archive.archlinux.org/repos/" - self.archive_url = archive_mirror + args.date + "/" + self.archive_url = archive_mirror + args.date self.mirrors.append(self.archive_url) def dump_config(self): @@ -301,7 +301,7 @@ parser.add_argument("--port", type=int, default=8001, parser.add_argument("--date", type=parse_date, help="Provide a repository snapshot from 'yyyy/mm/dd'") parser.add_argument("--mirror", dest="mirrors", metavar='URL', nargs="+", - type=mirror_url, default=["https://mirror.nl.leaseweb.net/archlinux/"], + type=mirror_url, default=["https://mirror.nl.leaseweb.net/archlinux"], help="Mirror list") if __name__ == '__main__': |