extraction: fix an upgrade issue with symlinks becoming directories
modified libpkg/pkg_add.c
@@ -258,7 +258,7 @@ set_attrsat(int fd, const char *path, mode_t perm, uid_t uid, gid_t gid,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -319,7 +319,7 @@ reopen_tempdir(int rootfd, struct tempdir *t)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -330,7 +330,7 @@ get_tempdir(int rootfd, const char *path, tempdirs_t *tempdirs)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -348,14 +348,14 @@ close_tempdir(struct tempdir *t)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -398,7 +398,7 @@ create_dir(struct pkg *pkg, struct pkg_dir *d, tempdirs_t *tempdirs)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -417,7 +417,7 @@ do_extract_dir(struct pkg* pkg, struct archive *a __unused, struct archive_entry
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -443,14 +443,15 @@ try_mkdir(int fd, const char *path)
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -489,7 +490,8 @@ retry:
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -509,7 +511,7 @@ do_extract_symlink(struct pkg *pkg, struct archive *a __unused, struct archive_e
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -520,7 +522,8 @@ do_extract_symlink(struct pkg *pkg, struct archive *a __unused, struct archive_e
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -529,7 +532,7 @@ create_hardlink(struct pkg *pkg, struct pkg_file *f, const char *path, tempdirs_
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -595,7 +598,8 @@ retry:
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -609,7 +613,7 @@ do_extract_hardlink(struct pkg *pkg, struct archive *a __unused, struct archive_
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -641,7 +645,8 @@ retry:
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -649,7 +654,7 @@ create_regfile(struct pkg *pkg, struct pkg_file *f, struct archive *a,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -733,7 +738,7 @@ create_regfile(struct pkg *pkg, struct pkg_file *f, struct archive *a,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -753,7 +758,7 @@ do_extract_regfile(struct pkg *pkg, struct archive *a, struct archive_entry *ae,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -765,14 +770,15 @@ do_extract_regfile(struct pkg *pkg, struct archive *a, struct archive_entry *ae,
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -835,7 +841,7 @@ do_extract(struct archive *a, struct archive_entry *ae,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1239,6 +1245,7 @@ pkg_add_common(struct pkgdb *db, const char *path, unsigned flags,
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -1343,7 +1350,8 @@ pkg_add_common(struct pkgdb *db, const char *path, unsigned flags,
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1496,6 +1504,8 @@ pkg_add_fromdir(struct pkg *pkg, const char *src)
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -1551,7 +1561,7 @@ pkg_add_fromdir(struct pkg *pkg, const char *src)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1623,7 +1633,7 @@ pkg_add_fromdir(struct pkg *pkg, const char *src)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1644,13 +1654,13 @@ pkg_add_fromdir(struct pkg *pkg, const char *src)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1672,6 +1682,7 @@ pkg_add_fromdir(struct pkg *pkg, const char *src)
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified libpkg/private/pkg.h
@@ -122,7 +122,6 @@
|
|
|
|
|
|
| - | |
|
|
|
|
|
modified libpkg/private/utils.h
@@ -41,6 +41,8 @@
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -114,7 +116,7 @@ char *rtrimspace(char *buf);
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified libpkg/utils.c
@@ -968,7 +968,7 @@ json_escape(const char *str)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -980,12 +980,19 @@ open_tempdir(int rootfd, const char *path)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified tests/frontend/upgrade.sh
@@ -8,7 +8,8 @@ tests_init \
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -262,3 +263,24 @@ dir_become_file_body() {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
modified tests/lib/utils.c
@@ -75,10 +75,10 @@ ATF_TC_BODY(open_tempdir, tc) {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -86,7 +86,7 @@ ATF_TC_BODY(open_tempdir, tc) {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -97,7 +97,7 @@ ATF_TC_BODY(open_tempdir, tc) {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|