userland-fetch revision 3979
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# CDDL HEADER START
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# The contents of this file are subject to the terms of the
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# Common Development and Distribution License (the "License").
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# You may not use this file except in compliance with the License.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# See the License for the specific language governing permissions
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# and limitations under the License.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# When distributing Covered Code, include this CDDL HEADER in each
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# If applicable, add the following below this CDDL HEADER, with the
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
0b6a21892fd667342bd302336bc327e93e365bdavboxsync# CDDL HEADER END
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# fetch.py - a file download utility
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# A simple program similiar to wget(1), but handles local file copy, ignores
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync# directories, and verifies file hashes.
ed144bee38a6c8b914d3f027f1c118a2b0482d4fvboxsync """ Function to decode and print IOError type exception """
ed144bee38a6c8b914d3f027f1c118a2b0482d4fvboxsync # force migration away from sha1
try:
return False
while True:
try:
try:
return False
try:
return False
return False
try:
return None
return None
try:
return None
while True:
return filename
if tmp:
return urls
print "Usage: %s [-f|--file (file)] [-l|--link] [-h|--hash (hash)] [-s|--search (search-dir)] --url (url)" % (sys.argv[0].split('/')[-1])
try:
try: