Make the amanda26-* ports build with the new glib 2.28.

Obtained from:	amanda upstream.
This commit is contained in:
Koop Mast 2011-07-30 09:38:05 +00:00
parent 69b57c0302
commit 769329177b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=278563
11 changed files with 202 additions and 7 deletions

View File

@ -6,7 +6,7 @@
#
PKGNAMESUFFIX= -client
PORTREVISION= 1
PORTREVISION= 2
COMMENT= The Advanced Maryland Automatic Network Disk Archiver (client)

View File

@ -7,7 +7,7 @@
PORTNAME= amanda
PORTVERSION= 2.6.1p2
PORTREVISION= 3
PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES= misc
MASTER_SITES= SF/amanda/amanda%20-%20stable/${PORTVERSION}

View File

@ -1,6 +1,5 @@
--- common-src/glib-util.c.orig 2010-05-20 13:19:58.000000000 -0400
+++ common-src/glib-util.c 2010-05-20 13:24:40.000000000 -0400
--- common-src/glib-util.c.orig 2008-12-01 22:17:19.000000000 +0100
+++ common-src/glib-util.c 2011-06-25 22:43:28.000000000 +0200
@@ -38,26 +38,15 @@
if (did_glib_init) return;
did_glib_init = TRUE;
@ -47,5 +46,37 @@
}
typedef enum {
@@ -107,29 +107,19 @@
return to;
}
-void g_list_free_full(GList * list) {
- GList * cur = list;
-
- while (cur != NULL) {
- gpointer data = cur->data;
- amfree(data);
- cur = g_list_next(cur);
- }
-
- g_list_free(list);
-}
-
-void g_slist_free_full(GSList * list) {
+#if (GLIB_MAJOR_VERSION < 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 28))
+void _slist_free_full(GSList * list, GDestroyNotify free_fn) {
GSList * cur = list;
while (cur != NULL) {
gpointer data = cur->data;
- amfree(data);
+ free_fn(data);
cur = g_slist_next(cur);
}
g_slist_free(list);
}
+#endif
void g_queue_free_full(GQueue * queue) {
while (!g_queue_is_empty(queue)) {

View File

@ -0,0 +1,29 @@
--- common-src/conffile.c.orig 2011-06-25 22:48:30.000000000 +0200
+++ common-src/conffile.c 2011-06-25 22:58:42.000000000 +0200
@@ -4151,7 +4151,7 @@
amfree(config_name);
amfree(config_dir);
- g_slist_free_full(seen_filenames);
+ _slist_free_full(seen_filenames, g_free);
seen_filenames = NULL;
config_client = FALSE;
@@ -5655,7 +5655,7 @@
break;
case CONFTYPE_PP_SCRIPTLIST:
- g_slist_free_full(val->v.pp_scriptlist);
+ _slist_free_full(val->v.pp_scriptlist, g_free);
break;
case CONFTYPE_APPLICATION:
@@ -6771,7 +6771,7 @@
void
config_clear_errors(void)
{
- g_slist_free_full(cfgerr_errors);
+ _slist_free_full(cfgerr_errors, g_free);
cfgerr_errors = NULL;
cfgerr_level = CFGERR_OK;

View File

@ -0,0 +1,21 @@
--- common-src/glib-util.h.orig 2011-06-25 22:39:20.000000000 +0200
+++ common-src/glib-util.h 2011-06-25 22:40:39.000000000 +0200
@@ -62,10 +62,16 @@ GValue* g_value_unset_init(GValue* val,
* Returns its second (reset) argument.*/
GValue* g_value_unset_copy(const GValue* from, GValue * to);
+/* This function is available in glib-2.28.0 and higher; for lower versions
+ * we build our own version with a different name */
+#if (GLIB_MAJOR_VERSION < 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 28))
+void _slist_free_full(GSList * list, GDestroyNotify free_fn);
+#else
+#define _slist_free_full(list, free_fn) g_slist_free_full((list), (free_fn))
+#endif
+
/* These functions all take a GLib container, and call free() on all the
* pointers in the container before free()ing the container itself. */
-void g_list_free_full(GList * list);
-void g_slist_free_full(GSList * list);
void g_queue_free_full(GQueue * queue);
void g_ptr_array_free_full(GPtrArray * array);

View File

@ -0,0 +1,20 @@
--- server-src/amadmin.c.orig 2011-06-25 22:52:23.000000000 +0200
+++ server-src/amadmin.c 2011-06-25 22:53:50.000000000 +0200
@@ -1414,7 +1414,7 @@
amfree(dumpstr);
dumpfile_free_data(&file);
}
- g_slist_free_full(file_list);
+ _slist_free_full(file_list, g_free);
break;
case HOLDING_DELETE:
@@ -1432,7 +1432,7 @@
error(_("Could not delete '%s'"), (char *)li->data);
}
}
- g_slist_free_full(file_list);
+ _slist_free_full(file_list, g_free);
break;
}
}

View File

@ -0,0 +1,41 @@
--- server-src/amflush.c.orig 2011-06-25 22:52:32.000000000 +0200
+++ server-src/amflush.c 2011-06-25 22:54:16.000000000 +0200
@@ -241,7 +241,7 @@
stralloc((char *)datestamp->data),
g_compare_strings);
}
- g_slist_free_full(all_datestamps);
+ _slist_free_full(all_datestamps, g_free);
}
else {
/* otherwise, in batch mode, use all datestamps */
@@ -390,9 +390,9 @@
}
}
- g_slist_free_full(datestamp_list);
+ _slist_free_full(datestamp_list, g_free);
datestamp_list = NULL;
- g_slist_free_full(holding_list);
+ _slist_free_full(holding_list, g_free);
holding_list = NULL;
if(redirect) { /* rename errfile */
@@ -583,7 +583,7 @@
}
chupper = (char)toupper(ch);
if (chupper < 'A' || chupper > max_char) {
- g_slist_free_full(r_datestamp_list);
+ _slist_free_full(r_datestamp_list, g_free);
r_datestamp_list = NULL;
break;
}
@@ -591,7 +591,7 @@
stralloc(datestamps[chupper - 'A']));
} while ((ch = *a++) != '\0');
if (r_datestamp_list && ch == '\0') {
- g_slist_free_full(datestamp_list);
+ _slist_free_full(datestamp_list, g_free);
datestamp_list = r_datestamp_list;
break;
}

View File

@ -0,0 +1,11 @@
--- server-src/cmdline.c.orig 2011-06-25 22:50:58.000000000 +0200
+++ server-src/cmdline.c 2011-06-25 22:51:17.000000000 +0200
@@ -255,7 +255,7 @@
dumpfile_free_data(&file);
}
- g_slist_free_full(holding_files);
+ _slist_free_full(holding_files, g_free);
return matching_files;
}

View File

@ -0,0 +1,11 @@
--- server-src/find.c.orig 2011-06-25 22:52:09.000000000 +0200
+++ server-src/find.c 2011-06-25 22:53:37.000000000 +0200
@@ -257,7 +257,7 @@
dumpfile_free_data(&file);
}
- g_slist_free_full(holding_file_list);
+ _slist_free_full(holding_file_list, g_free);
}
static char *

View File

@ -0,0 +1,20 @@
--- server-src/holding.c.orig 2011-06-25 22:51:58.000000000 +0200
+++ server-src/holding.c 2011-06-25 22:53:27.000000000 +0200
@@ -565,7 +565,7 @@
dumpfile_free_data(&file);
}
- if (file_list) g_slist_free_full(file_list);
+ if (file_list) _slist_free_full(file_list, g_free);
return result_list;
}
@@ -591,7 +591,7 @@
dumpfile_free_data(&dfile);
}
- g_slist_free_full(all_files);
+ _slist_free_full(all_files, g_free);
return datestamps;
}

View File

@ -0,0 +1,11 @@
--- server-src/planner.c.orig 2011-06-25 22:52:39.000000000 +0200
+++ server-src/planner.c 2011-06-25 22:54:23.000000000 +0200
@@ -431,7 +431,7 @@
amfree(qhname);
dumpfile_free_data(&file);
}
- g_slist_free_full(holding_list);
+ _slist_free_full(holding_list, g_free);
holding_list = NULL;
}
g_fprintf(stderr, _("ENDFLUSH\n"));