commit 14b6a281da65c135a6709f8f33fe275739c53874
parent 70161c217480b17010068cb7050d5441d487d166
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 20 Jun 2014 15:16:58 +0200
installpkg: resolve path of file if it exists
explicity show when a package could not be installed.
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/db.c b/db.c
@@ -115,6 +115,7 @@ dbfscollide(struct db *db, const char *file)
{
char pkgpath[PATH_MAX];
char path[PATH_MAX];
+ char resolvedpath[PATH_MAX];
struct archive *ar;
struct archive_entry *entry;
struct stat sb;
@@ -156,7 +157,10 @@ dbfscollide(struct db *db, const char *file)
return -1;
}
if (S_ISDIR(sb.st_mode) == 0) {
- weprintf("%s exists\n", path);
+ if(realpath(path, resolvedpath))
+ weprintf("%s exists\n", resolvedpath);
+ else
+ weprintf("%s exists\n", path);
ok = -1;
}
}
diff --git a/installpkg.c b/installpkg.c
@@ -63,6 +63,7 @@ main(int argc, char *argv[])
r = dbwalk(db, fscollidepkg, path);
if (r < 0) {
dbfree(db);
+ printf("not installed %s\n", path);
exit(EXIT_FAILURE);
}
}