--- /dev/null
+diff -urBb poldek-0.18.9.org/main.c poldek-0.18.9/main.c
+--- poldek-0.18.9.org/main.c 2005-07-03 13:04:16.000000000 +0000
++++ poldek-0.18.9/main.c 2005-10-01 19:58:23.000000000 +0000
+@@ -124,8 +124,8 @@
+ #define INDEXTYPE_TXTZ 2
+
+ struct split_conf {
+- int size;
+- int first_free_space;
++ unsigned long long size;
++ unsigned long long first_free_space;
+ char *conf;
+ char *prefix;
+ };
+@@ -930,11 +930,11 @@
+ argsp->mjrmode = MODE_SPLIT;
+
+ if ((p = strrchr(arg, ':'))) {
+- rc = sscanf(arg, "%d:%d", &argsp->split_conf.size,
++ rc = sscanf(arg, "%lld:%lld", &argsp->split_conf.size,
+ &argsp->split_conf.first_free_space);
+ rc = (rc == 2);
+ } else {
+- rc = sscanf(arg, "%d", &argsp->split_conf.size);
++ rc = sscanf(arg, "%lld", &argsp->split_conf.size);
+ rc = (rc == 1);
+ }
+ if (!rc) {
+diff -urBb poldek-0.18.9.org/split.c poldek-0.18.9/split.c
+--- poldek-0.18.9.org/split.c 2002-06-12 15:50:57.000000000 +0000
++++ poldek-0.18.9/split.c 2005-10-01 19:59:02.000000000 +0000
+@@ -35,8 +35,8 @@
+
+ struct chunk {
+ int no;
+- unsigned size;
+- unsigned maxsize;
++ unsigned long long size;
++ unsigned long long maxsize;
+ int items;
+ tn_array *pkgs;
+ };
+@@ -46,7 +46,7 @@
+ char mask[0];
+ };
+
+-static struct chunk *chunk_new(int no, int maxsize)
++static struct chunk *chunk_new(int no, unsigned long long maxsize)
+ {
+ struct chunk *chunk;
+
+@@ -238,7 +238,7 @@
+
+
+ static
+-int try_package(int deep, unsigned *chunk_size, unsigned maxsize,
++int try_package(int deep, unsigned long long *chunk_size, unsigned long long maxsize,
+ struct pkg *pkg, tn_array *stack)
+ {
+ int i, rc = 1;
+@@ -253,7 +253,7 @@
+ n_array_push(stack, pkg_link(pkg));
+ *chunk_size += pkg->fsize;
+
+- DBGF("trying %s: %d (%d) > %d\n", pkg_snprintf_s(pkg), *chunk_size,
++ DBGF("trying %s: %lld (%d) > %lld\n", pkg_snprintf_s(pkg), *chunk_size,
+ pkg->fsize, maxsize);
+
+ if (*chunk_size > maxsize)
+@@ -278,7 +278,7 @@
+ int chunk_add(struct chunk *chunk, struct pkg *pkg)
+ {
+ int i, rc = 0;
+- int chunk_size = 0;
++ unsigned long long chunk_size = 0;
+ tn_array *stack = NULL;
+
+
+@@ -319,7 +319,7 @@
+
+
+ static
+-int make_chunks(tn_array *pkgs, unsigned split_size, unsigned first_free_space,
++int make_chunks(tn_array *pkgs, unsigned long long split_size, unsigned long long first_free_space,
+ const char *outprefix)
+ {
+ int i, chunk_no = 0, rc = 1;
+@@ -371,7 +371,7 @@
+
+ snprintf(path, sizeof(path), "%s.%d", outprefix, chunk->no);
+
+- msgn(0, _("Writing %s (%4d packages, % 10d bytes, "
++ msgn(0, _("Writing %s (%4d packages, % 15ld bytes, "
+ "pri min, max = %d, %d)"),
+ path, chunk->items, chunk->size, pri_min, pri_max);
+
+@@ -379,8 +379,8 @@
+ if ((vf = vfile_open(path, VFT_STDIO, VFM_RW)) == NULL)
+ return 0;
+
+-#if 0
+- fprintf(vf->vf_stream, "# chunk #%d: %d packages, %d bytes\n",
++#if 0
++ fprintf(vf->vf_stream, "# chunk #%d: %d packages, %lld bytes\n",
+ i, chunk->items, chunk->size);
+ #endif
+ chunk_dump(chunk, vf->vf_stream);
+@@ -427,7 +427,7 @@
+ }
+
+
+-int packages_split(tn_array *pkgs, unsigned split_size, unsigned first_free_space,
++int packages_split(tn_array *pkgs, unsigned long long split_size, unsigned long long first_free_space,
+ const char *splitconf_path, const char *outprefix)
+ {
+ tn_array *defs = NULL, *packages = NULL, *ordered_pkgs = NULL;
+diff -urBb poldek-0.18.9.org/split.h poldek-0.18.9/split.h
+--- poldek-0.18.9.org/split.h 2001-09-11 16:08:37.000000000 +0000
++++ poldek-0.18.9/split.h 2005-10-01 19:00:42.000000000 +0000
+@@ -4,7 +4,7 @@
+
+ int packages_set_priorities(tn_array *pkgs, const char *splitconf_path);
+
+-int packages_split(tn_array *pkgs, unsigned split_size, unsigned first_free_space,
++int packages_split(tn_array *pkgs, unsigned long long split_size, unsigned long long first_free_space,
+ const char *splitconf_path, const char *outprefix);
+
+ #endif
--- /dev/null
+Index: pkgset-order.c
+===================================================================
+RCS file: /cvsroot/installer/poldek/pkgset-order.c,v
+retrieving revision 1.16.4.3
+retrieving revision 1.16.4.3.2.1
+diff -u -r1.16.4.3 -r1.16.4.3.2.1
+--- pkgset-order.c 5 May 2005 19:02:25 -0000 1.16.4.3
++++ pkgset-order.c 16 Jul 2005 08:09:28 -0000 1.16.4.3.2.1
+@@ -147,7 +147,8 @@
+
+ } else {
+ int i;
+- poldek_log(LOGERR, _("PreReq loop: "));
++ if (verbose >= -1)
++ poldek_log(LOGERR, _("PreReq loop: "));
+ msg(-1, "_%s", rp->pkg->name);
+ for (i=n_array_size(vs->stack)-1; i >= 0; i--) {
+ struct pkg *p = n_array_nth(vs->stack, i);
+Index: vfile/vfile.c
+===================================================================
+RCS file: /cvsroot/installer/poldek/vfile/vfile.c,v
+retrieving revision 1.43.4.5
+retrieving revision 1.43.4.5.2.1
+diff -u -r1.43.4.5 -r1.43.4.5.2.1
+--- vfile/vfile.c 15 May 2005 17:22:22 -0000 1.43.4.5
++++ vfile/vfile.c 16 Jul 2005 08:10:37 -0000 1.43.4.5.2.1
+@@ -293,7 +293,7 @@
+ {
+ int rc = 0;
+
+- if (vfmode & VFM_RW)
++ if ((vfmode & VFM_RW) && (vfmode & VFM_APPEND) == 0)
+ vf_unlink(path);
+
+ switch (vf->vf_type) {
+@@ -354,7 +354,10 @@
+ free(vf->vf_iobuf);
+ vf->vf_iobuf = NULL;
+ }
+- fseek(vf->vf_stream, 0, SEEK_SET); /* XXX glibc BUG (?) */
++ fseek(vf->vf_stream, 0L, SEEK_SET); /* XXX glibc BUG (?) */
++ if (vfmode & VFM_APPEND)
++ fseek(vf->vf_stream, 0L, SEEK_END);
++
+ } else
+ vfile_err_fn("fopencookie %s: hgw error\n", CL_URL(path));
+