Subversion Repositories spk

Rev

Rev 166 | Rev 170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 166 Rev 168
Line 3745... Line 3745...
3745
	{
3745
	{
3746
		for ( CListNode<SNeededLibrary> *dNode = p->GetNeededLibraries()->Front(); dNode; dNode = dNode->next() )
3746
		for ( CListNode<SNeededLibrary> *dNode = p->GetNeededLibraries()->Front(); dNode; dNode = dNode->next() )
3747
		{
3747
		{
3748
			if ( dNode->Data()->sName.Compare("<package>") )
3748
			if ( dNode->Data()->sName.Compare("<package>") )
3749
				continue;
3749
				continue;
3750
			if ( !this->CheckInstalledDependacy(dNode->Data()->sName, dNode->Data()->sAuthor, dNode->Data()->sMinVersion, true, true) )
3750
			if ( !this->checkInstalledDependacy(dNode->Data()->sName, dNode->Data()->sAuthor, dNode->Data()->sMinVersion, true, true) )
3751
				return false;
3751
				return false;
3752
		}
3752
		}
3753
	}
3753
	}
3754
 
3754
 
3755
	return true;
3755
	return true;
Line 3901... Line 3901...
3901
	}
3901
	}
3902
 
3902
 
3903
	return true;
3903
	return true;
3904
 
3904
 
3905
}
3905
}
-
 
3906
 
-
 
3907
int CPackages::getDownloadableDependacies(CBaseFile* p, std::vector<const SAvailablePackage*>& list, bool onlyEnabled, bool includePrepared) const
-
 
3908
{
-
 
3909
	size_t count = 0;
-
 
3910
	CLinkList<SNeededLibrary>* neededList = p->GetNeededLibraries();
-
 
3911
	if (neededList)
-
 
3912
	{
-
 
3913
		for (CListNode<SNeededLibrary>* node = neededList->Front(); node; node = node->next())
-
 
3914
		{
-
 
3915
			SNeededLibrary* nl = node->Data();
-
 
3916
			if (!checkInstalledDependacy((nl->sName.Compare("<package>")) ? p->name() : nl->sName, (nl->sAuthor.Compare("<author>")) ? p->author() : nl->sAuthor, nl->sMinVersion, (nl->sName.Compare("<package>")) ? false : onlyEnabled, (nl->sName.Compare("<package>")) ? false : includePrepared))
-
 
3917
			{
-
 
3918
				const SAvailablePackage *available = findAvailablePackage((nl->sName.Compare("<package>")) ? p->name() : nl->sName, (nl->sAuthor.Compare("<author>")) ? p->author() : nl->sAuthor);
-
 
3919
				if (available)
-
 
3920
					list.push_back(available);
-
 
3921
				++count;
-
 
3922
			}
-
 
3923
		}
-
 
3924
	}
-
 
3925
 
-
 
3926
	if (p->GetType() == TYPE_SPK)
-
 
3927
	{
-
 
3928
		CSpkFile* spk = (CSpkFile*)p;
-
 
3929
		if (spk->IsAnotherMod())
-
 
3930
		{
-
 
3931
			bool found = true;
-
 
3932
			if (!this->findSpkPackage(spk->GetOtherName(), spk->GetOtherAuthor()))
-
 
3933
			{
-
 
3934
				if (includePrepared)
-
 
3935
				{
-
 
3936
					found = false;
-
 
3937
					for (CListNode<CBaseFile>* pNode = m_lInstallList.Front(); pNode; pNode = pNode->next())
-
 
3938
					{
-
 
3939
						CBaseFile* checkP = pNode->Data();
-
 
3940
						if (p->author().Compare(checkP->author()) && p->name().Compare(checkP->name()))
-
 
3941
						{
-
 
3942
							found = true;
-
 
3943
							break;
-
 
3944
						}
-
 
3945
					}
-
 
3946
				}
-
 
3947
				else
-
 
3948
					found = false;
-
 
3949
			}
-
 
3950
 
-
 
3951
			if (!found)
-
 
3952
			{
-
 
3953
				const SAvailablePackage* available = findAvailablePackage(spk->GetOtherName(), spk->GetOtherAuthor());
-
 
3954
				if (available)
-
 
3955
					list.push_back(available);
-
 
3956
				++count;
-
 
3957
			}
-
 
3958
		}
-
 
3959
	}
-
 
3960
 
-
 
3961
	return count;
-
 
3962
}
-
 
3963
 
3906
int CPackages::GetMissingDependacies(CBaseFile *p, Utils::CStringList *list, bool onlyEnabled, bool includePrepared)
3964
int CPackages::GetMissingDependacies(CBaseFile *p, Utils::CStringList *list, bool onlyEnabled, bool includePrepared)
3907
{
3965
{
3908
	int count = 0;
3966
	int count = 0;
3909
	CLinkList<SNeededLibrary> *neededList = p->GetNeededLibraries();
3967
	CLinkList<SNeededLibrary> *neededList = p->GetNeededLibraries();
3910
	if ( neededList )
3968
	if ( neededList )
3911
	{
3969
	{
3912
		for ( CListNode<SNeededLibrary> *node = neededList->Front(); node; node = node->next() )
3970
		for ( CListNode<SNeededLibrary> *node = neededList->Front(); node; node = node->next() )
3913
		{
3971
		{
3914
			SNeededLibrary *nl = node->Data();
3972
			SNeededLibrary *nl = node->Data();
3915
			if ( !CheckInstalledDependacy((nl->sName.Compare("<package>")) ? p->name() : nl->sName, (nl->sAuthor.Compare("<author>")) ? p->author() : nl->sAuthor, nl->sMinVersion, (nl->sName.Compare("<package>")) ? false : onlyEnabled, (nl->sName.Compare("<package>")) ? false : includePrepared) )
3973
			if ( !checkInstalledDependacy((nl->sName.Compare("<package>")) ? p->name() : nl->sName, (nl->sAuthor.Compare("<author>")) ? p->author() : nl->sAuthor, nl->sMinVersion, (nl->sName.Compare("<package>")) ? false : onlyEnabled, (nl->sName.Compare("<package>")) ? false : includePrepared) )
3916
			{
3974
			{
3917
				if ( list )
3975
				if ( list )
3918
					list->pushBack(((nl->sName.Compare("<package>")) ? p->name() : nl->sName) + "|" + nl->sMinVersion, (nl->sAuthor.Compare("<author>")) ? p->author() : nl->sAuthor);
3976
					list->pushBack(((nl->sName.Compare("<package>")) ? p->name() : nl->sName) + "|" + nl->sMinVersion, (nl->sAuthor.Compare("<author>")) ? p->author() : nl->sAuthor);
3919
				++count;
3977
				++count;
3920
			}
3978
			}
Line 3925... Line 3983...
3925
	{
3983
	{
3926
		CSpkFile *spk = (CSpkFile *)p;
3984
		CSpkFile *spk = (CSpkFile *)p;
3927
		if ( spk->IsAnotherMod() )
3985
		if ( spk->IsAnotherMod() )
3928
		{
3986
		{
3929
			bool found = true;
3987
			bool found = true;
3930
			if ( !this->FindSpkPackage(spk->GetOtherName(), spk->GetOtherAuthor()) )
3988
			if ( !this->findSpkPackage(spk->GetOtherName(), spk->GetOtherAuthor()) )
3931
			{
3989
			{
3932
				if ( includePrepared )
3990
				if ( includePrepared )
3933
				{
3991
				{
3934
					found = false;
3992
					found = false;
3935
					for ( CListNode<CBaseFile> *pNode = m_lInstallList.Front(); pNode; pNode = pNode->next() )
3993
					for ( CListNode<CBaseFile> *pNode = m_lInstallList.Front(); pNode; pNode = pNode->next() )