#!/bin/bash # Copyright (c) Luke Davis, 2023, all rights reserved. # This script is contributed to the public domain, and by using it you agree to assume all responsibility for whatever happens by using it. # Feel free to fold, mutilate, spindle, or twist it out of all recognition. Just don't come cryin' to me when it breaks. set -e # To change the diffing or sorting options from defaults, alter the below diffOpts="" sortOpts="" function usage { echo 1>&2 "Usage: $0 OLD_LIBRARY_ZIP NEW_LIBRARY_ZIP" echo 1>&2 "Outputs a diff to STDOUT, you may want to redirect." exit 255 } # Need two files [[ -z "$1" || -z "$2" ]] && usage # Files must exist [[ -f "$1" && -f "$2" ]] || { echo 1>&2 "One or both of the input files does not exist or can not be read." usage } # Create a temporary directory, and delete it when done tmpDir=$(mktemp -qd) trap 'rm -r "$tmpDir"' EXIT mkdir "$tmpDir"/{1,2} echo 1>&2 "Unzipping..." unzip -qd "$tmpDir/1" "$1" unzip -qd "$tmpDir/2" "$2" # Change the list below, to control what gets excluded from the diff. # It's okay if it appears in one, the other, both, or neither library. # By default, it attempts to exclude obvious NVDA modules. echo 1>&2 "Removing NVDA modules..." xargs -r -I XXX <<"EOD" rm -rf "$tmpDir"/{1,2}/"XXX" addonAPIVersion.pyc addonHandler _addonStore addonStore api.pyc appModuleHandler.pyc appModules characterProcessing.pyc buildVersion.pyc _buildVersion.pyc browseMode.pyc braille.pyc brailleTables.pyc brailleViewer brailleDisplayDrivers brailleInput.pyc bdDetect.pyc baseObject.pyc autoSettingsUtils audioDucking.pyc aria.pyc colors.pyc comHelper.pyc comInterfaces compoundDocuments.pyc COMRegistrationFixes config contentRecog controlTypes core.pyc cursorManager.pyc diffHandler.pyc displayModel.pyc documentationUtils.pyc documentBase.pyc documentNavigation driverHandler.pyc easeOfAccess.pyc editableText.pyc eventHandler.pyc exceptions.pyc extensionPoints fileUtils.pyc garbageHandler.pyc globalCommands.pyc globalPluginHandler.pyc globalPlugins globalVars.pyc gui hidpi.pyc hwIo hwPortUtils.pyc IAccessibleHandler inputCore.pyc installer.pyc JABHandler.pyc keyboardHandler.pyc keyLabels.pyc languageHandler.pyc locale.pyc localesData.pyc locationHelper.pyc logHandler.pyc louisHelper.pyc __main__.pyc mathPres mathType.pyc monkeyPatches mouseHandler.pyc msoAutoShapeTypes.pyc nvdaBuiltin.pyc NVDAHelper.pyc NVDAObjects NVDAState.pyc nvwave.pyc objbase.pyc objidl.pyc oleacc.pyc oleTypes.pyc pythonConsole.pyc queueHandler.pyc review.pyc RPCConstants.pyc screenBitmap.pyc screenExplorer.pyc scriptHandler.pyc sourceEnv.pyc speech speechDictHandler speechViewer.pyc speechXml.pyc synthDriverHandler.pyc synthDrivers synthSettingsRing.pyc systemUtils.pyc tableUtils.pyc textInfos textUtils.pyc tones.pyc touchHandler.pyc touchTracker.pyc treeInterceptorHandler.pyc UIAHandler ui.pyc updateCheck.pyc utils versionInfo.pyc virtualBuffers vision visionEnhancementProviders vkCodes.pyc watchdog.pyc wave.pyc winAPI winConsoleHandler.pyc windowUtils.pyc winGDI.pyc winInputHook.pyc winKernel.pyc winUser.pyc winVersion.pyc XMLFormatting.pyc EOD echo 1>&2 "Sorting and diffing..." cd "$tmpDir" diff $diffOpts <(find 1 -type f -printf '%P\n' | sort $sortOpts) <(find 2 -type f -printf '%P\n' | sort $sortOpts) cd - > /dev/null 2>&1