1#!/usr/bin/python 2# -*- Mode: python -*- 3 4# Copyright (C) 2001-2019 Artifex Software, Inc. 5# All Rights Reserved. 6# 7# This software is provided AS-IS with no warranty, either express or 8# implied. 9# 10# This software is distributed under license and may not be copied, 11# modified or distributed except as expressly authorized under the terms 12# of the license contained in the file LICENSE in this distribution. 13# 14# Refer to licensing information at http://www.artifex.com or contact 15# Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, 16# CA 94945, U.S.A., +1(415)492-9861, for further information. 17# 18 19 20import os,sys 21import optparse, myoptparse 22 23if __name__ == "__main__": 24 25 optionsParser=optparse.OptionParser() 26 optionsParser.add_option('--checksum1',action='store',help="path to checksum db 1") 27 optionsParser.add_option('--checksum2',action='store',help="path to checksum db 2") 28 (options,arguments)=myoptparse.parseCommandLineBasic(optionsParser) 29 30 myself=options.myself 31 checksum1=options.checksum1 32 checksum2=options.checksum2 33 34 if not checksum1 or not checksum2: 35 print myself,"both checksum files are required" 36 sys.exit(1) 37 38 try: 39 print checksum1 40 checksum1_db = anydbm.open(checksum1, 'r') 41 except: 42 checksum1_db=None 43 print myself,"ERROR: cannot open "+checksum1 44 45 try: 46 print checksum2 47 checksum2_db = anydbm.open(checksum2, 'r') 48 except: 49 checksum2_db=None 50 print myself,"ERROR: cannot open "+checksum2 51 52 if not checksum1 or not checksum2: 53 sys.exit(1) 54 55