Mailinglist Archive: zypp-devel (230 mails)
| < Previous | Next > |
[zypp-devel] Re: Preliminary zypper port
- From: Michael Andres <ma@xxxxxxx>
- Date: Mon, 4 Feb 2008 20:02:49 +0100
- Message-id: <20080204190248.GA21373@xxxxxxx>
On Sun, Feb 03, Duncan Mac-Vicar P. wrote:
Mea culpa. fixed in revision 8459.
(str::split running wild)
I know we're in a hurry, but we should try to remove created
files/directories in case of an error. It's quite easy to achieve
this:
+#include "zypp/ManagedFile.h"
switch ( repokind.toEnum() )
{
case RepoType::RPMMD_e :
case RepoType::YAST2_e :
{
MIL << "Executing solv converter" << endl;
+ // Take care we unlink the solvfile on exception
+ ManagedFile guard( solvfile, filesystem::erase );
- string cmd( str::form( "repo2solv.sh \"%s\" > %s",
+ string cmd( str::form( "repo2solv.sh \"%s\" > '%s'",
rawpath.c_str(), solvfile.c_str() ) );
ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
for ( string output( prog.receiveLine() );
output.length(); output = prog.receiveLine() ) {
MIL << " " << output;
}
int ret = prog.close();
if ( ret != 0 )
ZYPP_THROW(RepoUnknownTypeException());
+ // We keep it.
+ guard.resetDispose();
}
break;
default:
ZYPP_THROW(Exception("Unhandled repostory type"));
break;
}
--
cu,
Michael Andres
+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres YaST Development ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
- the first try, zypper hangs and eats all ram just after loading proxy
settings. I unittested the parser and it was OK. So the codepath that
Mea culpa. fixed in revision 8459.
(str::split running wild)
- zypper loads the repos fine, reads rpm database, very fast (9.5
...
I know we're in a hurry, but we should try to remove created
files/directories in case of an error. It's quite easy to achieve
this:
+#include "zypp/ManagedFile.h"
switch ( repokind.toEnum() )
{
case RepoType::RPMMD_e :
case RepoType::YAST2_e :
{
MIL << "Executing solv converter" << endl;
+ // Take care we unlink the solvfile on exception
+ ManagedFile guard( solvfile, filesystem::erase );
- string cmd( str::form( "repo2solv.sh \"%s\" > %s",
+ string cmd( str::form( "repo2solv.sh \"%s\" > '%s'",
rawpath.c_str(), solvfile.c_str() ) );
ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
for ( string output( prog.receiveLine() );
output.length(); output = prog.receiveLine() ) {
MIL << " " << output;
}
int ret = prog.close();
if ( ret != 0 )
ZYPP_THROW(RepoUnknownTypeException());
+ // We keep it.
+ guard.resetDispose();
}
break;
default:
ZYPP_THROW(Exception("Unhandled repostory type"));
break;
}
--
cu,
Michael Andres
+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres YaST Development ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |