[zypp-commit] r5999 - /branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc
Author: dmacvicar Date: Fri Jul 13 12:08:20 2007 New Revision: 5999 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5999&view=rev Log: - assert the repo path exist when adding, deleting or modyfing repositories Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc Modified: branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc?rev=5999&r1=5998&r2=5999&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/RepoManager.cc Fri Jul 13 12:08:20 2007 @@ -693,6 +693,9 @@ progress.set(50); + // assert the directory exists + filesystem::assert_dir(_pimpl->options.knownReposPath); + Pathname repofile = generate_non_existing_name(_pimpl->options.knownReposPath, Pathname(info.alias()).extend(".repo").asString()); // now we have a filename that does not exists @@ -735,6 +738,9 @@ if ( filename == Pathname() ) ZYPP_THROW(RepoException("Invalid repo file name at " + url.asString() )); + // assert the directory exists + filesystem::assert_dir(_pimpl->options.knownReposPath); + Pathname repofile = generate_non_existing_name(_pimpl->options.knownReposPath, filename); // now we have a filename that does not exists MIL << "Saving " << repos.size() << " repo" << ( repos.size() ? "s" : "" ) << " in " << repofile << endl; @@ -801,6 +807,10 @@ // write them back except the deleted one. //TmpFile tmp; //std::ofstream file(tmp.path().c_str()); + + // assert the directory exists + filesystem::assert_dir(todelete.filepath().dirname()); + std::ofstream file(todelete.filepath().c_str()); if (!file) { //ZYPP_THROW (Exception( "Can't open " + tmp.path().asString() ) ); @@ -852,6 +862,10 @@ // write them back except the deleted one. //TmpFile tmp; //std::ofstream file(tmp.path().c_str()); + + // assert the directory exists + filesystem::assert_dir(toedit.filepath().dirname()); + std::ofstream file(toedit.filepath().c_str()); if (!file) { //ZYPP_THROW (Exception( "Can't open " + tmp.path().asString() ) ); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
dmacvicar@svn.opensuse.org