mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
4.0 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/mine/no-crash-and-comments.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. diff -ur mine-0.14/Makefile mine-0.14-fixed/Makefile
  23. --- mine-0.14/Makefile 2003-06-09 14:44:48.000000000 +0200
  24. +++ mine-0.14-fixed/Makefile 2003-06-14 14:50:25.000000000 +0200
  25. @@ -44,7 +44,7 @@
  26. # Set and configure the c-compiler
  27. #
  28. CFLAGS = -I$(CDB_DIR) -I$(BZIP2_DIR) -I$(LIBTAR_DIR)/lib -I. -Wall
  29. -CFLAGS += -I$(LIBTAR_DIR)/listhash -D'MINE_VERSION="$(MINE_VER)"' -O2 -ggdb
  30. +CFLAGS += -I$(LIBTAR_DIR)/listhash -D'MINE_VERSION="$(MINE_VER)"' -ggdb
  31. ifeq ($(USE_AVL), 1)
  32. CFLAGS += -DUSE_AVL=1
  33. MINE_OBJ += avl.o
  34. diff -ur mine-0.14/readdb.c mine-0.14-fixed/readdb.c
  35. --- mine-0.14/readdb.c 2003-06-09 14:44:48.000000000 +0200
  36. +++ mine-0.14-fixed/readdb.c 2003-06-14 18:06:57.000000000 +0200
  37. @@ -1,6 +1,6 @@
  38. /*
  39. * GEM MINE - The ROCK Linux Package Manager
  40. - * Copyright (C) 2002-2003 Clifford Wolf
  41. + * Copyright (C) 2002-2003 Clifford Wolf and Rene Rebe
  42. *
  43. * This program is free software; you can redistribute it and/or modify
  44. * it under the terms of the GNU General Public License as published by
  45. @@ -141,6 +141,7 @@
  46. e->next = d->list; d->list = e; e->content.pkg = p;
  47. directory_entry_count++;
  48. + /* read basic info like V and C tags */
  49. while ( fgets(line, 1024, f) != NULL && strcmp(line,"\027\n") ) {
  50. if ( (line_length = strlen(line)) < 3 ) continue;
  51. if ( line[line_length-1] == '\n' ) line[--line_length] = 0;
  52. @@ -165,6 +166,7 @@
  53. }
  54. if ( !dbf ) fclose(f);
  55. + /* read package dependencies */
  56. if ( !dbf ) {
  57. snprintf(filename, PATH_MAX, "%s/%s/info/dependencies/%s",
  58. sourcedir, config, packagename);
  59. @@ -359,7 +361,7 @@
  60. struct dirent **namelist;
  61. struct directory *d;
  62. struct package *p;
  63. - struct dependency *dep;
  64. + struct dependency **next_dep;
  65. char filename[PATH_MAX];
  66. FILE *f;
  67. int i;
  68. @@ -370,6 +372,7 @@
  69. printf("Reading package database. Please wait...\n");
  70. if ( strncmp(sourcedir, "http://", 7) && strncmp(sourcedir, "ftp://", 6) ) {
  71. + /* determine package files and max disk number */
  72. snprintf(filename, PATH_MAX, "%s/index.txt", sourcedir);
  73. if ( (f = fopen(filename, "r")) != NULL ) {
  74. char pkgdir[200], disk[200], line[160];
  75. @@ -435,10 +438,24 @@
  76. for (d = directories; d != NULL; d = d->next) sort_directory(d);
  77. - for (p = packages; p != NULL; p = p->next)
  78. - for (dep = p->deps; dep != NULL; dep = dep->next)
  79. - sscanf(memdb_get(&pkg_addr_hash, dep->name), "%p", &dep->pkg);
  80. -
  81. + for (p = packages; p != NULL; p = p->next) {
  82. + /* fill the dependenies with references to the individual packges */
  83. + for (next_dep = &(p->deps); *next_dep != NULL;) {
  84. + char* pkg_ptr_str = memdb_get(&pkg_addr_hash, (*next_dep)->name);
  85. + if (pkg_ptr_str)
  86. + sscanf(pkg_ptr_str, "%p", &(*next_dep)->pkg);
  87. + if ((*next_dep)->pkg) {
  88. + next_dep = &((*next_dep)->next);
  89. + } else {
  90. + /* drop dependency since it is not in db - this can happend
  91. + if multiple builds are run with modified packages */
  92. + struct dependency *tbd_dep = *next_dep;
  93. + *next_dep = tbd_dep->next;
  94. + free (tbd_dep->name);
  95. + free (tbd_dep);
  96. + }
  97. + }
  98. + }
  99. memdb_free(&files_on_disks);
  100. memdb_init(&pkg_addr_hash);
  101. return 0;