userland-fetch revision 135
18N/A# The contents of this file are subject to the terms of the 18N/A# Common Development and Distribution License (the "License"). 18N/A# You may not use this file except in compliance with the License. 18N/A# See the License for the specific language governing permissions 18N/A# and limitations under the License. 18N/A# When distributing Covered Code, include this CDDL HEADER in each 18N/A# If applicable, add the following below this CDDL HEADER, with the 18N/A# fields enclosed by brackets "[]" replaced with your own identifying 18N/A# information: Portions Copyright [yyyy] [name of copyright owner] 58N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. 18N/A# A simple program similiar to wget(1), but handles local file copy, ignores 18N/A# directories, and verifies file hashes. 18N/A # return the name of the file that we downloaded the data to. 42N/A # filename should always be first 42N/A # command line url is a fallback, so it's last 42N/A print "Usage: %s [-f|--file (file)] [-l|--link] [-h|--hash (hash)] [-s|--search (search-dir)] --url (url)" %
(sys.argv[0].split('/')[-1]) 42N/A ["file=", "link", "hash=", "search=", "url="]) 58N/A print "not found, skipping file copy" 58N/A print "\n copying..." 58N/A print "\n linking..." 58N/A print "\n downloading...",
58N/A print "\n validating...",
58N/A print "skipping (no hash)" 58N/A print "corruption detected"