From 5a8bbc99be0ec8ea264fca061276e9ec798bca5e Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 31 Oct 2006 06:41:42 +0000 Subject: Numerous changes: * Added 'ILoveCandy' support to all progress bars * Changed download callback with regards to libfetch libalpm changes * libfetch error output on failed sync * Misc others I may have forgot to name (check the diff, heh) --- src/pacman/pacman.c | 52 +++++++++++++--------------------------------------- 1 file changed, 13 insertions(+), 39 deletions(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 3b1fb8fa..a6072a22 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -40,7 +40,6 @@ #include /* debug */ #endif #include -#include #include /* pacman */ @@ -220,7 +219,11 @@ static void cleanup(int signum) if(neednl) { putchar('\n'); } + + /* restore the cursor + printf("\033[?25h\033[?0c"); fflush(stdout); + */ exit(signum); } @@ -431,6 +434,10 @@ int main(int argc, char *argv[]) signal(SIGTERM, cleanup); signal(SIGSEGV, cleanup); + /* hide the cursor, prevent flicker during fancy graphics + printf("\033[?25l\033[?1c"); + */ + /* i18n init */ lang=getenv("LC_ALL"); if(lang==NULL || lang[0]=='\0') @@ -533,46 +540,13 @@ int main(int argc, char *argv[]) ERR(NL, _("failed to set option DLCB (%s)\n"), alpm_strerror(pm_errno)); cleanup(1); } - if(alpm_set_option(PM_OPT_DLFNM, (long)sync_fnm) == -1) { - ERR(NL, _("failed to set option DLFNM (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } - if(alpm_set_option(PM_OPT_DLOFFSET, (long)&offset) == -1) { - ERR(NL, _("failed to set option DLOFFSET (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } - if(alpm_set_option(PM_OPT_DLT0, (long)&t0) == -1) { - ERR(NL, _("failed to set option DLT0 (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } - if(alpm_set_option(PM_OPT_DLT, (long)&t) == -1) { - ERR(NL, _("failed to set option DLT (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } - if(alpm_set_option(PM_OPT_DLRATE, (long)&rate) == -1) { - ERR(NL, _("failed to set option DLRATE (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } - if(alpm_set_option(PM_OPT_DLXFERED1, (long)&xfered1) == -1) { - ERR(NL, _("failed to set option DLXFERED1 (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } - if(alpm_set_option(PM_OPT_DLETA_H, (long)&eta_h) == -1) { - ERR(NL, _("failed to set option DLETA_H (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } - if(alpm_set_option(PM_OPT_DLETA_M, (long)&eta_m) == -1) { - ERR(NL, _("failed to set option DLETA_M (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } - if(alpm_set_option(PM_OPT_DLETA_S, (long)&eta_s) == -1) { - ERR(NL, _("failed to set option DLETA_S (%s)\n"), alpm_strerror(pm_errno)); - cleanup(1); - } FREE(config->dbpath); - alpm_get_option(PM_OPT_DBPATH, (long *)&config->dbpath); + long ldbpath, lcachedir; + alpm_get_option(PM_OPT_DBPATH, &ldbpath); + config->dbpath = (void *)&ldbpath; FREE(config->cachedir); - alpm_get_option(PM_OPT_CACHEDIR, (long *)&config->cachedir); + alpm_get_option(PM_OPT_CACHEDIR, &lcachedir); + config->cachedir = (void *)&lcachedir; for(lp = config->op_s_ignore; lp; lp = lp->next) { if(alpm_set_option(PM_OPT_IGNOREPKG, (long)lp->data) == -1) { -- cgit v1.2.3