Skip to content

Commit 4829d0a

Browse files
committed
cstrans-df-run: make runCmdFromExecList() a member function
... so that it can easily access TransformerProps. No change in behavior intended with this commit.
1 parent 5e89e70 commit 4829d0a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/cstrans-df-run.cc

+8-3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ class DockerFileTransformer {
8484

8585
/// match in-line comments
8686
const RE reComment_ = RE("^\\s*#.*$");
87+
88+
/// construct transformed RUN command from execList
89+
std::string runCmdFromExecList(const TStringList &execList);
8790
};
8891

8992
/// parse serialized list in the form: "item1", "item2", ...
@@ -169,9 +172,11 @@ std::string runQuoteArg(std::string arg)
169172
return arg;
170173
}
171174

172-
std::string runCmdFromExecList(const TStringList &execList)
175+
/// construct transformed RUN command from execList
176+
std::string DockerFileTransformer::runCmdFromExecList(
177+
const TStringList &execList)
173178
{
174-
// construct RUN ["cmd", "arg1", "arg2", ...] from execList
179+
// construct ["cmd", "arg1", "arg2", ...] from execList
175180
std::string runLine = "[";
176181
int i = 0;
177182
for (const std::string &arg : execList) {
@@ -205,7 +210,7 @@ void DockerFileTransformer::transformRunLine(std::string *pRunLine)
205210
// arbitrary shell code...
206211
appendShellExec(&execList, cmd);
207212

208-
newRunLine += runCmdFromExecList(execList);
213+
newRunLine += this->runCmdFromExecList(execList);
209214
if (tp_.verbose) {
210215
// diagnostic output printed with --verbose
211216
std::cerr << prog_name << " <<< " << *pRunLine << std::endl;

0 commit comments

Comments
 (0)