1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-01-10 13:28:12 -05:00
Aaron Griffin 2006-10-24 04:33:40 +00:00
parent 7fc4b8d2d5
commit e21f4c8f2e
5 changed files with 14 additions and 7 deletions

View File

@ -379,8 +379,13 @@ int alpm_db_update(int force, PM_DB *db)
if(_alpm_unpack(path, db->path, NULL)) { if(_alpm_unpack(path, db->path, NULL)) {
RET_ERR(PM_ERR_SYSTEM, 1); RET_ERR(PM_ERR_SYSTEM, 1);
} }
/* remove the .tar.gz */ /* remove the .tar.gz */
/* aaron: let's not do this... we'll keep the DB around to be read for the
* "new and improved" db routines
unlink(path); unlink(path);
*/
} }
return(0); return(0);

View File

@ -79,6 +79,8 @@ int alpm_logaction(char *fmt, ...);
* Options * Options
*/ */
#define PM_DLFNM_LEN 22
/* Parameters */ /* Parameters */
enum { enum {
PM_OPT_LOGCB = 1, PM_OPT_LOGCB = 1,

View File

@ -299,22 +299,22 @@ int _alpm_downloadfiles_forreal(pmlist_t *servers, const char *localpath,
struct stat st; struct stat st;
snprintf(output, PATH_MAX, "%s/%s.part", localpath, fn); snprintf(output, PATH_MAX, "%s/%s.part", localpath, fn);
if(pm_dlfnm) { if(pm_dlfnm) {
strncpy(pm_dlfnm, fn, 22); strncpy(pm_dlfnm, fn, PM_DLFNM_LEN);
} }
/* drop filename extension */ /* drop filename extension */
ptr = strstr(fn, PM_EXT_DB); ptr = strstr(fn, PM_EXT_DB);
if(pm_dlfnm && ptr && (ptr-fn) < 22) { if(pm_dlfnm && ptr && (ptr-fn) < PM_DLFNM_LEN) {
pm_dlfnm[ptr-fn] = '\0'; pm_dlfnm[ptr-fn] = '\0';
} }
ptr = strstr(fn, PM_EXT_PKG); ptr = strstr(fn, PM_EXT_PKG);
if(ptr && (ptr-fn) < 24) { if(ptr && (ptr-fn) < PM_DLFNM_LEN) {
pm_dlfnm[ptr-fn] = '\0'; pm_dlfnm[ptr-fn] = '\0';
} }
if(pm_dlfnm) { if(pm_dlfnm) {
for(j = strlen(pm_dlfnm); j < 22; j++) { for(j = strlen(pm_dlfnm); j < PM_DLFNM_LEN; j++) {
(pm_dlfnm)[j] = ' '; (pm_dlfnm)[j] = ' ';
} }
pm_dlfnm[22] = '\0'; pm_dlfnm[PM_DLFNM_LEN] = '\0';
} }
if(pm_dloffset) { if(pm_dloffset) {
*pm_dloffset = 0; *pm_dloffset = 0;

View File

@ -40,7 +40,7 @@
#include "conf.h" #include "conf.h"
/* progress bar */ /* progress bar */
char sync_fnm[23]; char sync_fnm[PM_DLFNM_LEN+1];
int offset; int offset;
struct timeval t0, t; struct timeval t0, t;
float rate; float rate;

View File

@ -21,7 +21,7 @@
#ifndef _PM_DOWNLOAD_H #ifndef _PM_DOWNLOAD_H
#define _PM_DOWNLOAD_H #define _PM_DOWNLOAD_H
extern char sync_fnm[23]; extern char sync_fnm[PM_DLFNM_LEN+1];
extern int offset; extern int offset;
extern struct timeval t0, t; extern struct timeval t0, t;
extern float rate; extern float rate;