projects
/
oweals
/
opkg-lede.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow to install a package from a read-only dir
[oweals/opkg-lede.git]
/
libopkg
/
pkg.c
diff --git
a/libopkg/pkg.c
b/libopkg/pkg.c
index 75e95720b3282a9fffb75154531cface61b01dd5..89f47a9e46445b0646025f27c554dcb5560ba1da 100644
(file)
--- a/
libopkg/pkg.c
+++ b/
libopkg/pkg.c
@@
-301,7
+301,7
@@
void pkg_deinit(pkg_t *pkg)
}
int
}
int
-pkg_init_from_file(pkg_t *pkg, const char *filename)
+pkg_init_from_file(
opkg_conf_t *conf,
pkg_t *pkg, const char *filename)
{
int fd, err = 0;
FILE *control_file;
{
int fd, err = 0;
FILE *control_file;
@@
-311,7
+311,9
@@
pkg_init_from_file(pkg_t *pkg, const char *filename)
pkg->local_filename = xstrdup(filename);
pkg->local_filename = xstrdup(filename);
- sprintf_alloc(&control_path, "%s.control.XXXXXX", filename);
+ sprintf_alloc(&control_path, "%s/%s.control.XXXXXX",
+ conf->tmp_dir,
+ basename(filename));
fd = mkstemp(control_path);
if (fd == -1) {
perror_msg("%s: mkstemp(%s)", __FUNCTION__, control_path);
fd = mkstemp(control_path);
if (fd == -1) {
perror_msg("%s: mkstemp(%s)", __FUNCTION__, control_path);