summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-12 06:31:39 +0000
committerAaron Griffin <aaron@archlinux.org>2007-02-12 06:31:39 +0000
commit2a7c1de945a3ad0673655ba65c1a2d0ade87c733 (patch)
treebca639bd255b5f96c7a2677820eda54465957460 /lib/libalpm
parentf319dc080d73ef7f43b603aae0a32a6e77328303 (diff)
Wasn't clearing out the 'pkgname' variable, which was causing goofy output
issues - silly me. Also removed config.rpath from CVS
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/server.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c
index 51f389d9..b426ccb5 100644
--- a/lib/libalpm/server.c
+++ b/lib/libalpm/server.c
@@ -190,12 +190,15 @@ int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath,
}
/* Try to get JUST the name of the package from the filename */
- p = alpm_pkg_name_hasarch(fn); /* TODO remove this later */
- _alpm_pkg_splitname(fn, pkgname, NULL, (p != NULL));
+ memset(pkgname, 0, PKG_NAME_LEN);
+ if((p = strstr(fn, PM_EXT_PKG))) {
+ _alpm_pkg_splitname(fn, pkgname, NULL, 1);
+ }
if(!strlen(pkgname)) {
/* just use the raw filename if we can't find crap */
- STRNCPY(pkgname, fn, PKG_NAME_LEN);
+ STRNCPY(pkgname, fn, PKG_NAME_LEN+1);
}
+ _alpm_log(PM_LOG_DEBUG, _("using '%s' for download progress"), pkgname);
snprintf(realfile, PATH_MAX, "%s/%s", localpath, fn);
snprintf(output, PATH_MAX, "%s/%s.part", localpath, fn);