From aef81aceab51dee73b94dd48a1a30190b6d432d4 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 6 Sep 2019 11:19:21 +0200 Subject: [PATCH] downloadertools: remove apply_patch and build_patch These seem to be unused. Let me know if this is not the case. --- makepanda/makepanda.py | 10 -- makepanda/makepanda.vcproj | 2 - panda/src/downloadertools/apply_patch.cxx | 46 -------- panda/src/downloadertools/build_patch.cxx | 125 ---------------------- 4 files changed, 183 deletions(-) delete mode 100644 panda/src/downloadertools/apply_patch.cxx delete mode 100644 panda/src/downloadertools/build_patch.cxx diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 0eaf1cf8da..fe01ebd690 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -4605,16 +4605,6 @@ if PkgSkip("OPENAL") == 0 and not RUNTIME: if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0): OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER'] - TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx') - TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj']) - TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS) - TargetAdd('apply_patch.exe', opts=OPTS) - - TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx') - TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj']) - TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS) - TargetAdd('build_patch.exe', opts=OPTS) - if not PkgSkip("ZLIB"): TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx') TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj']) diff --git a/makepanda/makepanda.vcproj b/makepanda/makepanda.vcproj index c2db8fa662..31944e48e6 100644 --- a/makepanda/makepanda.vcproj +++ b/makepanda/makepanda.vcproj @@ -2087,8 +2087,6 @@ - - diff --git a/panda/src/downloadertools/apply_patch.cxx b/panda/src/downloadertools/apply_patch.cxx deleted file mode 100644 index 502d67c89b..0000000000 --- a/panda/src/downloadertools/apply_patch.cxx +++ /dev/null @@ -1,46 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file apply_patch.cxx - */ - -#include "pandabase.h" -#include "panda_getopt.h" -#include "preprocess_argv.h" -#include "patchfile.h" -#include "filename.h" - -using std::cerr; -using std::endl; - -int -main(int argc, char **argv) { - preprocess_argv(argc, argv); - - if (argc < 3) { - cerr << "Usage: apply_patch " << endl; - cerr << "Will overwrite old_file" << endl; - return 1; - } - - Filename patch = argv[1]; - patch.set_binary(); - - Filename file = argv[2]; - file.set_binary(); - - Patchfile pfile; - - cerr << "Applying patch file " << patch << " to " << file << endl; - if (pfile.apply(patch, file) == false) { - cerr << "apply patch failed" << endl; - return 1; - } - - return 0; -} diff --git a/panda/src/downloadertools/build_patch.cxx b/panda/src/downloadertools/build_patch.cxx deleted file mode 100644 index 5c705bb38d..0000000000 --- a/panda/src/downloadertools/build_patch.cxx +++ /dev/null @@ -1,125 +0,0 @@ -/** - * PANDA 3D SOFTWARE - * Copyright (c) Carnegie Mellon University. All rights reserved. - * - * All use of this software is subject to the terms of the revised BSD - * license. You should have received a copy of this license along - * with this source code in a file named "LICENSE." - * - * @file build_patch.cxx - */ - -#include "pandabase.h" -#include "panda_getopt.h" -#include "preprocess_argv.h" -#include "patchfile.h" -#include "filename.h" - -using std::cerr; -using std::endl; - -void -usage() { - cerr << "Usage: build_patch [opts] " << endl; -} - -void -help() { - usage(); - cerr << "\n" - "This program generates a patch file that describes the differences\n" - "between any two source files. The patch file can later be used to\n" - "construct , given . Arbitrary file types, including\n" - "binary files, are supported.\n\n" - - "The patching algorithm can get very slow for very large files. As an\n" - "optimization, if the input files are both Panda Multifiles, the patcher\n" - "will by default patch them on a per-subfile basis, which has the potential\n" - "to be much faster. The -c option will forbid this and force the patcher\n" - "to work on the full file.\n\n" - - "Options:\n\n" - - " -o output_name\n" - " Specify the filename of the patch file to generate.\n\n" - - " -c\n" - " Always generate patches against the complete file, even if the\n" - " input files appear to be multifiles.\n\n" - - " -f footprint_length\n" - " Specify the footprint length for the patching algorithm.\n\n"; -} - -int -main(int argc, char **argv) { - Filename patch_file; - bool complete_file = false; - int footprint_length = 0; - - // extern char *optarg; - extern int optind; - static const char *optflags = "o:cf:h"; - preprocess_argv(argc, argv); - int flag = getopt(argc, argv, optflags); - Filename rel_path; - while (flag != EOF) { - switch (flag) { - case 'o': - patch_file = optarg; - break; - - case 'c': - complete_file = true; - break; - - case 'f': - footprint_length = atoi(optarg); - break; - - case 'h': - help(); - return 1; - case '?': - usage(); - return 1; - default: - cerr << "Unhandled switch: " << flag << endl; - break; - } - flag = getopt(argc, argv, optflags); - } - argc -= (optind - 1); - argv += (optind - 1); - - if (argc < 3) { - usage(); - return 1; - } - - Filename src_file = Filename::from_os_specific(argv[1]); - src_file.set_binary(); - - Filename dest_file = Filename::from_os_specific(argv[2]); - dest_file.set_binary(); - - if (patch_file.empty()) { - patch_file = dest_file.get_fullpath() + ".pch"; - } - Patchfile pfile; - - pfile.set_allow_multifile(!complete_file); - if (footprint_length != 0) { - cerr << "Footprint length is " << footprint_length << "\n"; - pfile.set_footprint_length(footprint_length); - } - - cerr << "Building patch file to convert " << src_file << " to " - << dest_file << endl; - if (pfile.build(src_file, dest_file, patch_file) == false) { - cerr << "build patch failed" << endl; - return 1; - } - - return 0; -}