diff --git a/NEWS b/NEWS index c9926a24..ee1bff1b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +xbps-0.26.2 (2013-10-30): + + * unpack: apply correctly permissions and mode to existent files if the those files + in the archive are modified compared to what it's currently on disk. + xbps-0.26.1 (2013-10-25): * xbps-uhelper: added new action "real-version" that only prints the version diff --git a/lib/package_unpack.c b/lib/package_unpack.c index caaf5f4e..e9b28b33 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -459,27 +459,6 @@ unpack_archive(struct xbps_handle *xhp, free(p2); } } - /* - * Check if current file mode differs from file mode - * in binpkg and apply perms if true. - */ - if (!force && file_exists && skip_extract && - (archive_entry_mode(entry) != st.st_mode)) { - if (chmod(entry_pname, - archive_entry_mode(entry)) != 0) { - xbps_dbg_printf(xhp, - "%s: failed " - "to set perms %s to %s: %s\n", - pkgver, archive_entry_strmode(entry), - entry_pname, - strerror(errno)); - rv = EINVAL; - goto out; - } - xbps_dbg_printf(xhp, "%s: entry %s changed file " - "mode to %s.\n", pkgver, entry_pname, - archive_entry_strmode(entry)); - } /* * Check if current uid/gid differs from file in binpkg, * and change permissions if true. @@ -503,6 +482,27 @@ unpack_archive(struct xbps_handle *xhp, archive_entry_gid(entry)); } } + /* + * Check if current file mode differs from file mode + * in binpkg and apply perms if true. + */ + if (!force && file_exists && skip_extract && + (archive_entry_mode(entry) != st.st_mode)) { + if (chmod(entry_pname, + archive_entry_mode(entry)) != 0) { + xbps_dbg_printf(xhp, + "%s: failed " + "to set perms %s to %s: %s\n", + pkgver, archive_entry_strmode(entry), + entry_pname, + strerror(errno)); + rv = EINVAL; + goto out; + } + xbps_dbg_printf(xhp, "%s: entry %s changed file " + "mode to %s.\n", pkgver, entry_pname, + archive_entry_strmode(entry)); + } if (!update && conf_file && file_exists && !skip_extract) { /*