Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/ApplyTag/apply_tag_tool.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/smartany/smart_any_fwd.h ('k') | tools/ApplyTag/build.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ApplyTag/apply_tag_tool.cc
diff --git a/tools/ApplyTag/apply_tag_tool.cc b/tools/ApplyTag/apply_tag_tool.cc
deleted file mode 100644
index bdea39897a11d9f75dd88615bf0a1450e8a2696c..0000000000000000000000000000000000000000
--- a/tools/ApplyTag/apply_tag_tool.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2007-2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-//
-// The main file for a simple tool to apply a tag to a signed file.
-#include <Windows.h>
-#include <TCHAR.h>
-#include "omaha/base/apply_tag.h"
-#include "omaha/base/file.h"
-#include "omaha/base/path.h"
-#include "omaha/base/utils.h"
-
-using omaha::CreateDir;
-using omaha::ConcatenatePath;
-using omaha::File;
-using omaha::GetCurrentDir;
-using omaha::GetDirectoryFromPath;
-using omaha::GetFileFromPath;
-
-int _tmain(int argc, TCHAR* argv[]) {
- if (argc != 4 && argc != 5) {
- _tprintf(_T("Incorrect number of arguments!\n"));
- _tprintf(_T("Usage: ApplyTag <signed_file> <outputfile> <tag> [append]\n"));
- return -1;
- }
-
- const TCHAR* file = argv[1];
- if (!File::Exists(file)) {
- _tprintf(_T("File \"%s\" not found!\n"), file);
- return -1;
- }
-
- bool append = false;
- if (argc == 5 && _tcsicmp(argv[4], _T("append")) == 0) {
- append = true;
- }
-
- CString dir = GetDirectoryFromPath(argv[2]);
- CString path = ConcatenatePath(GetCurrentDir(), dir);
- ASSERT1(!path.IsEmpty());
- if (!File::Exists(path)) {
- HRESULT hr = CreateDir(path, NULL);
- if (FAILED(hr)) {
- _tprintf(_T("Could not create dir %s\n"), path);
- return hr;
- }
- }
-
- CString file_name = GetFileFromPath(argv[2]);
- CString out_path = ConcatenatePath(path, file_name);
- ASSERT1(!out_path.IsEmpty());
- ASSERT1(File::Exists(path));
- omaha::ApplyTag tag;
- HRESULT hr = tag.Init(argv[1],
- CT2CA(argv[3]),
- lstrlenA(CT2CA(argv[3])),
- out_path,
- append);
- if (hr == E_INVALIDARG) {
- _tprintf(_T("The tag_string %s contains invalid characters."), argv[3]);
- _tprintf(_T(" We accept the following ATL RegEx '[-%{}/\a&=._]*'\n"));
- return hr;
- }
-
- if (FAILED(hr)) {
- _tprintf(_T("Tag.Init Failed hr = %x\n"), hr);
- return hr;
- }
-
- hr = tag.EmbedTagString();
- if (hr == APPLYTAG_E_ALREADY_TAGGED) {
- _tprintf(_T("The binary %s is already tagged."), argv[1]);
- _tprintf(_T(" In order to append the tag string, use the append flag.\n"));
- _tprintf(_T("Usage: ApplyTag <signed_file> <outputfile> <tag> [append]\n"));
- }
-
- return 0;
-}
« no previous file with comments | « third_party/smartany/smart_any_fwd.h ('k') | tools/ApplyTag/build.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698