xbps-bin: detect broken symlinks in the 'check' target.

This commit is contained in:
Juan RP 2011-09-28 11:06:24 +02:00
parent edb909c899
commit 2d50109da5

View File

@ -160,8 +160,12 @@ check_pkg_integrity(const char *pkgname)
abort(); abort();
memset(&buf, 0, sizeof(buf)); memset(&buf, 0, sizeof(buf));
if (realpath(path, buf) == NULL) if (realpath(path, buf) == NULL) {
abort(); xbps_error_printf("%s: broken symlink `%s': "
"%s\n", pkgname, file, strerror(errno));
test_broken = true;
continue;
}
free(path); free(path);
if (strcmp(xhp->rootdir, "/") && strstr(buf, xhp->rootdir)) if (strcmp(xhp->rootdir, "/") && strstr(buf, xhp->rootdir))