From 7378f5ddf46ef0317343ad310d703c4f4ff8d703 Mon Sep 17 00:00:00 2001 From: Daniel Brahneborg Date: Fri, 8 Mar 2002 19:44:37 +0000 Subject: Initial stuff for checking requisites and previous versions. --- lib/sisfileheader.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/sisfileheader.cpp') diff --git a/lib/sisfileheader.cpp b/lib/sisfileheader.cpp index 19724c3..97e0687 100644 --- a/lib/sisfileheader.cpp +++ b/lib/sisfileheader.cpp @@ -28,6 +28,22 @@ const int OFF_NUMBER_OF_FILES = 26; const int OFF_INSTALLATION_DRIVE = 28; +SisRC +SISFileHeader::compareApp(SISFileHeader* other) +{ + if (m_uid1 != other->m_uid1) + return SIS_DIFFERENT_APP; + if ((m_major < other->m_major) || + ((m_major == other->m_major) && + (m_minor < other->m_minor))) + return SIS_VER_EARLIER; + if ((m_major == other->m_major) && + (m_minor == other->m_minor) && + (m_variant != other->m_variant)) + return SIS_OTHER_VARIANT; + return SIS_SAME_OR_LATER; +} + SisRC SISFileHeader::fillFrom(uint8_t* buf, int* base, off_t len) { -- cgit v1.2.3