Bug#676372: API breakage
Package: libdebian-installer4
Version: 0.80
Severity: serious
File: /usr/lib/libdebian-installer.so.4
At some point between squeeze and wheezy the declaration of
di_release_file.sum has changed from char * to char **. This breaks
the API making it impossible to compile software (e.g. cdebootstrap)
for stable and testing/unstable without ugly hacks. For example in
cdebootstrap the following code is needed:
if (sizeof(item->sum[0]) == sizeof(char*)) {
if (item->sum[1])
return check_sum (target, "sha1sum", (const char*)(intptr_t)item->sum[1],
buf_name);
if (item->sum[0])
return check_sum (target, "md5sum", (const char*)(intptr_t)item->sum[0],
buf_name);
} else {
return check_sum (target, "md5sum", (const char*)item->sum,
buf_name);
}
This is an API and ABI breakage requiring a rename to
libdebian-installter5[-dev].
Alternatively change the declaration of struct di_release_file to
struct di_release_file
{
union
{
char *filename; /**< filename */
di_rstring key; /**< @internal */
};
unsigned int size; /**< size */
char *sum; /**< checksum, currently md5 or sha */
char *sums[2]; /**< checksums, currently md5 and sha1 */
};
filling both sum and sums.
It would be nice to also have some define declared so sources can
check if di_release_file.sums is available. Something simpler than
having to compare the LIBDI_VERSION like
#define DEBIAN_INSTALLER__RELEASE_MULTISUM 1
#define DEBIAN_INSTALLER__RELEASE_SUM0 md5
#define DEBIAN_INSTALLER__RELEASE_SUM1 sha1
MfG
Goswin
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash
Versions of packages libdebian-installer4 depends on:
ii libc6 2.13-32
libdebian-installer4 recommends no packages.
libdebian-installer4 suggests no packages.
-- no debconf information
Reply to: