Skip to content

Commit

Permalink
Source loading
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Feb 4, 2020
1 parent bc936b1 commit 20d3e44
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/PkgFunctions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const zypp::ResStatus::TransactByValue PkgFunctions::whoWantsIt = zypp::ResStatu
PkgFunctions::PkgFunctions () :
_target_root( "/" )
, _target_loaded(false)
, _source_loaded(false)
, zypp_pointer(NULL)
, repo_manager(NULL)
, autorefresh_skipped(false)
Expand Down
1 change: 1 addition & 0 deletions src/PkgFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class PkgFunctions

zypp::Pathname _target_root;
bool _target_loaded;
bool _source_loaded;

zypp::ZYpp::Ptr zypp_pointer;

Expand Down
5 changes: 3 additions & 2 deletions src/Source_Load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ PkgFunctions::SourceRestore()
// return value
bool success = true;

if (repos.size() > 0)
if (_source_loaded)
{
y2warning("Number of registered repositories: %zd, skipping repository load!", repos.size());
y2warning("Repositories already loaded, skipping repository load!");
return YCPBoolean(success);
}

Expand Down Expand Up @@ -112,6 +112,7 @@ PkgFunctions::SourceRestore()
}
}
}
_source_loaded = true;
}
catch (const zypp::Exception& excpt)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Source_Save.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ PkgFunctions::SourceFinishAll ()
}

y2milestone("All sources and services have been unregistered");
// reset the source loaded flag
_source_loaded = false;

return YCPBoolean(true);
}
Expand Down

0 comments on commit 20d3e44

Please sign in to comment.