AU: Remove obsolete postinst --postcommit call.
BUG=6251
TEST=unit test, tested update on device
Change-Id: Ib44b4698cab5fa1f2d0b5afd04dca500c8dbe84c
Review URL: http://codereview.chromium.org/4679003
diff --git a/postinstall_runner_action.cc b/postinstall_runner_action.cc
index 21d7231..9a84563 100644
--- a/postinstall_runner_action.cc
+++ b/postinstall_runner_action.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -58,7 +58,6 @@
vector<string> command;
command.push_back(temp_dir + kPostinstallScript);
command.push_back(install_device);
- command.push_back(precommit_ ? "" : "--postcommit");
rc = 0;
TEST_AND_RETURN(Subprocess::SynchronousExec(command, &rc));
bool success = (rc == 0);
diff --git a/postinstall_runner_action.h b/postinstall_runner_action.h
index 1169af9..c2498e0 100644
--- a/postinstall_runner_action.h
+++ b/postinstall_runner_action.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,7 +28,7 @@
class PostinstallRunnerAction : public Action<PostinstallRunnerAction> {
public:
- explicit PostinstallRunnerAction(bool precommit) : precommit_(precommit) {}
+ PostinstallRunnerAction() {}
typedef ActionTraits<PostinstallRunnerAction>::InputObjectType
InputObjectType;
typedef ActionTraits<PostinstallRunnerAction>::OutputObjectType
@@ -44,10 +44,6 @@
std::string Type() const { return StaticType(); }
private:
- // If true, this action runs before we've committed to the new update
- // (by marking it as bootable in the partition table).
- bool precommit_;
-
DISALLOW_COPY_AND_ASSIGN(PostinstallRunnerAction);
};
diff --git a/postinstall_runner_action_unittest.cc b/postinstall_runner_action_unittest.cc
index 578f7f4..55fe79f 100644
--- a/postinstall_runner_action_unittest.cc
+++ b/postinstall_runner_action_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -116,7 +116,7 @@
InstallPlan install_plan;
install_plan.install_path = dev;
feeder_action.set_obj(install_plan);
- PostinstallRunnerAction runner_action(true);
+ PostinstallRunnerAction runner_action;
BondActions(&feeder_action, &runner_action);
ObjectCollectorAction<InstallPlan> collector_action;
BondActions(&runner_action, &collector_action);
@@ -153,7 +153,7 @@
// Death tests don't seem to be working on Hardy
TEST_F(PostinstallRunnerActionTest, DISABLED_RunAsRootDeathTest) {
ASSERT_EQ(0, getuid());
- PostinstallRunnerAction runner_action(true);
+ PostinstallRunnerAction runner_action;
ASSERT_DEATH({ runner_action.TerminateProcessing(); },
"postinstall_runner_action.h:.*] Check failed");
}
diff --git a/update_attempter.cc b/update_attempter.cc
index a108001..ef6a949 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -159,10 +159,8 @@
new OmahaEvent(
OmahaEvent::kTypeUpdateDownloadFinished),
new LibcurlHttpFetcher));
- shared_ptr<PostinstallRunnerAction> postinstall_runner_action_precommit(
- new PostinstallRunnerAction(true));
- shared_ptr<PostinstallRunnerAction> postinstall_runner_action_postcommit(
- new PostinstallRunnerAction(false));
+ shared_ptr<PostinstallRunnerAction> postinstall_runner_action(
+ new PostinstallRunnerAction);
shared_ptr<OmahaRequestAction> update_complete_action(
new OmahaRequestAction(prefs_,
omaha_request_params_,
@@ -181,10 +179,7 @@
actions_.push_back(shared_ptr<AbstractAction>(download_started_action));
actions_.push_back(shared_ptr<AbstractAction>(download_action));
actions_.push_back(shared_ptr<AbstractAction>(download_finished_action));
- actions_.push_back(shared_ptr<AbstractAction>(
- postinstall_runner_action_precommit));
- actions_.push_back(shared_ptr<AbstractAction>(
- postinstall_runner_action_postcommit));
+ actions_.push_back(shared_ptr<AbstractAction>(postinstall_runner_action));
actions_.push_back(shared_ptr<AbstractAction>(update_complete_action));
// Enqueue the actions
@@ -204,9 +199,7 @@
BondActions(kernel_filesystem_copier_action.get(),
download_action.get());
BondActions(download_action.get(),
- postinstall_runner_action_precommit.get());
- BondActions(postinstall_runner_action_precommit.get(),
- postinstall_runner_action_postcommit.get());
+ postinstall_runner_action.get());
SetStatusAndNotify(UPDATE_STATUS_CHECKING_FOR_UPDATE);
processor_->StartProcessing();
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index eec342d..53ffc89 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -85,7 +85,7 @@
FilesystemCopierAction filesystem_copier_action(false);
EXPECT_EQ(kActionCodeFilesystemCopierError,
GetErrorCodeForAction(&filesystem_copier_action, kActionCodeError));
- PostinstallRunnerAction postinstall_runner_action(true);
+ PostinstallRunnerAction postinstall_runner_action;
EXPECT_EQ(kActionCodePostinstallRunnerError,
GetErrorCodeForAction(&postinstall_runner_action,
kActionCodeError));
@@ -171,7 +171,6 @@
DownloadAction::StaticType(),
OmahaRequestAction::StaticType(),
PostinstallRunnerAction::StaticType(),
- PostinstallRunnerAction::StaticType(),
OmahaRequestAction::StaticType()
};
for (size_t i = 0; i < arraysize(kActionTypes); ++i) {