summaryrefslogtreecommitdiff
path: root/meta/packages/ipkg/files/ipkg_bugfix.patch
blob: 51eccbb2bd8c0876186d330b580e664f47a24be6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Index: C/ipkg_conf.c
===================================================================
--- C.orig/ipkg_conf.c	2005-06-21 13:59:32.000000000 +0000
+++ C/ipkg_conf.c	2007-11-27 01:11:17.000000000 +0000
@@ -423,6 +423,7 @@
      nv_pair_t *nv_pair;
      pkg_dest_t *dest;
      char *root_dir;
+     char *list_dir2;
 
      for (iter = nv_pair_list->head; iter; iter = iter->next) {
 	  nv_pair = iter->data;
@@ -432,8 +433,14 @@
 	  } else {
 	       root_dir = strdup(nv_pair->value);
 	  }
-	  dest = pkg_dest_list_append(&conf->pkg_dest_list, nv_pair->name, root_dir, lists_dir);
+	  if (conf->offline_root) {
+	       sprintf_alloc(&list_dir2, "%s%s", conf->offline_root, lists_dir);
+	  } else {
+	       list_dir2 = strdup(lists_dir);
+	  }
+	  dest = pkg_dest_list_append(&conf->pkg_dest_list, nv_pair->name, root_dir, list_dir2);
 	  free(root_dir);
+	  free(list_dir2);
 	  if (dest == NULL) {
 	       continue;
 	  }
@@ -562,13 +569,13 @@
 	  } else if (strcmp(type, "dest") == 0) {
 	       nv_pair_list_append(tmp_dest_nv_pair_list, name, value);
 	  } else if (strcmp(type, "lists_dir") == 0) {
-	       *lists_dir = realloc(*lists_dir,strlen(value)+1);
+	       *lists_dir = realloc(*lists_dir,strlen(name)+1);
                if (*lists_dir == NULL) {
 		    ipkg_message(conf, IPKG_ERROR, "ERROR: Not enough memory\n");
 	            free(options);
 	            return EINVAL;
                }
-               sprintf (*lists_dir,"%s",value);
+               sprintf (*lists_dir,"%s", name);
 	  } else if (strcmp(type, "arch") == 0) {
 	       ipkg_message(conf, IPKG_INFO, "supported arch %s priority (%s)\n", name, value);
 	       if (!value) {