1 /* opkg_conf.c - the opkg package management system
5 Copyright (C) 2001 University of Southern California
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2, or (at
10 your option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
19 #include "opkg_conf.h"
20 #include "opkg_error.h"
23 #include "sprintf_alloc.h"
24 #include "opkg_conf.h"
25 #include "opkg_message.h"
26 #include "file_util.h"
30 #include "opkg_defines.h"
32 #include <sys/types.h>
36 static int opkg_conf_parse_file(opkg_conf_t
*conf
, const char *filename
,
37 pkg_src_list_t
*pkg_src_list
,
38 nv_pair_list_t
*tmp_dest_nv_pair_list
,
39 char **tmp_lists_dir
);
40 static int opkg_conf_set_option(const opkg_option_t
*options
,
41 const char *name
, const char *value
);
42 static int opkg_conf_set_default_dest(opkg_conf_t
*conf
,
43 const char *default_dest_name
);
44 static int set_and_load_pkg_src_list(opkg_conf_t
*conf
,
45 pkg_src_list_t
*nv_pair_list
);
46 static int set_and_load_pkg_dest_list(opkg_conf_t
*conf
,
47 nv_pair_list_t
*nv_pair_list
, char * lists_dir
);
49 int opkg_init_options_array(const opkg_conf_t
*conf
, opkg_option_t
**options
)
51 opkg_option_t tmp
[] = {
52 { "force_defaults", OPKG_OPT_TYPE_BOOL
, &conf
->force_defaults
},
53 { "force_depends", OPKG_OPT_TYPE_BOOL
, &conf
->force_depends
},
54 { "force_overwrite", OPKG_OPT_TYPE_BOOL
, &conf
->force_overwrite
},
55 { "force_downgrade", OPKG_OPT_TYPE_BOOL
, &conf
->force_downgrade
},
56 { "force_reinstall", OPKG_OPT_TYPE_BOOL
, &conf
->force_reinstall
},
57 { "force_space", OPKG_OPT_TYPE_BOOL
, &conf
->force_space
},
58 { "ftp_proxy", OPKG_OPT_TYPE_STRING
, &conf
->ftp_proxy
},
59 { "http_proxy", OPKG_OPT_TYPE_STRING
, &conf
->http_proxy
},
60 { "no_proxy", OPKG_OPT_TYPE_STRING
, &conf
->no_proxy
},
61 { "test", OPKG_OPT_TYPE_INT
, &conf
->noaction
},
62 { "noaction", OPKG_OPT_TYPE_INT
, &conf
->noaction
},
63 { "nodeps", OPKG_OPT_TYPE_BOOL
, &conf
->nodeps
},
64 { "offline_root", OPKG_OPT_TYPE_STRING
, &conf
->offline_root
},
65 { "offline_root_post_script_cmd", OPKG_OPT_TYPE_STRING
, &conf
->offline_root_post_script_cmd
},
66 { "offline_root_pre_script_cmd", OPKG_OPT_TYPE_STRING
, &conf
->offline_root_pre_script_cmd
},
67 { "proxy_passwd", OPKG_OPT_TYPE_STRING
, &conf
->proxy_passwd
},
68 { "proxy_user", OPKG_OPT_TYPE_STRING
, &conf
->proxy_user
},
69 { "query-all", OPKG_OPT_TYPE_BOOL
, &conf
->query_all
},
70 { "verbosity", OPKG_OPT_TYPE_BOOL
, &conf
->verbosity
},
74 *options
= (opkg_option_t
*)malloc(sizeof(tmp
));
75 if ( options
== NULL
){
76 fprintf(stderr
,"%s: Unable to allocate memory\n",__FUNCTION__
);
80 memcpy(*options
, tmp
, sizeof(tmp
));
84 static void opkg_conf_override_string(char **conf_str
, char *arg_str
)
90 *conf_str
= strdup(arg_str
);
94 static void opkg_conf_free_string(char **conf_str
)
102 int opkg_conf_init(opkg_conf_t
*conf
, const args_t
*args
)
106 nv_pair_list_t tmp_dest_nv_pair_list
;
107 char *lists_dir
= NULL
, *lock_file
= NULL
;
109 char *etc_opkg_conf_pattern
= "/etc/opkg/*.conf";
110 char *pending_dir
= NULL
;
112 memset(conf
, 0, sizeof(opkg_conf_t
));
114 pkg_src_list_init(&conf
->pkg_src_list
);
116 nv_pair_list_init(&tmp_dest_nv_pair_list
);
117 pkg_dest_list_init(&conf
->pkg_dest_list
);
119 nv_pair_list_init(&conf
->arch_list
);
121 conf
->restrict_to_default_dest
= 0;
122 conf
->default_dest
= NULL
;
124 /* check for lock file */
125 if (args
->offline_root
)
126 sprintf_alloc (&lock_file
, "%s/%s/lock", args
->offline_root
, OPKG_STATE_DIR_PREFIX
);
128 sprintf_alloc (&lock_file
, "%s/lock", OPKG_STATE_DIR_PREFIX
);
130 conf
->lock_fd
= creat (lock_file
, S_IRUSR
| S_IWUSR
| S_IRGRP
);
131 err
= lockf (conf
->lock_fd
, F_TLOCK
, 0);
137 opkg_message (conf
, OPKG_ERROR
, "Could not obtain administrative lock\n");
138 return OPKG_CONF_ERR_LOCK
;
143 tmp_dir_base
= args
->tmp_dir
;
145 tmp_dir_base
= getenv("TMPDIR");
146 sprintf_alloc(&conf
->tmp_dir
, "%s/%s",
147 tmp_dir_base
? tmp_dir_base
: OPKG_CONF_DEFAULT_TMP_DIR_BASE
,
148 OPKG_CONF_TMP_DIR_SUFFIX
);
149 conf
->tmp_dir
= mkdtemp(conf
->tmp_dir
);
150 if (conf
->tmp_dir
== NULL
) {
151 fprintf(stderr
, "%s: Failed to create temporary directory `%s': %s\n",
152 __FUNCTION__
, conf
->tmp_dir
, strerror(errno
));
153 return OPKG_CONF_ERR_TMP_DIR
;
156 conf
->force_depends
= 0;
157 conf
->force_defaults
= 0;
158 conf
->force_overwrite
= 0;
159 conf
->force_downgrade
= 0;
160 conf
->force_reinstall
= 0;
161 conf
->force_space
= 0;
162 conf
->force_removal_of_essential_packages
= 0;
163 conf
->force_removal_of_dependent_packages
= 0;
165 conf
->offline_root
= NULL
;
166 conf
->offline_root_pre_script_cmd
= NULL
;
167 conf
->offline_root_post_script_cmd
= NULL
;
171 conf
->http_proxy
= NULL
;
172 conf
->ftp_proxy
= NULL
;
173 conf
->no_proxy
= NULL
;
174 conf
->proxy_user
= NULL
;
175 conf
->proxy_passwd
= NULL
;
177 pkg_hash_init("pkg-hash", &conf
->pkg_hash
, OPKG_CONF_DEFAULT_HASH_LEN
);
178 hash_table_init("file-hash", &conf
->file_hash
, OPKG_CONF_DEFAULT_HASH_LEN
);
179 hash_table_init("obs-file-hash", &conf
->obs_file_hash
, OPKG_CONF_DEFAULT_HASH_LEN
);
180 lists_dir
=(char *)malloc(1);
182 if (args
->conf_file
) {
183 struct stat stat_buf
;
184 err
= stat(args
->conf_file
, &stat_buf
);
186 if (opkg_conf_parse_file(conf
, args
->conf_file
,
187 &conf
->pkg_src_list
, &tmp_dest_nv_pair_list
,&lists_dir
)<0) {
188 /* Memory leakage from opkg_conf_parse-file */
189 return OPKG_CONF_ERR_PARSE
;
193 if (strlen(lists_dir
)<=1 ){
194 lists_dir
= realloc(lists_dir
,strlen(OPKG_CONF_LISTS_DIR
)+2);
195 sprintf (lists_dir
,"%s",OPKG_CONF_LISTS_DIR
);
198 if (args
->offline_root
) {
200 sprintf_alloc(&tmp
, "%s/%s",args
->offline_root
,lists_dir
);
205 pending_dir
= malloc(strlen(lists_dir
)+strlen("/pending")+5);
206 snprintf(pending_dir
,strlen(lists_dir
)+strlen("/pending") ,"%s%s",lists_dir
,"/pending");
208 conf
->lists_dir
= strdup(lists_dir
);
209 conf
->pending_dir
= strdup(pending_dir
);
211 if (args
->offline_root
)
212 sprintf_alloc(&etc_opkg_conf_pattern
, "%s/etc/opkg/*.conf", args
->offline_root
);
213 memset(&globbuf
, 0, sizeof(globbuf
));
214 err
= glob(etc_opkg_conf_pattern
, 0, NULL
, &globbuf
);
215 if (args
->offline_root
)
216 free (etc_opkg_conf_pattern
);
219 for (i
= 0; i
< globbuf
.gl_pathc
; i
++) {
220 if (globbuf
.gl_pathv
[i
])
221 if ( opkg_conf_parse_file(conf
, globbuf
.gl_pathv
[i
],
222 &conf
->pkg_src_list
, &tmp_dest_nv_pair_list
,&lists_dir
)<0) {
223 /* Memory leakage from opkg_conf_parse-file */
224 return OPKG_CONF_ERR_PARSE
;
230 /* if no architectures were defined, then default all, noarch, and host architecture */
231 if (nv_pair_list_empty(&conf
->arch_list
)) {
232 nv_pair_list_append(&conf
->arch_list
, "all", "1");
233 nv_pair_list_append(&conf
->arch_list
, "noarch", "1");
234 nv_pair_list_append(&conf
->arch_list
, HOST_CPU_STR
, "10");
237 /* Even if there is no conf file, we'll need at least one dest. */
238 if (tmp_dest_nv_pair_list
.head
== NULL
) {
239 nv_pair_list_append(&tmp_dest_nv_pair_list
,
240 OPKG_CONF_DEFAULT_DEST_NAME
,
241 OPKG_CONF_DEFAULT_DEST_ROOT_DIR
);
244 /* After parsing the file, set options from command-line, (so that
245 command-line arguments take precedence) */
246 /* XXX: CLEANUP: The interaction between args.c and opkg_conf.c
247 really needs to be cleaned up. There is so much duplication
248 right now it is ridiculous. Maybe opkg_conf_t should just save
249 a pointer to args_t (which could then not be freed), rather
250 than duplicating every field here? */
251 if (args
->autoremove
) {
252 conf
->autoremove
= 1;
254 if (args
->force_depends
) {
255 conf
->force_depends
= 1;
257 if (args
->force_defaults
) {
258 conf
->force_defaults
= 1;
260 if (args
->force_overwrite
) {
261 conf
->force_overwrite
= 1;
263 if (args
->force_downgrade
) {
264 conf
->force_downgrade
= 1;
266 if (args
->force_reinstall
) {
267 conf
->force_reinstall
= 1;
269 if (args
->force_removal_of_dependent_packages
) {
270 conf
->force_removal_of_dependent_packages
= 1;
272 if (args
->force_removal_of_essential_packages
) {
273 conf
->force_removal_of_essential_packages
= 1;
278 if (args
->noaction
) {
281 if (args
->query_all
) {
284 if (args
->verbosity
!= conf
->verbosity
) {
285 conf
->verbosity
= args
->verbosity
;
288 opkg_conf_override_string(&conf
->offline_root
,
290 opkg_conf_override_string(&conf
->offline_root_pre_script_cmd
,
291 args
->offline_root_pre_script_cmd
);
292 opkg_conf_override_string(&conf
->offline_root_post_script_cmd
,
293 args
->offline_root_post_script_cmd
);
295 /* Pigi: added a flag to disable the checking of structures if the command does not need to
296 read anything from there.
298 if ( !(args
->nocheckfordirorfile
)){
299 /* need to run load the source list before dest list -Jamey */
300 if ( !(args
->noreadfeedsfile
))
301 set_and_load_pkg_src_list(conf
, &conf
->pkg_src_list
);
303 /* Now that we have resolved conf->offline_root, we can commit to
304 the directory names for the dests and load in all the package
306 set_and_load_pkg_dest_list(conf
, &tmp_dest_nv_pair_list
,lists_dir
);
309 err
= opkg_conf_set_default_dest(conf
, args
->dest
);
311 return OPKG_CONF_ERR_DEFAULT_DEST
;
315 nv_pair_list_deinit(&tmp_dest_nv_pair_list
);
322 void opkg_conf_deinit(opkg_conf_t
*conf
)
324 #ifdef OPKG_DEBUG_NO_TMP_CLEANUP
326 fprintf(stderr
, "%s: Not cleaning up %s since opkg compiled "
327 "with OPKG_DEBUG_NO_TMP_CLEANUP\n",
328 __FUNCTION__
, conf
->tmp_dir
);
332 err
= rmdir(conf
->tmp_dir
);
334 if (errno
== ENOTEMPTY
) {
336 sprintf_alloc(&cmd
, "rm -fr %s\n", conf
->tmp_dir
);
341 fprintf(stderr
, "WARNING: Unable to remove temporary directory: %s: %s\n", conf
->tmp_dir
, strerror(errno
));
343 #endif /* OPKG_DEBUG_NO_TMP_CLEANUP */
345 free(conf
->tmp_dir
); /*XXX*/
346 free(conf
->lists_dir
);
347 free(conf
->pending_dir
);
349 pkg_src_list_deinit(&conf
->pkg_src_list
);
350 pkg_dest_list_deinit(&conf
->pkg_dest_list
);
351 nv_pair_list_deinit(&conf
->arch_list
);
353 pkg_hash_deinit(&conf
->pkg_hash
);
354 if (&conf
->file_hash
)
355 hash_table_deinit(&conf
->file_hash
);
356 if (&conf
->obs_file_hash
)
357 hash_table_deinit(&conf
->obs_file_hash
);
359 opkg_conf_free_string(&conf
->offline_root
);
360 opkg_conf_free_string(&conf
->offline_root_pre_script_cmd
);
361 opkg_conf_free_string(&conf
->offline_root_post_script_cmd
);
363 if (conf
->verbosity
> 1) {
365 hash_table_t
*hashes
[] = {
368 &conf
->obs_file_hash
};
369 for (i
= 0; i
< 3; i
++) {
370 hash_table_t
*hash
= hashes
[i
];
374 for (j
= 0; j
< hash
->n_entries
; j
++) {
376 hash_entry_t
*e
= &hash
->entries
[j
];
379 while (e
&& e
->key
) {
386 opkg_message(conf
, OPKG_DEBUG
, "hash_table[%s] n_buckets=%d n_elements=%d max_conflicts=%d n_conflicts=%d\n",
387 hash
->name
, hash
->n_entries
, hash
->n_elements
, c
, n_conflicts
);
388 hash_table_deinit(hash
);
393 static int opkg_conf_set_default_dest(opkg_conf_t
*conf
,
394 const char *default_dest_name
)
396 pkg_dest_list_elt_t
*iter
;
399 for (iter
= conf
->pkg_dest_list
.head
; iter
; iter
= iter
->next
) {
401 if (strcmp(dest
->name
, default_dest_name
) == 0) {
402 conf
->default_dest
= dest
;
403 conf
->restrict_to_default_dest
= 1;
408 fprintf(stderr
, "ERROR: Unknown dest name: `%s'\n", default_dest_name
);
413 static int set_and_load_pkg_src_list(opkg_conf_t
*conf
, pkg_src_list_t
*pkg_src_list
)
415 pkg_src_list_elt_t
*iter
;
419 for (iter
= pkg_src_list
->head
; iter
; iter
= iter
->next
) {
425 sprintf_alloc(&list_file
, "%s/%s",
426 conf
->restrict_to_default_dest
? conf
->default_dest
->lists_dir
: conf
->lists_dir
,
429 if (file_exists(list_file
)) {
430 pkg_hash_add_from_file(conf
, list_file
, src
, NULL
, 0);
438 static int set_and_load_pkg_dest_list(opkg_conf_t
*conf
, nv_pair_list_t
*nv_pair_list
, char *lists_dir
)
440 nv_pair_list_elt_t
*iter
;
445 for (iter
= nv_pair_list
->head
; iter
; iter
= iter
->next
) {
446 nv_pair
= iter
->data
;
448 if (conf
->offline_root
) {
449 sprintf_alloc(&root_dir
, "%s%s", conf
->offline_root
, nv_pair
->value
);
451 root_dir
= strdup(nv_pair
->value
);
453 dest
= pkg_dest_list_append(&conf
->pkg_dest_list
, nv_pair
->name
, root_dir
, lists_dir
);
458 if (conf
->default_dest
== NULL
) {
459 conf
->default_dest
= dest
;
461 if (file_exists(dest
->status_file_name
)) {
462 pkg_hash_add_from_file(conf
, dest
->status_file_name
,
470 static int opkg_conf_parse_file(opkg_conf_t
*conf
, const char *filename
,
471 pkg_src_list_t
*pkg_src_list
,
472 nv_pair_list_t
*tmp_dest_nv_pair_list
,
476 opkg_option_t
* options
;
477 FILE *file
= fopen(filename
, "r");
478 regex_t valid_line_re
, comment_re
;
479 #define regmatch_size 12
480 regmatch_t regmatch
[regmatch_size
];
482 if (opkg_init_options_array(conf
, &options
)<0)
486 fprintf(stderr
, "%s: failed to open %s: %s\n",
487 __FUNCTION__
, filename
, strerror(errno
));
491 opkg_message(conf
, OPKG_NOTICE
, "loading conf file %s\n", filename
);
493 err
= xregcomp(&comment_re
,
494 "^[[:space:]]*(#.*|[[:space:]]*)$",
500 err
= xregcomp(&valid_line_re
, "^[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))([[:space:]]+([^[:space:]]+))?[[:space:]]*$", REG_EXTENDED
);
509 char *type
, *name
, *value
, *extra
;
511 line
= file_read_line_alloc(file
);
519 if (regexec(&comment_re
, line
, 0, 0, 0) == 0) {
523 if (regexec(&valid_line_re
, line
, regmatch_size
, regmatch
, 0) == REG_NOMATCH
) {
525 fprintf(stderr
, "%s:%d: Ignoring invalid line: `%s'\n",
526 filename
, line_num
, line
);
530 /* This has to be so ugly to deal with optional quotation marks */
531 if (regmatch
[2].rm_so
> 0) {
532 type
= strndup(line
+ regmatch
[2].rm_so
,
533 regmatch
[2].rm_eo
- regmatch
[2].rm_so
);
535 type
= strndup(line
+ regmatch
[3].rm_so
,
536 regmatch
[3].rm_eo
- regmatch
[3].rm_so
);
538 if (regmatch
[5].rm_so
> 0) {
539 name
= strndup(line
+ regmatch
[5].rm_so
,
540 regmatch
[5].rm_eo
- regmatch
[5].rm_so
);
542 name
= strndup(line
+ regmatch
[6].rm_so
,
543 regmatch
[6].rm_eo
- regmatch
[6].rm_so
);
545 if (regmatch
[8].rm_so
> 0) {
546 value
= strndup(line
+ regmatch
[8].rm_so
,
547 regmatch
[8].rm_eo
- regmatch
[8].rm_so
);
549 value
= strndup(line
+ regmatch
[9].rm_so
,
550 regmatch
[9].rm_eo
- regmatch
[9].rm_so
);
553 if (regmatch
[11].rm_so
> 0) {
554 extra
= strndup (line
+ regmatch
[11].rm_so
,
555 regmatch
[11].rm_eo
- regmatch
[11].rm_so
);
558 /* We use the tmp_dest_nv_pair_list below instead of
559 conf->pkg_dest_list because we might encounter an
560 offline_root option later and that would invalidate the
561 directories we would have computed in
562 pkg_dest_list_init. (We do a similar thing with
563 tmp_src_nv_pair_list for sake of symmetry.) */
564 if (strcmp(type
, "option") == 0) {
565 opkg_conf_set_option(options
, name
, value
);
566 } else if (strcmp(type
, "src") == 0) {
567 if (!nv_pair_list_find((nv_pair_list_t
*) pkg_src_list
, name
)) {
568 pkg_src_list_append (pkg_src_list
, name
, value
, extra
, 0);
570 opkg_message(conf
, OPKG_ERROR
, "ERROR: duplicate src declaration. Skipping:\n\t src %s %s\n",
573 } else if (strcmp(type
, "src/gz") == 0) {
574 if (!nv_pair_list_find((nv_pair_list_t
*) pkg_src_list
, name
)) {
575 pkg_src_list_append (pkg_src_list
, name
, value
, extra
, 1);
577 opkg_message(conf
, OPKG_ERROR
, "ERROR: duplicate src declaration. Skipping:\n\t src %s %s\n",
580 } else if (strcmp(type
, "dest") == 0) {
581 nv_pair_list_append(tmp_dest_nv_pair_list
, name
, value
);
582 } else if (strcmp(type
, "lists_dir") == 0) {
583 *lists_dir
= realloc(*lists_dir
,strlen(value
)+1);
584 if (*lists_dir
== NULL
) {
585 opkg_message(conf
, OPKG_ERROR
, "ERROR: Not enough memory\n");
589 sprintf (*lists_dir
,"%s",value
);
590 } else if (strcmp(type
, "arch") == 0) {
591 opkg_message(conf
, OPKG_INFO
, "supported arch %s priority (%s)\n", name
, value
);
593 opkg_message(conf
, OPKG_NOTICE
, "defaulting architecture %s priority to 10\n", name
);
594 value
= strdup("10");
596 nv_pair_list_append(&conf
->arch_list
, name
, value
);
598 fprintf(stderr
, "WARNING: Ignoring unknown configuration "
599 "parameter: %s %s %s\n", type
, name
, value
);
615 regfree(&comment_re
);
616 regfree(&valid_line_re
);
622 static int opkg_conf_set_option(const opkg_option_t
*options
,
623 const char *name
, const char *value
)
626 while (options
[i
].name
) {
627 if (strcmp(options
[i
].name
, name
) == 0) {
628 switch (options
[i
].type
) {
629 case OPKG_OPT_TYPE_BOOL
:
630 *((int *)options
[i
].value
) = 1;
632 case OPKG_OPT_TYPE_INT
:
634 *((int *)options
[i
].value
) = atoi(value
);
637 printf("%s: Option %s need an argument\n",
641 case OPKG_OPT_TYPE_STRING
:
643 *((char **)options
[i
].value
) = strdup(value
);
646 printf("%s: Option %s need an argument\n",
655 fprintf(stderr
, "%s: Unrecognized option: %s=%s\n",
656 __FUNCTION__
, name
, value
);
660 int opkg_conf_write_status_files(opkg_conf_t
*conf
)
662 pkg_dest_list_elt_t
*iter
;
671 for (iter
= conf
->pkg_dest_list
.head
; iter
; iter
= iter
->next
) {
673 dest
->status_file
= fopen(dest
->status_file_tmp_name
, "w");
674 if (dest
->status_file
== NULL
) {
675 fprintf(stderr
, "%s: Can't open status file: %s for writing: %s\n",
676 __FUNCTION__
, dest
->status_file_name
, strerror(errno
));
680 all
= pkg_vec_alloc();
681 pkg_hash_fetch_available(&conf
->pkg_hash
, all
);
683 for(i
= 0; i
< all
->len
; i
++) {
685 /* We don't need most uninstalled packages in the status file */
686 if (pkg
->state_status
== SS_NOT_INSTALLED
687 && (pkg
->state_want
== SW_UNKNOWN
688 || pkg
->state_want
== SW_DEINSTALL
689 || pkg
->state_want
== SW_PURGE
)) {
693 fprintf(stderr
, "Null package\n");
695 if (pkg
->dest
== NULL
) {
696 fprintf(stderr
, "%s: ERROR: Can't write status for "
697 "package %s since it has a NULL dest\n",
698 __FUNCTION__
, pkg
->name
);
701 if (pkg
->dest
->status_file
) {
702 pkg_print_status(pkg
, pkg
->dest
->status_file
);
708 for (iter
= conf
->pkg_dest_list
.head
; iter
; iter
= iter
->next
) {
710 if (dest
->status_file
) {
711 err
= ferror(dest
->status_file
);
712 fclose(dest
->status_file
);
713 dest
->status_file
= NULL
;
715 file_move(dest
->status_file_tmp_name
, dest
->status_file_name
);
717 fprintf(stderr
, "%s: ERROR: An error has occurred writing %s, "
718 "retaining old %s\n", __FUNCTION__
,
719 dest
->status_file_tmp_name
, dest
->status_file_name
);
728 char *root_filename_alloc(opkg_conf_t
*conf
, char *filename
)
731 sprintf_alloc(&root_filename
, "%s%s", (conf
->offline_root
? conf
->offline_root
: ""), filename
);
732 return root_filename
;