OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file provides a command-line interface to | 5 // This file provides a command-line interface to |
6 // upgrade_test::GenerateAlternateVersion(). | 6 // upgrade_test::GenerateAlternateVersion(). |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <cstdio> | 10 #include <cstdio> |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 if (!cmd_line->HasSwitch(switches::kForce) && base::PathExists(out)) { | 153 if (!cmd_line->HasSwitch(switches::kForce) && base::PathExists(out)) { |
154 DumpUsage(*cmd_line, errors::OUT_FILE_EXISTS, out.value()); | 154 DumpUsage(*cmd_line, errors::OUT_FILE_EXISTS, out.value()); |
155 return EXIT_FAILURE; | 155 return EXIT_FAILURE; |
156 } | 156 } |
157 | 157 |
158 upgrade_test::Direction direction = GetDirection(*cmd_line); | 158 upgrade_test::Direction direction = GetDirection(*cmd_line); |
159 | 159 |
160 std::wstring original_version; | 160 std::wstring original_version; |
161 std::wstring new_version; | 161 std::wstring new_version; |
162 | 162 |
163 if (upgrade_test::GenerateAlternateVersion( | 163 if (upgrade_test::GenerateAlternateVersion(mini_installer, out, direction, |
164 base::MakeAbsoluteFilePath(mini_installer), | 164 &original_version, &new_version)) { |
165 base::MakeAbsoluteFilePath(out), direction, &original_version, | |
166 &new_version)) { | |
167 fwprintf(stdout, L"Generated version %s from version %s\n", | 165 fwprintf(stdout, L"Generated version %s from version %s\n", |
168 new_version.c_str(), original_version.c_str()); | 166 new_version.c_str(), original_version.c_str()); |
169 return EXIT_SUCCESS; | 167 return EXIT_SUCCESS; |
170 } | 168 } |
171 | 169 |
172 DumpUsage(*cmd_line, errors::GENERATION_FAILED, mini_installer.value()); | 170 DumpUsage(*cmd_line, errors::GENERATION_FAILED, mini_installer.value()); |
173 return EXIT_FAILURE; | 171 return EXIT_FAILURE; |
174 } | 172 } |
OLD | NEW |