On Wed, Nov 22, 2006 at 10:00:58PM +0700, Jens Herden wrote:
> I've got a problem with the creation of openSUSE-10.2-Beta2-Addon-BiArch.iso 
> from the beta1 iso and the delta. 
> I have checked many times the beta1 iso and the delta and the md5sums are 
> correct there. But when I create the new beta2 iso from them the md5sum does 
> not match. I have done this three times already and I get always the same 
> wrong md5sum. 
> 
> I remember that I have seen a mail somewhere about this problem but no answer 
> that could help. 
> 
> Any help available?

The system where you run applydeltaiso must be a SUSE system (i.e.
the bzip2 library must compress with maxlen=20). The next version
of deltarpm will detect if the version is incorrect.

The attached program checks the bzip2 version, it should output
"CFILE_COMP_BZ_20". Compile with "-lbz2".

Cheers,
  Michael.

-- 
Michael Schroeder                                   [EMAIL PROTECTED]
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
#include <stdio.h>
#include <stdlib.h>
#include <bzlib.h>

bz_stream bz;

main()
{
  unsigned char buf[4096], *bp, obuf[8192];
  unsigned int x1, x2;
  int i, j, r;
  unsigned int d = 0;

  if (BZ2_bzCompressInit(&bz, 9, 0, 30) != BZ_OK)
    {
      fprintf(stderr, "BZ2_bzCompressInit failed\n");
      exit(1);
    }
  x1 = 0x4568;
  x2 = 0xab3c;
  for (i = 0; i < 100; i++)
    {
      for (bp = buf, j = 4096; j--;)
	{
	  x2 = 0x33ff * x2 + (0x33ff * x1 << 16) + 0x5230;
	  x1 = x2 >> 16 & 0xffff;
	  x2 &= 0xffff;
	  *bp++ = (unsigned char)(x1 >> 7);
	}
      bz.avail_in = 4096;
      bz.next_in = (char *)buf;
      bz.avail_out = sizeof(obuf);
      bz.next_out = (char *)obuf;
      if (BZ2_bzCompress(&bz, BZ_RUN) != BZ_RUN_OK)
	{
	  fprintf(stderr, "BZ2_bzCompress failed\n");
	  exit(1);
	}
      if (bz.avail_in)
	{
	  fprintf(stderr, "BZ2_bzCompress did not use all data\n");
	  exit(1);
	}
      for (bp = obuf, j = (unsigned char *)bz.next_out - obuf; j--;)
	d = ((d & 0x7fffffff) << 1) ^ ((d >> 31) & 1) ^ *bp++;
    }
  for (;;)
    {
      bz.avail_in = 0;
      bz.next_in = (char *)buf;
      bz.avail_out = sizeof(obuf);
      bz.next_out = (char *)obuf;
      r = BZ2_bzCompress(&bz, BZ_FINISH);
      if (r != BZ_FINISH_OK && r != BZ_STREAM_END)
	{
	  fprintf(stderr, "BZ2_bzCompress failed\n");
	  exit(1);
	}
      for (bp = obuf, j = (unsigned char *)bz.next_out - obuf; j--;)
	d = ((d & 0x7fffffff) << 1) ^ ((d >> 31) & 1) ^ *bp++;
      if (r == BZ_STREAM_END)
	break;
    }
  if (d == 0xa77422f7)
    printf("CFILE_COMP_BZ_17\n");
  else if (d == 0x79c62888)
    printf("CFILE_COMP_BZ_20\n");
  else
    {
      fprintf(stderr, "unknown bzip2 compression algorithm!\n");
      exit(1);
    }
  exit(0);
}

Reply via email to