libxbps: extend the list of symlinks in rootdir to be ignored.

This commit is contained in:
Juan RP 2012-07-14 12:11:55 +02:00
parent 6784a7b550
commit 9edd60c3a7
3 changed files with 13 additions and 12 deletions

7
NEWS
View File

@ -1,4 +1,9 @@
xbps-0.16.5 (???): xbps-0.16.5 (2012-07-14):
* xbps.conf: remove obsolete remote repositories.
* libxbps: extend the list of ignored symlinks in rootfs if they were found
as obsoletes at package upgrade time.
* libxbps: at package register time a new string object in pkgdb is added * libxbps: at package register time a new string object in pkgdb is added
"install-date" that records the package installation date with the following "install-date" that records the package installation date with the following

View File

@ -56,7 +56,7 @@
*/ */
#define XBPS_PKGINDEX_VERSION "1.5" #define XBPS_PKGINDEX_VERSION "1.5"
#define XBPS_API_VERSION "20120711" #define XBPS_API_VERSION "20120714"
#define XBPS_VERSION "0.16.5" #define XBPS_VERSION "0.16.5"
/** /**

View File

@ -48,7 +48,7 @@ xbps_remove_obsoletes(struct xbps_handle *xhp,
prop_string_t oldstr, newstr; prop_string_t oldstr, newstr;
struct stat st; struct stat st;
const char *array_str = "files"; const char *array_str = "files";
const char *oldhash, *hash; const char *oldhash;
char *file; char *file;
int rv = 0; int rv = 0;
bool found, dodirs = false, dolinks = false; bool found, dodirs = false, dolinks = false;
@ -119,20 +119,12 @@ again:
goto out; goto out;
} }
/* /*
* Skip files with same path and/or hash. * Skip files with same path.
*/ */
if (prop_string_equals(oldstr, newstr)) { if (prop_string_equals(oldstr, newstr)) {
found = true; found = true;
break; break;
} }
hash = NULL;
prop_dictionary_get_cstring_nocopy(obj2,
"sha256", &hash);
if (hash && strcmp(hash, oldhash) == 0) {
found = true;
break;
}
} }
prop_object_iterator_reset(iter2); prop_object_iterator_reset(iter2);
if (found) { if (found) {
@ -144,8 +136,12 @@ again:
* system transition to /usr. * system transition to /usr.
*/ */
if ((strcmp(file, "./bin") == 0) || if ((strcmp(file, "./bin") == 0) ||
(strcmp(file, "./bin/") == 0) ||
(strcmp(file, "./sbin") == 0) || (strcmp(file, "./sbin") == 0) ||
(strcmp(file, "./sbin/") == 0) ||
(strcmp(file, "./lib") == 0) || (strcmp(file, "./lib") == 0) ||
(strcmp(file, "./lib/") == 0) ||
(strcmp(file, "./lib64/") == 0) ||
(strcmp(file, "./lib64") == 0)) { (strcmp(file, "./lib64") == 0)) {
free(file); free(file);
continue; continue;