bool Package::isInstalled() const
{
- SGPath p(m_catalog->installRoot());
- p.append("Aircraft");
- p.append(id());
-
// anything to check for? look for a valid revision file?
- return p.exists();
+ return pathOnDisk().exists();
}
-InstallRef Package::install()
+SGPath Package::pathOnDisk() const
{
SGPath p(m_catalog->installRoot());
p.append("Aircraft");
p.append(id());
+ return p;
+}
+
+InstallRef Package::install()
+{
+ SGPath p(pathOnDisk());
if (p.exists()) {
return Install::createFromPath(p, m_catalog);
}
return ins;
}
+InstallRef Package::existingInstall() const
+{
+ SGPath p(pathOnDisk());
+ if (p.exists()) {
+ return Install::createFromPath(p, m_catalog);
+ }
+
+ return NULL;
+}
+
std::string Package::id() const
{
return m_props->getStringValue("id");
* get or create an install for the package
*/
InstallRef install();
-
+
+ InstallRef existingInstall() const;
+
bool isInstalled() const;
std::string id() const;
*/
PackageList dependencies() const;
private:
+ SGPath pathOnDisk() const;
+
friend class Catalog;
Package(const SGPropertyNode* aProps, CatalogRef aCatalog);