index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Allan McRae <allan@archlinux.org> | 2010-10-11 13:47:18 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2010-10-14 13:17:39 +1000 |
commit | 448f78c067955d617c302f322a2dc6507cb6eb13 (patch) | |
tree | ecd74abe4fe689dc39589475e6f0782ca4e8f899 /lib/libalpm/db.c | |
parent | 5717c7d508db463ec178a83e852dc5e89212bd15 (diff) |
-rw-r--r-- | lib/libalpm/db.c | 37 |
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 1adf549b..af68a508 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -796,41 +796,4 @@ int splitname(const char *target, pmpkg_t *pkg) return(0); } - -/* TODO: move these two functions to be_local once be_sync no longer uses them */ - -int checkdbdir(pmdb_t *db) -{ - struct stat buf; - const char *path = _alpm_db_path(db); - - if(stat(path, &buf) != 0) { - _alpm_log(PM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n", - path); - if(_alpm_makepath(path) != 0) { - RET_ERR(PM_ERR_SYSTEM, -1); - } - } else if(!S_ISDIR(buf.st_mode)) { - _alpm_log(PM_LOG_WARNING, _("removing invalid database: %s\n"), path); - if(unlink(path) != 0 || _alpm_makepath(path) != 0) { - RET_ERR(PM_ERR_SYSTEM, -1); - } - } - return(0); -} - -/* Note: the return value must be freed by the caller */ -char *get_pkgpath(pmdb_t *db, pmpkg_t *info) -{ - size_t len; - char *pkgpath; - const char *dbpath; - - dbpath = _alpm_db_path(db); - len = strlen(dbpath) + strlen(info->name) + strlen(info->version) + 3; - MALLOC(pkgpath, len, RET_ERR(PM_ERR_MEMORY, NULL)); - sprintf(pkgpath, "%s%s-%s/", dbpath, info->name, info->version); - return(pkgpath); -} - /* vim: set ts=2 sw=2 noet: */ |