OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 #include <sys/types.h> | 5 #include <sys/types.h> |
6 #include <sys/stat.h> | 6 #include <sys/stat.h> |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 if (FLAGS_old_image.empty()) { | 179 if (FLAGS_old_image.empty()) { |
180 LOG(INFO) << "Generating full update"; | 180 LOG(INFO) << "Generating full update"; |
181 } else { | 181 } else { |
182 LOG(INFO) << "Generating delta update"; | 182 LOG(INFO) << "Generating delta update"; |
183 CHECK(!FLAGS_old_dir.empty()); | 183 CHECK(!FLAGS_old_dir.empty()); |
184 CHECK(!FLAGS_new_dir.empty()); | 184 CHECK(!FLAGS_new_dir.empty()); |
185 if ((!IsDir(FLAGS_old_dir.c_str())) || (!IsDir(FLAGS_new_dir.c_str()))) { | 185 if ((!IsDir(FLAGS_old_dir.c_str())) || (!IsDir(FLAGS_new_dir.c_str()))) { |
186 LOG(FATAL) << "old_dir or new_dir not directory"; | 186 LOG(FATAL) << "old_dir or new_dir not directory"; |
187 } | 187 } |
188 } | 188 } |
189 DeltaDiffGenerator::GenerateDeltaUpdateFile(FLAGS_old_dir, | 189 if (DeltaDiffGenerator::GenerateDeltaUpdateFile(FLAGS_old_dir, |
190 FLAGS_old_image, | 190 FLAGS_old_image, |
191 FLAGS_new_dir, | 191 FLAGS_new_dir, |
192 FLAGS_new_image, | 192 FLAGS_new_image, |
193 FLAGS_old_kernel, | 193 FLAGS_old_kernel, |
194 FLAGS_new_kernel, | 194 FLAGS_new_kernel, |
195 FLAGS_out_file, | 195 FLAGS_out_file, |
196 FLAGS_private_key); | 196 FLAGS_private_key)) { |
197 | 197 return 0; |
198 return 0; | 198 } else { |
petkov
2011/02/09 00:38:10
Prefer getting rid of the else...
| |
199 return 1; | |
200 } | |
199 } | 201 } |
200 | 202 |
201 } // namespace {} | 203 } // namespace {} |
202 | 204 |
203 } // namespace chromeos_update_engine | 205 } // namespace chromeos_update_engine |
204 | 206 |
205 int main(int argc, char** argv) { | 207 int main(int argc, char** argv) { |
206 return chromeos_update_engine::Main(argc, argv); | 208 return chromeos_update_engine::Main(argc, argv); |
207 } | 209 } |
OLD | NEW |