[zypp-commit] r8661 - /branches/tmp/ma/jump_sat/libzypp-testsuite/solver/src/deptestomatic.cc
Author: schubi2 Date: Wed Feb 13 16:04:30 2008 New Revision: 8661 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8661&view=rev Log: using popen and zcat for compressed data Modified: branches/tmp/ma/jump_sat/libzypp-testsuite/solver/src/deptestomatic.cc Modified: branches/tmp/ma/jump_sat/libzypp-testsuite/solver/src/deptestomatic.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp-testsuite/solver/src/deptestomatic.cc?rev=8661&r1=8660&r2=8661&view=diff ============================================================================== --- branches/tmp/ma/jump_sat/libzypp-testsuite/solver/src/deptestomatic.cc (original) +++ branches/tmp/ma/jump_sat/libzypp-testsuite/solver/src/deptestomatic.cc Wed Feb 13 16:04:30 2008 @@ -689,9 +689,17 @@ .setEnabled ( true ) .setAutorefresh( false ) .addBaseUrl ( pathname.asUrl() ); + satRepo.setInfo (nrepo); _Repo *intSatRepo = satRepo.get(); - FILE *fpHelix = fopen( filename.c_str(), "r" ); + string command; + + if (str::endsWith(filename, ".gz")) { + command = "zcat " + filename; + } else { + command = "cat " + filename; + } + FILE *fpHelix = popen( command.c_str(), "r" ); if (!fpHelix) { cout << "Couldn't load packages from XML file '" << filename << "'" << endl; @@ -700,7 +708,7 @@ repo_add_helix(intSatRepo, fpHelix); count = satRepo.solvablesSize(); cout << "Loaded " << satRepo.solvablesSize() << " resolvables from " << (filename.empty()?pathname.asString():filename) << "." << endl; - fclose( fpHelix ); + pclose( fpHelix ); } catch ( Exception & excpt_r ) { ZYPP_CAUGHT (excpt_r); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
schubi2@svn.opensuse.org