Skip to content

Commit

Permalink
Merge pull request #45 from yast/no_chroot_part1
Browse files Browse the repository at this point in the history
No chroot part1
  • Loading branch information
jreidinger committed Sep 3, 2013
2 parents 0dda969 + 416134f commit 4856721
Show file tree
Hide file tree
Showing 94 changed files with 942 additions and 786 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,6 +20,7 @@ config.status
config.sub
configure
configure.in
configure.ac
depcomp
install-sh
ltmain.sh
Expand Down
2 changes: 1 addition & 1 deletion agent-any/src/AnyAgent.cc
Expand Up @@ -124,7 +124,7 @@ YCPValue
AnyAgent::otherCommand (const YCPTerm & term)
{
const string sym = term->name ();

y2debug( "Received term in otherCommand: %s", term->toString().c_str() );

if (sym == "Description" && term->size () >= 4)
Expand Down
2 changes: 1 addition & 1 deletion agent-any/src/AnyAgentComplex.cc
Expand Up @@ -409,7 +409,7 @@ AnyAgent::unparseTuple (const YCPList & syntax, const YCPValue & value)
if (element->valuetype () == YT_TERM)
{
YCPTerm term = element->asTerm ();
if (!(term.isNull ()) &&
if (!(term.isNull ()) &&
((term->name () == "Skip") ||
(term->name () == "Fillup")))
continue;
Expand Down
2 changes: 1 addition & 1 deletion agent-dummy/src/DummyAgent.cc
Expand Up @@ -106,7 +106,7 @@ DummyAgent::Execute (const YCPPath& path, const YCPValue& value,
{
v = checkPath(path, defaultMap, deflt);
}

ycpdebug("%sExecute %s", DUMMY_LOG_STRING,
(path->toString() + " " + value->toString() +
(arg.isNull()?"":(" "+arg->toString())) +
Expand Down
4 changes: 2 additions & 2 deletions agent-ini/src/IniAgent.cc
Expand Up @@ -147,7 +147,7 @@ YCPBoolean IniAgent::Write(const YCPPath &path, const YCPValue& value, const YCP
YCPValue IniAgent::otherCommand(const YCPTerm& term)
{
string sym = term->name();
if (sym == "SysConfigFile")
if (sym == "SysConfigFile")
{
if (term->size () != 1 || !term->value (0)->isString ())
{
Expand All @@ -158,7 +158,7 @@ YCPValue IniAgent::otherCommand(const YCPTerm& term)
YCPTerm tt = generateSysConfigTemplate (file_name);
return otherCommand (tt);
}
if (sym == "IniAgent")
if (sym == "IniAgent")
{
if (2 == term->size()) // fixme: we will provide some default actions if 2nd arg is missing in future
{
Expand Down
10 changes: 5 additions & 5 deletions agent-ini/src/IniFile.cc
Expand Up @@ -121,7 +121,7 @@ void IniSection::initValue (const string&key,const string&val,const string&comme
IniSection& IniSection::initSection (const string&name,const string&comment,int rb, int wb)
{
string k = ip->changeCase (name);

IniSection s (ip);
IniSectionIdxIterator sxi;
if (!ip->repeatNames () && (sxi = isections.find (k)) != isections.end ())
Expand Down Expand Up @@ -239,7 +239,7 @@ void IniSection::Dump ()

for (; sxi != sxe; ++sxi)
{
printf ("{%s @%p}\n", sxi->first.c_str (), &*sxi->second);
printf ("{%s @%p}\n", sxi->first.c_str (), &*sxi->second);
}

printf ("{Values}\n");
Expand All @@ -249,7 +249,7 @@ void IniSection::Dump ()

for (; exi != exe; ++exi)
{
printf ("{%s @%p}\n", exi->first.c_str (), &*exi->second);
printf ("{%s @%p}\n", exi->first.c_str (), &*exi->second);
}

printf("</%s>\n", name.c_str());
Expand Down Expand Up @@ -277,7 +277,7 @@ void IniSection::reindex ()
string k = ip->changeCase (ci->s ().getName ());
isections.insert (IniSectionIndex::value_type (k, ci));
}
}
}
}

int IniSection::getMyValue (const YCPPath &p, YCPValue &out, int what, int depth)
Expand Down Expand Up @@ -758,7 +758,7 @@ int IniSection::setAllDoIt (const YCPMap &in)
if (mv->isVoid ())
{
string del_name;
int del_rb;
int del_rb;
if (!getMapString (mitem, "name", del_name) ||
!getMapInteger (mitem, "file", del_rb))
{
Expand Down
26 changes: 13 additions & 13 deletions agent-ini/src/IniParser.cc
Expand Up @@ -118,7 +118,7 @@ int getBeginEndType (const YCPMap&m)
return -1;
if (!isYCPStringPair (m->value (YCPString ("begin"))))
return -1;

if (m->value(YCPString("end")).isNull())
return 1;
if (!isYCPStringPair (m->value (YCPString ("end"))))
Expand All @@ -142,7 +142,7 @@ int getParamsType (const YCPMap&m)
return -1;
if (!isYCPStringPair (m->value (YCPString ("match"))))
return -1;

if (m->value(YCPString("multiline")).isNull())
return 1;
if (!isYCPStringPair (m->value (YCPString ("multiline"))))
Expand Down Expand Up @@ -193,7 +193,7 @@ int IniParser::initMachine (const YCPMap&scr)
continue;
}
string sv = v->asList()->value(i)->asString()->value();
#define COMPARE_OPTION(X) if (sv == #X) X = true; else
#define COMPARE_OPTION(X) if (sv == #X) X = true; else
COMPARE_OPTION (ignore_case_regexps)
COMPARE_OPTION (ignore_case)
COMPARE_OPTION (prefer_uppercase)
Expand Down Expand Up @@ -232,8 +232,8 @@ int IniParser::initMachine (const YCPMap&scr)
for (int i = 0; i<len;i++)
{
YCPValue ival = v->asList()->value(i);
if (ival->isList() &&
2 == ival->asList()->size() &&
if (ival->isList() &&
2 == ival->asList()->size() &&
ival->asList()->value(0)->isString() &&
ival->asList()->value(1)->isString())
{
Expand Down Expand Up @@ -624,7 +624,7 @@ int IniParser::parse_helper(IniSection&ini)
{
RegexMatch m (params[matched_by].end, line);
if (m)
{
{
// it is the end of broken line
state = 0;
val = val + (join_multiline ? " " : "\n") + m[1];
Expand All @@ -639,7 +639,7 @@ int IniParser::parse_helper(IniSection&ini)
ini.initValue(key, shell_quoted_value ? YaST::agent_ini::unquote(val) : val, comment, matched_by);
}
}
else
else
{
open_sections.front()->initValue(key, shell_quoted_value ? YaST::agent_ini::unquote(val) : val, comment, matched_by);
}
Expand Down Expand Up @@ -766,7 +766,7 @@ int IniParser::parse_helper(IniSection&ini)
complain = true;
}
}

if (name_to_close.empty ()) {
// there was no name or we did not find the specified one
for (it = b; it != e; ++it) {
Expand Down Expand Up @@ -800,7 +800,7 @@ int IniParser::parse_helper(IniSection&ini)
val = m[2];
line = m.rest;
break;
}
}
}
if (i != params.size ())
{
Expand Down Expand Up @@ -960,7 +960,7 @@ int IniParser::write()
if (ci->t () == SECTION)
{
IniSection&s = ci->s ();
int wb = s.getRewriteBy (); // bug #19066
int wb = s.getRewriteBy (); // bug #19066
string filename = getFileName (s.getName (), wb);

// This is the only place where we unmark a
Expand Down Expand Up @@ -1067,7 +1067,7 @@ int IniParser::write_helper(IniSection&ini, ofstream&of, int depth)
out_buffer = format (sections[readby].begin.out.c_str (), ini.getName());
of << indent << out_buffer << "\n";
}

IniIterator
ci = ini.getContainerBegin (),
ce = ini.getContainerEnd ();
Expand All @@ -1084,7 +1084,7 @@ int IniParser::write_helper(IniSection&ini, ofstream&of, int depth)
IniEntry&e = ci->e ();
if (e.getComment ()[0])
of << e.getComment();
if (e.getReadBy()>=0 && e.getReadBy() < (int)params.size ())
if (e.getReadBy()>=0 && e.getReadBy() < (int)params.size ())
{
const string val = shell_quoted_value ? YaST::agent_ini::quote(e.getValue()) : e.getValue();
// bnc#492859, a fixed buffer is too small
Expand Down Expand Up @@ -1145,7 +1145,7 @@ string IniParser::changeCase (const string&str) const
string::iterator it = tmp.begin ();
if (it != tmp.end ())
*it = toupper (*it);
}
}
}
return tmp;
}
Expand Down
2 changes: 1 addition & 1 deletion agent-ini/src/Y2IniAgentComponent.cc
Expand Up @@ -50,7 +50,7 @@ YCPValue Y2IniAgentComponent::evaluate(const YCPValue& value)
agent = new IniAgent();
interpreter = new SCRInterpreter(agent);
}

return interpreter->evaluate(value);
}

8 changes: 4 additions & 4 deletions agent-ini/src/quotes.cc
Expand Up @@ -125,7 +125,7 @@ string parse_squoted_string( string::const_iterator & sit, const string::const_i
* "string" -> string
*
* preconditions:
* - starts with ['"]
* - starts with ['"]
* - as a consequence: size > 0
*/
string parse_quoted_string( string::const_iterator & sit, const string::const_iterator & last)
Expand All @@ -145,10 +145,10 @@ string unquote( const string & quoted_string)
{
while( sit != end)
{
while( sit != end &&
*sit != '"' &&
while( sit != end &&
*sit != '"' &&
*sit != '\'')
{
{
if( *sit == '\\')
{
if( ++sit == end)
Expand Down
2 changes: 1 addition & 1 deletion agent-ini/testsuite/runag_ini.cc
Expand Up @@ -27,7 +27,7 @@ main (int argc, char *argv[])
scrconf.replace (p, 4, ".scr");
}

SCRAgent *agent = new ScriptingAgent (scrconf);
SCRAgent *agent = new ScriptingAgent ("/", scrconf);
if (!agent)
{
fprintf (stderr, "Failed to create Agent\n");
Expand Down
22 changes: 11 additions & 11 deletions agent-modules/src/ModulesAgent.cc
Expand Up @@ -60,12 +60,12 @@ ModulesAgent::~ModulesAgent() {
template <class T> YCPList map2list(const T &m) {
YCPList list;
typename T::const_iterator it = m.begin ();

for (; it != m.end (); ++it)
/* Preserve listing of the final comment */
if(it->first != "YaST2_final_modules_conf_comment")
list->add(YCPString (it->first));

return list;
}

Expand All @@ -75,10 +75,10 @@ template <class T> YCPList map2list(const T &m) {
template <class T> YCPMap map2ycpmap(const T &m) {
YCPMap ret_map;
typename T::const_iterator it = m.begin ();

for (; it != m.end(); ++it)
ret_map->add (YCPString (it->first), YCPString (it->second));

return ret_map;
}

Expand All @@ -96,7 +96,7 @@ ModuleEntry::EntryArg ycpmap2map (const YCPMap &m) {
y2error("Map element must be string!");
return ModuleEntry::EntryArg();
}

return ret_map;
}

Expand Down Expand Up @@ -141,10 +141,10 @@ YCPList ModulesAgent::Dir(const YCPPath& path) {
* Read
*/
YCPValue ModulesAgent::Read(const YCPPath &path, const YCPValue& arg, const YCPValue& optarg) {

if (modules_conf == NULL)
Y2_RETURN_VOID("Can't execute Read before being mounted.");

y2debug("Read(%s)", path->toString().c_str());

switch (path->length ()) {
Expand Down Expand Up @@ -220,7 +220,7 @@ YCPValue ModulesAgent::Read(const YCPPath &path, const YCPValue& arg, const YCPV
return YCPString (modules_conf->getOption(PC(1), PC(2)));

}

Y2_RETURN_VOID("Wrong path '%s' in Read().", path->toString().c_str());
}

Expand Down Expand Up @@ -248,7 +248,7 @@ YCPBoolean ModulesAgent::Write(const YCPPath &path, const YCPValue& value, const
return YCPBoolean (modules_conf->setOptions(VAL2STR(arg),
ycpmap2map (value->asMap ()),
ModuleEntry::SET));
else
else
Y2_RETURN_YCP_FALSE("Argument for Write () not map.");
}
return YCPBoolean (modules_conf->setArgument (PC(0), VAL2STR(arg),
Expand Down Expand Up @@ -306,7 +306,7 @@ YCPBoolean ModulesAgent::Write(const YCPPath &path, const YCPValue& value, const
if (value->isMap ())
return YCPBoolean (modules_conf->setOptions(PC(1),
ycpmap2map (value->asMap ()), ModuleEntry::SET));
else
else
Y2_RETURN_YCP_FALSE("Argument for Write(.options) not map: %s.",
value->toString().c_str());
}
Expand Down Expand Up @@ -352,7 +352,7 @@ YCPValue ModulesAgent::otherCommand(const YCPTerm& term) {
delete modules_conf;
modules_conf = new ModulesConf(s->value());
return YCPVoid();
} else
} else
Y2_RETURN_VOID("Bad first arg of ModulesConf(): is not a string.");
}

Expand Down
12 changes: 6 additions & 6 deletions agent-process/src/ProcessAgent.cc
Expand Up @@ -2,17 +2,17 @@
*
* ------------------------------------------------------------------------------
* Copyright (c) 2008 Novell, Inc. All Rights Reserved.
*
*
*
*
* This program 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 2 of the License, or (at your
* option) any later version.
*
*
* This program 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
* this program; if not, contact Novell, Inc.
*
Expand Down Expand Up @@ -424,7 +424,7 @@ YCPValue ProcessAgent::Execute(const YCPPath &path,

// store the path
argv[0] = commandline.c_str();

// store arguments
int index = 0;
for (; index < args->size(); index++)
Expand Down Expand Up @@ -532,7 +532,7 @@ YCPValue ProcessAgent::Execute(const YCPPath &path,
* @builtin Execute(.process.close, integer id) -> integer
* Close input/output of the process and wait until the process ends
*
* Returns Exit value of the process
* Returns Exit value of the process
*
* @example Execute(.process.close, 12345) -> 0
*/
Expand Down
2 changes: 1 addition & 1 deletion agent-resolver/src/ResolverAgent.cc
Expand Up @@ -173,7 +173,7 @@ static int fillCache (const char *filename)
if (strncmp (lbuf, "### END INFO", 12) == 0)
{
if (last_key) // one more key to process
{
{
localCache->add (YCPString (last_key), YCPString ((info_buf.substr (0, info_buf.length () - 1)).c_str ()));
}
if (!processing_info) y2warning ("End of info without beggining!");
Expand Down
2 changes: 1 addition & 1 deletion agent-system/src/ShellCommand.cc
Expand Up @@ -148,7 +148,7 @@ shellcommand (const string &command, const string &tempdir)
for ( int i = getdtablesize() - 1; i > 2; --i ) {
close( i );
}

ret = system (command.c_str ());
if (WIFEXITED (ret))
ret = WEXITSTATUS (ret);
Expand Down

0 comments on commit 4856721

Please sign in to comment.