mirror of https://github.com/cutefishos/calamares
Merge branch 'scripting'
commit
15d4245074
@ -0,0 +1,120 @@
|
|||||||
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
*
|
||||||
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
*
|
||||||
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Calamares is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "CommandList.h"
|
||||||
|
|
||||||
|
#include "GlobalStorage.h"
|
||||||
|
#include "JobQueue.h"
|
||||||
|
|
||||||
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
|
#include <QVariantList>
|
||||||
|
|
||||||
|
static QStringList get_variant_stringlist( const QVariantList& l )
|
||||||
|
{
|
||||||
|
QStringList retl;
|
||||||
|
unsigned int c = 0;
|
||||||
|
for ( const auto& v : l )
|
||||||
|
{
|
||||||
|
if ( v.type() == QVariant::String )
|
||||||
|
retl.append( v.toString() );
|
||||||
|
else
|
||||||
|
cDebug() << "WARNING Bad CommandList element" << c << v.type() << v;
|
||||||
|
++c;
|
||||||
|
}
|
||||||
|
return retl;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CalamaresUtils
|
||||||
|
{
|
||||||
|
|
||||||
|
CommandList::CommandList( bool doChroot )
|
||||||
|
: m_doChroot( doChroot )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandList::CommandList::CommandList( const QVariant& v, bool doChroot )
|
||||||
|
: CommandList( doChroot )
|
||||||
|
{
|
||||||
|
if ( v.type() == QVariant::List )
|
||||||
|
{
|
||||||
|
const auto v_list = v.toList();
|
||||||
|
if ( v_list.count() )
|
||||||
|
append( get_variant_stringlist( v_list ) );
|
||||||
|
else
|
||||||
|
cDebug() << "WARNING: Empty CommandList";
|
||||||
|
}
|
||||||
|
else if ( v.type() == QVariant::String )
|
||||||
|
append( v.toString() );
|
||||||
|
else
|
||||||
|
cDebug() << "WARNING: CommandList does not understand variant" << v.type();
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandList::~CommandList()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Calamares::JobResult CommandList::run( const QObject* parent )
|
||||||
|
{
|
||||||
|
System::RunLocation location = m_doChroot ? System::RunLocation::RunInTarget : System::RunLocation::RunInHost;
|
||||||
|
|
||||||
|
/* Figure out the replacement for @@ROOT@@ */
|
||||||
|
QString root = QStringLiteral( "/" );
|
||||||
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
|
if ( location == System::RunLocation::RunInTarget )
|
||||||
|
{
|
||||||
|
if ( !gs || !gs->contains( "rootMountPoint" ) )
|
||||||
|
{
|
||||||
|
cDebug() << "ERROR: No rootMountPoint defined.";
|
||||||
|
return Calamares::JobResult::error( parent->tr( "Could not run command." ),
|
||||||
|
parent->tr( "No rootMountPoint is defined, so command cannot be run in the target environment." ) );
|
||||||
|
}
|
||||||
|
root = gs->value( "rootMountPoint" ).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( CommandList::const_iterator i = cbegin(); i != cend(); ++i )
|
||||||
|
{
|
||||||
|
QString processed_cmd = *i;
|
||||||
|
processed_cmd.replace( "@@ROOT@@", root ); // FIXME?
|
||||||
|
bool suppress_result = false;
|
||||||
|
if ( processed_cmd.startsWith( '-' ) )
|
||||||
|
{
|
||||||
|
suppress_result = true;
|
||||||
|
processed_cmd.remove( 0, 1 ); // Drop the - // FIXME?
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList shell_cmd { "/bin/sh", "-c" };
|
||||||
|
shell_cmd << processed_cmd;
|
||||||
|
|
||||||
|
ProcessResult r = System::runCommand(
|
||||||
|
location, shell_cmd, QString(), QString(), 10 );
|
||||||
|
|
||||||
|
if ( r.getExitCode() != 0 )
|
||||||
|
{
|
||||||
|
if ( suppress_result )
|
||||||
|
cDebug() << "Error code" << r.getExitCode() << "ignored by CommandList configuration.";
|
||||||
|
else
|
||||||
|
return r.explainProcess( parent, processed_cmd, 10 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Calamares::JobResult::ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
*
|
||||||
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
*
|
||||||
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Calamares is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef COMMANDLIST_H
|
||||||
|
#define COMMANDLIST_H
|
||||||
|
|
||||||
|
#include "Job.h"
|
||||||
|
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
|
namespace CalamaresUtils
|
||||||
|
{
|
||||||
|
|
||||||
|
class CommandList : protected QStringList
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CommandList( bool doChroot = true );
|
||||||
|
CommandList( const QVariant& v, bool doChroot = true );
|
||||||
|
~CommandList();
|
||||||
|
|
||||||
|
bool doChroot() const
|
||||||
|
{
|
||||||
|
return m_doChroot;
|
||||||
|
}
|
||||||
|
|
||||||
|
Calamares::JobResult run( const QObject* parent );
|
||||||
|
|
||||||
|
using QStringList::isEmpty;
|
||||||
|
using QStringList::count;
|
||||||
|
using QStringList::cbegin;
|
||||||
|
using QStringList::cend;
|
||||||
|
using QStringList::const_iterator;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_doChroot;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
#endif // COMMANDLIST_H
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
calamares_add_plugin( shellprocess
|
||||||
|
TYPE job
|
||||||
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
|
SOURCES
|
||||||
|
ShellProcessJob.cpp
|
||||||
|
LINK_PRIVATE_LIBRARIES
|
||||||
|
calamares
|
||||||
|
SHARED_LIB
|
||||||
|
)
|
||||||
|
|
||||||
|
find_package(ECM ${ECM_VERSION} NO_MODULE)
|
||||||
|
if( ECM_FOUND )
|
||||||
|
find_package( Qt5 COMPONENTS Test REQUIRED )
|
||||||
|
include( ECMAddTests )
|
||||||
|
|
||||||
|
ecm_add_test(
|
||||||
|
Tests.cpp
|
||||||
|
TEST_NAME
|
||||||
|
shellprocesstest
|
||||||
|
LINK_LIBRARIES
|
||||||
|
${CALAMARES_LIBRARIES}
|
||||||
|
calamaresui
|
||||||
|
${YAMLCPP_LIBRARY}
|
||||||
|
Qt5::Core
|
||||||
|
Qt5::Test
|
||||||
|
)
|
||||||
|
set_target_properties( shellprocesstest PROPERTIES AUTOMOC TRUE )
|
||||||
|
endif()
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
*
|
||||||
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
*
|
||||||
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Calamares is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ShellProcessJob.h"
|
||||||
|
|
||||||
|
#include <QProcess>
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QThread>
|
||||||
|
|
||||||
|
#include "CalamaresVersion.h"
|
||||||
|
#include "JobQueue.h"
|
||||||
|
#include "GlobalStorage.h"
|
||||||
|
|
||||||
|
#include "utils/CalamaresUtils.h"
|
||||||
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
|
#include "utils/CommandList.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
|
ShellProcessJob::ShellProcessJob( QObject* parent )
|
||||||
|
: Calamares::CppJob( parent )
|
||||||
|
, m_commands( nullptr )
|
||||||
|
, m_dontChroot( false )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ShellProcessJob::~ShellProcessJob()
|
||||||
|
{
|
||||||
|
delete m_commands;
|
||||||
|
m_commands = nullptr; // TODO: UniquePtr
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString
|
||||||
|
ShellProcessJob::prettyName() const
|
||||||
|
{
|
||||||
|
return tr( "Shell Processes Job" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Calamares::JobResult
|
||||||
|
ShellProcessJob::exec()
|
||||||
|
{
|
||||||
|
|
||||||
|
if ( ! m_commands || m_commands->isEmpty() )
|
||||||
|
{
|
||||||
|
cDebug() << "WARNING: No commands to execute" << moduleInstanceKey();
|
||||||
|
return Calamares::JobResult::ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_commands->run( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ShellProcessJob::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
|
{
|
||||||
|
m_dontChroot = CalamaresUtils::getBool( configurationMap, "dontChroot", false );
|
||||||
|
|
||||||
|
if ( configurationMap.contains( "script" ) )
|
||||||
|
{
|
||||||
|
m_commands = new CalamaresUtils::CommandList( configurationMap.value( "script" ), !m_dontChroot );
|
||||||
|
if ( m_commands->isEmpty() )
|
||||||
|
cDebug() << "ShellProcessJob: \"script\" contains no commands for" << moduleInstanceKey();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cDebug() << "WARNING: No script given for ShellProcessJob" << moduleInstanceKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( ShellProcessJobFactory, registerPlugin<ShellProcessJob>(); )
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
*
|
||||||
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
*
|
||||||
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Calamares is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SHELLPROCESSJOB_H
|
||||||
|
#define SHELLPROCESSJOB_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
#include <CppJob.h>
|
||||||
|
|
||||||
|
#include <utils/CommandList.h>
|
||||||
|
#include <utils/PluginFactory.h>
|
||||||
|
|
||||||
|
#include <PluginDllMacro.h>
|
||||||
|
|
||||||
|
|
||||||
|
class PLUGINDLLEXPORT ShellProcessJob : public Calamares::CppJob
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ShellProcessJob( QObject* parent = nullptr );
|
||||||
|
virtual ~ShellProcessJob() override;
|
||||||
|
|
||||||
|
QString prettyName() const override;
|
||||||
|
|
||||||
|
Calamares::JobResult exec() override;
|
||||||
|
|
||||||
|
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
CalamaresUtils::CommandList* m_commands;
|
||||||
|
bool m_dontChroot;
|
||||||
|
};
|
||||||
|
|
||||||
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( ShellProcessJobFactory )
|
||||||
|
|
||||||
|
#endif // SHELLPROCESSJOB_H
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
*
|
||||||
|
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
||||||
|
*
|
||||||
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Calamares is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Tests.h"
|
||||||
|
|
||||||
|
#include "utils/CommandList.h"
|
||||||
|
#include "utils/YamlUtils.h"
|
||||||
|
|
||||||
|
#include <yaml-cpp/yaml.h>
|
||||||
|
|
||||||
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
|
QTEST_GUILESS_MAIN( ShellProcessTests )
|
||||||
|
|
||||||
|
using CommandList = CalamaresUtils::CommandList;
|
||||||
|
|
||||||
|
ShellProcessTests::ShellProcessTests()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ShellProcessTests::~ShellProcessTests()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ShellProcessTests::initTestCase()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ShellProcessTests::testProcessListSampleConfig()
|
||||||
|
{
|
||||||
|
YAML::Node doc;
|
||||||
|
|
||||||
|
QStringList dirs { "src/modules/shellprocess", "." };
|
||||||
|
for ( const auto& dir : dirs )
|
||||||
|
{
|
||||||
|
QString filename = dir + "/shellprocess.conf";
|
||||||
|
if ( QFileInfo::exists( filename ) )
|
||||||
|
{
|
||||||
|
doc = YAML::LoadFile( filename.toStdString() );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandList cl(
|
||||||
|
CalamaresUtils::yamlMapToVariant( doc ).toMap().value( "script" ) );
|
||||||
|
QVERIFY( !cl.isEmpty() );
|
||||||
|
QCOMPARE( cl.count(), 2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShellProcessTests::testProcessListFromList()
|
||||||
|
{
|
||||||
|
YAML::Node doc = YAML::Load( R"(---
|
||||||
|
script:
|
||||||
|
- "ls /tmp"
|
||||||
|
- "ls /nonexistent"
|
||||||
|
- "/bin/false"
|
||||||
|
)" );
|
||||||
|
CommandList cl(
|
||||||
|
CalamaresUtils::yamlMapToVariant( doc ).toMap().value( "script" ) );
|
||||||
|
QVERIFY( !cl.isEmpty() );
|
||||||
|
QCOMPARE( cl.count(), 3 );
|
||||||
|
|
||||||
|
// Contains 1 bad element
|
||||||
|
doc = YAML::Load( R"(---
|
||||||
|
script:
|
||||||
|
- "ls /tmp"
|
||||||
|
- false
|
||||||
|
- "ls /nonexistent"
|
||||||
|
)" );
|
||||||
|
CommandList cl1(
|
||||||
|
CalamaresUtils::yamlMapToVariant( doc ).toMap().value( "script" ) );
|
||||||
|
QVERIFY( !cl1.isEmpty() );
|
||||||
|
QCOMPARE( cl1.count(), 2 ); // One element ignored
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShellProcessTests::testProcessListFromString()
|
||||||
|
{
|
||||||
|
YAML::Node doc = YAML::Load( R"(---
|
||||||
|
script: "ls /tmp"
|
||||||
|
)" );
|
||||||
|
CommandList cl(
|
||||||
|
CalamaresUtils::yamlMapToVariant( doc ).toMap().value( "script" ) );
|
||||||
|
QVERIFY( !cl.isEmpty() );
|
||||||
|
QCOMPARE( cl.count(), 1 );
|
||||||
|
|
||||||
|
// Not a string
|
||||||
|
doc = YAML::Load( R"(---
|
||||||
|
script: false
|
||||||
|
)" );
|
||||||
|
CommandList cl1(
|
||||||
|
CalamaresUtils::yamlMapToVariant( doc ).toMap().value( "script" ) );
|
||||||
|
QVERIFY( cl1.isEmpty() );
|
||||||
|
QCOMPARE( cl1.count(), 0 );
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
*
|
||||||
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
||||||
|
*
|
||||||
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Calamares is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TESTS_H
|
||||||
|
#define TESTS_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class ShellProcessTests : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
ShellProcessTests();
|
||||||
|
~ShellProcessTests() override;
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
|
// Check the sample config file is processed correctly
|
||||||
|
void testProcessListSampleConfig();
|
||||||
|
// Create from a YAML list
|
||||||
|
void testProcessListFromList();
|
||||||
|
// Create from a simple YAML string
|
||||||
|
void testProcessListFromString();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
type: "job"
|
||||||
|
name: "shellprocess"
|
||||||
|
interface: "qtplugin"
|
||||||
|
load: "libcalamares_job_shellprocess.so"
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
# Configuration for the shell process job.
|
||||||
|
#
|
||||||
|
# Executes a list of commands found under the key *script*.
|
||||||
|
# If the top-level key *dontChroot* is true, then the commands
|
||||||
|
# are executed in the context of the live system, otherwise
|
||||||
|
# in the context of the target system. In all of the commands,
|
||||||
|
# `@@ROOT@@` is replaced by the root mount point of the **target**
|
||||||
|
# system from the point of view of the command (for chrooted
|
||||||
|
# commands, that will be */*).
|
||||||
|
#
|
||||||
|
# If a command starts with "-" (a single minus sign), then the
|
||||||
|
# return value of the command following the - is ignored; otherwise,
|
||||||
|
# a failing command will abort the installation. This is much like
|
||||||
|
# make's use of - in a command.
|
||||||
|
---
|
||||||
|
dontChroot: false
|
||||||
|
script:
|
||||||
|
- "-touch @@ROOT@@/tmp/thingy"
|
||||||
|
- "/usr/bin/false"
|
||||||
Loading…
Reference in New Issue