aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Brahneborg <basic@chello.se>2002-04-03 07:44:56 +0000
committerDaniel Brahneborg <basic@chello.se>2002-04-03 07:44:56 +0000
commit9e61c68f5a548d7d8dd35ba27c087779e29b8899 (patch)
tree382333ea86062b9bbb1360030629faff38119f59
parent6d15533ada3dc236e0984a6e9665db8c150bd01f (diff)
downloadplptools-9e61c68f5a548d7d8dd35ba27c087779e29b8899.tar.gz
plptools-9e61c68f5a548d7d8dd35ba27c087779e29b8899.tar.bz2
plptools-9e61c68f5a548d7d8dd35ba27c087779e29b8899.zip
Even if req records are ignored, at least now they are read correctly.
-rw-r--r--TODO3
-rw-r--r--lib/sisreqrecord.cpp16
2 files changed, 14 insertions, 5 deletions
diff --git a/TODO b/TODO
index 48dfab6..2da1d5e 100644
--- a/TODO
+++ b/TODO
@@ -10,4 +10,7 @@ Sisinstall:
- Use rpm-style arguments.
- Check requisite records.
- More clever residual sis file generation/truncation.
+ - Check file crc.
+ - Create a unique name of the residual sis file, if
+ the provided name already exists.
diff --git a/lib/sisreqrecord.cpp b/lib/sisreqrecord.cpp
index 654e8de..7f2bf95 100644
--- a/lib/sisreqrecord.cpp
+++ b/lib/sisreqrecord.cpp
@@ -29,7 +29,7 @@
SisRC
SISReqRecord::fillFrom(uint8_t* buf, int* base, off_t len, SISFile* sisFile)
{
- int n = sisFile->m_header.m_nreqs;
+ int n = sisFile->m_header.m_nlangs;
if (*base + 12 + n * 4 * 2 > len)
return SIS_TRUNCATED;
@@ -42,6 +42,9 @@ SISReqRecord::fillFrom(uint8_t* buf, int* base, off_t len, SISFile* sisFile)
m_variant = read32(p + 8);
m_nameLengths = new uint32_t[n];
m_namePtrs = new uint32_t[n];
+ if (logLevel >= 2)
+ printf(_("Requisite: uid=%08x, version=%d.%d-%d.\n"),
+ m_uid, m_major, m_minor, m_variant);
// First read lengths.
//
@@ -49,6 +52,8 @@ SISReqRecord::fillFrom(uint8_t* buf, int* base, off_t len, SISFile* sisFile)
for (int i = 0; i < n; ++i)
{
m_nameLengths[i] = read32(p + size);
+ if (logLevel >= 2)
+ printf(_("Got namelength %d\n"), m_nameLengths[i]);
size += 4;
}
@@ -57,6 +62,8 @@ SISReqRecord::fillFrom(uint8_t* buf, int* base, off_t len, SISFile* sisFile)
for (int i = 0; i < n; ++i)
{
m_namePtrs[i] = read32(p + size);
+ if (logLevel >= 2)
+ printf(_("Got namepos %d\n"), m_namePtrs[i]);
if (m_namePtrs[i] + m_nameLengths[i] > len)
{
printf(_("Position/length too large for req record %d.\n"), i);
@@ -64,15 +71,14 @@ SISReqRecord::fillFrom(uint8_t* buf, int* base, off_t len, SISFile* sisFile)
}
size += 4;
if (logLevel >= 2)
- printf(_("Name %d (for %s) is %.*s\n"),
- i,
+ printf(_("Name of requisite for %s is %.*s\n"),
sisFile->getLanguage(i)->m_name,
m_nameLengths[i],
buf + m_namePtrs[i]);
}
if (logLevel >= 1)
- printf(_("%d .. %d (%d bytes): Req record\n"),
- *base, *base + size, size);
+ printf(_("%d .. %d (%d bytes): Req record for uid %08x\n"),
+ *base, *base + size, size, m_uid);
*base += size;
return SIS_OK;
}