Revert "Revert "pkg: use absolute filenames for packages""
This reverts commit 600f9e7e03
.
My bad. This was correct.
cute-signatures
parent
600f9e7e03
commit
dfc8d4ce4c
|
@ -13,6 +13,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -325,12 +326,16 @@ struct apk_package *apk_pkg_read(struct apk_database *db, const char *file)
|
||||||
{
|
{
|
||||||
struct read_info_ctx ctx;
|
struct read_info_ctx ctx;
|
||||||
struct apk_bstream *bs;
|
struct apk_bstream *bs;
|
||||||
|
char realfile[PATH_MAX];
|
||||||
|
|
||||||
|
if (realpath(file, realfile) < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
ctx.pkg = apk_pkg_new();
|
ctx.pkg = apk_pkg_new();
|
||||||
if (ctx.pkg == NULL)
|
if (ctx.pkg == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
bs = apk_bstream_from_file(file);
|
bs = apk_bstream_from_file(realfile);
|
||||||
if (bs == NULL)
|
if (bs == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
@ -355,7 +360,7 @@ struct apk_package *apk_pkg_read(struct apk_database *db, const char *file)
|
||||||
};
|
};
|
||||||
apk_deps_add(&ctx.pkg->depends, &dep);
|
apk_deps_add(&ctx.pkg->depends, &dep);
|
||||||
}
|
}
|
||||||
ctx.pkg->filename = strdup(file);
|
ctx.pkg->filename = strdup(realfile);
|
||||||
|
|
||||||
return ctx.pkg;
|
return ctx.pkg;
|
||||||
err:
|
err:
|
||||||
|
|
Loading…
Reference in New Issue