From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B0EC41381F3 for ; Fri, 18 Oct 2013 06:46:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ECB74E0B6C; Fri, 18 Oct 2013 06:46:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 65443E0B6C for ; Fri, 18 Oct 2013 06:46:19 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6156533F06F for ; Fri, 18 Oct 2013 06:46:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D2507E5462 for ; Fri, 18 Oct 2013 06:46:16 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1382078540.1be270280f8ca26ff76dfc3b86a8ddabda09d4f6.dol-sen@gentoo> Subject: [gentoo-commits] proj/mirrorselect:master commit in: mirrorselect/ X-VCS-Repository: proj/mirrorselect X-VCS-Files: mirrorselect/main.py mirrorselect/selectors.py X-VCS-Directories: mirrorselect/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 1be270280f8ca26ff76dfc3b86a8ddabda09d4f6 X-VCS-Branch: master Date: Fri, 18 Oct 2013 06:46:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3b92da66-fde3-40b0-9502-88f05a94b51b X-Archives-Hash: 3b18817d62a4a8dbd5749df95dbdf019 commit: 1be270280f8ca26ff76dfc3b86a8ddabda09d4f6 Author: Brian Dolbec gentoo org> AuthorDate: Fri Oct 18 06:42:20 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Fri Oct 18 06:42:20 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mirrorselect.git;a=commit;h=1be27028 Add -f, --file & -m, --md5 options to override mirrorselect-test file used. --- mirrorselect/main.py | 11 +++++++++++ mirrorselect/selectors.py | 14 ++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/mirrorselect/main.py b/mirrorselect/main.py index 8a1bfca..5844a65 100755 --- a/mirrorselect/main.py +++ b/mirrorselect/main.py @@ -229,6 +229,17 @@ class MirrorSelect(object): group.add_option( "-q", "--quiet", action="store_const", const=0, dest="verbosity", help="Quiet mode") + group.add_option( + "-f", "--file", action="store", default='mirrorselect-test', + help="An alternate file to download for deep testing. " + "Please choose the file carefully as to not abuse the system " + "by selecting an overly large size file. You must also " + " use the -m, --md5 option.") + group.add_option( + "-m", "--md5", action="store", default='bdf077b2e683c506bf9e8f2494eeb044', + help="An alternate file md5sum value used to compare the downloaded " + "file against for deep testing.") + if len(argv) == 1: parser.print_help() diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py index d72fd23..2c7bac8 100644 --- a/mirrorselect/selectors.py +++ b/mirrorselect/selectors.py @@ -191,6 +191,8 @@ class Deep(object): self._dns_timeout = options.timeout self._connect_timeout = options.timeout self._download_timeout = options.timeout + self.test_file = options.file + self.test_md5 = options.md5 addr_families = [] if options.ipv4: @@ -221,8 +223,12 @@ class Deep(object): for host in hosts: prog += 1 - self.output.print_info('Downloading 100k files from each mirror... [%s of %s]'\ - % (prog, num_hosts) ) + if self.test_file is not 'mirrorselect-test': + self.output.print_info('Downloading %s files from each mirror... [%s of %s]'\ + % (self.test_file, prog, num_hosts) ) + else: + self.output.print_info('Downloading 100k files from each mirror... [%s of %s]'\ + % (prog, num_hosts) ) mytime, ignore = self.deeptime(host, maxtime) @@ -259,9 +265,9 @@ class Deep(object): self.output.write('\n_deeptime(): maxtime is %s\n' % maxtime, 2) if url.endswith('/'): #append the path to the testfile to the URL - url = url + 'distfiles/mirrorselect-test' + url = url + 'distfiles/' + self.test_file else: - url = url + '/distfiles/mirrorselect-test' + url = url + '/distfiles/' + self.test_file url_parts = url_parse(url)