diff options
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | lib/rpminstall.c | 87 | ||||
-rw-r--r-- | perl/Makefile.in | 2 | ||||
-rw-r--r-- | po/rpm.pot | 58 | ||||
-rw-r--r-- | python/Makefile.in | 2 | ||||
-rw-r--r-- | scripts/Makefile.in | 309 |
6 files changed, 116 insertions, 343 deletions
@@ -21,6 +21,7 @@ - remove getMacroBody() from rpmio API. - hide libio lossage in prototype, not API. - add brp-strip-shared script <rodrigob@conectiva.com.br>. + - better item/task progress bars <rodrigob@conectiva.com.br>. 3.0.6 -> 4.0 - use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db. diff --git a/lib/rpminstall.c b/lib/rpminstall.c index bd5d080a1..bfcd4fcec 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -13,24 +13,60 @@ /*@access Header@*/ /* XXX compared with NULL */ /*@access FD_t@*/ /* XXX compared with NULL */ +/* Define if you want percentage progress in the hash bars when + * writing to a tty (ordinary hash bars otherwise) --claudio + */ +#define FANCY_HASH + static int hashesPrinted = 0; +#ifdef FANCY_HASH +static int packagesTotal = 0; +static int progressTotal = 0; +static int progressCurrent = 0; +#endif + static void printHash(const unsigned long amount, const unsigned long total) { int hashesNeeded; + int hashesTotal = 50; - if (hashesPrinted != 50) { - hashesNeeded = 50 * (total ? (((float) amount) / total) : 1); +#ifdef FANCY_HASH + if (isatty (STDOUT_FILENO)) + hashesTotal = 44; +#endif + + if (hashesPrinted != hashesTotal) { + hashesNeeded = hashesTotal * (total ? (((float) amount) / total) : 1); while (hashesNeeded > hashesPrinted) { - printf("#"); +#ifdef FANCY_HASH + if (isatty (STDOUT_FILENO)) { + int i; + for (i = 0; i < hashesPrinted; i++) putchar ('#'); + for (; i < hashesTotal; i++) putchar (' '); + printf ("(%3d%%)", (int)(100 * (total ? (((float) amount) / total) : 1))); + for (i = 0; i < (hashesTotal + 6); i++) putchar ('\b'); + } else +#endif + fprintf(stdout, "#"); + fflush(stdout); hashesPrinted++; } fflush(stdout); hashesPrinted = hashesNeeded; - if (hashesPrinted == 50) - fprintf(stdout, "\n"); + if (hashesPrinted == hashesTotal) { +#ifdef FANCY_HASH + int i; + progressCurrent++; + for (i = 1; i < hashesPrinted; i++) putchar ('#'); + printf (" [%3d%%]\n", (int)(100 * (progressTotal ? + (((float) progressCurrent) / progressTotal) : 1))); +#else + fprintf (stdout, "\n"); +#endif + } } } @@ -66,17 +102,24 @@ static void * showProgress(const void * arg, const rpmCallbackType what, if (flags & INSTALL_HASH) { s = headerSprintf(h, "%{NAME}", rpmTagTable, rpmHeaderFormats, NULL); - printf("%-28s", s); +#ifdef FANCY_HASH + if (isatty (STDOUT_FILENO)) + fprintf(stdout, "%4d:%-23.23s", progressCurrent + 1, s); + else +#else + fprintf(stdout, "%-28s", s); +#endif fflush(stdout); } else { s = headerSprintf(h, "%{NAME}-%{VERSION}-%{RELEASE}", rpmTagTable, rpmHeaderFormats, NULL); - printf("%s\n", s); + fprintf(stdout, "%s\n", s); } free(s); } break; + case RPMCALLBACK_TRANS_PROGRESS: case RPMCALLBACK_INST_PROGRESS: if (flags & INSTALL_PERCENT) { fprintf(stdout, "%%%% %f\n", (total @@ -87,9 +130,32 @@ static void * showProgress(const void * arg, const rpmCallbackType what, } break; - case RPMCALLBACK_TRANS_PROGRESS: case RPMCALLBACK_TRANS_START: + hashesPrinted = 0; +#ifdef FANCY_HASH + progressTotal = 1; + progressCurrent = 0; +#endif + if (flags & INSTALL_LABEL) { + if (flags & INSTALL_HASH) { + fprintf(stdout, "%-28s", _("Preparing...")); + fflush(stdout); + } else { + printf("%s\n", _("Preparing packages for installation...")); + } + } + break; + case RPMCALLBACK_TRANS_STOP: + if (flags & INSTALL_HASH) { + printHash(1, 1); /* Fixes "preparing..." progress bar */ + } +#ifdef FANCY_HASH + progressTotal = packagesTotal; + progressCurrent = 0; +#endif + break; + case RPMCALLBACK_UNINST_PROGRESS: case RPMCALLBACK_UNINST_START: case RPMCALLBACK_UNINST_STOP: @@ -376,7 +442,10 @@ int rpmInstall(const char * rootdir, const char ** fileArgv, if (numRPMS && !stopInstall) { rpmProblemSet probs = NULL; -; + +#ifdef FANCY_HASH + packagesTotal = numRPMS; +#endif rpmMessage(RPMMESS_DEBUG, _("installing binary packages\n")); rc = rpmRunTransactions(rpmdep, showProgress, (void *) ((long)notifyFlags), NULL, &probs, transFlags, probFilter); diff --git a/perl/Makefile.in b/perl/Makefile.in index 34c649df2..274c25c07 100644 --- a/perl/Makefile.in +++ b/perl/Makefile.in @@ -74,6 +74,8 @@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ DATADIRNAME = @DATADIRNAME@ DBLIBOBJS = @DBLIBOBJS@ DLLTOOL = @DLLTOOL@ diff --git a/po/rpm.pot b/po/rpm.pot index 18750d26c..78fd3f553 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-10-28 12:51-0400\n" +"POT-Creation-Date: 2000-10-28 14:36-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: build.c:25 lib/rpminstall.c:463 +#: build.c:25 lib/rpminstall.c:532 #, c-format msgid "cannot open %s/packages.rpm\n" msgstr "" @@ -3009,7 +3009,7 @@ msgstr "" msgid "old format source packages cannot be queried\n" msgstr "" -#: lib/query.c:530 lib/rpminstall.c:245 +#: lib/query.c:530 lib/rpminstall.c:311 #, c-format msgid "%s does not appear to be a RPM package\n" msgstr "" @@ -3073,7 +3073,7 @@ msgstr "" msgid "record %d could not be read\n" msgstr "" -#: lib/query.c:708 lib/rpminstall.c:476 +#: lib/query.c:708 lib/rpminstall.c:545 #, c-format msgid "package %s is not installed\n" msgstr "" @@ -3350,104 +3350,112 @@ msgstr "" msgid "failed to remove directory %s: %s\n" msgstr "" -#: lib/rpminstall.c:139 +#: lib/rpminstall.c:141 +msgid "Preparing..." +msgstr "" + +#: lib/rpminstall.c:144 +msgid "Preparing packages for installation..." +msgstr "" + +#: lib/rpminstall.c:205 msgid "counting packages to install\n" msgstr "" -#: lib/rpminstall.c:143 +#: lib/rpminstall.c:209 #, c-format msgid "found %d packages\n" msgstr "" -#: lib/rpminstall.c:148 +#: lib/rpminstall.c:214 msgid "looking for packages to download\n" msgstr "" -#: lib/rpminstall.c:163 +#: lib/rpminstall.c:229 #, c-format msgid "skipping %s - rpmGlob failed(%d)\n" msgstr "" -#: lib/rpminstall.c:178 +#: lib/rpminstall.c:244 #, c-format msgid "Retrieving %s\n" msgstr "" #. XXX undefined %{name}/%{version}/%{release} here #. XXX %{_tmpdir} does not exist -#: lib/rpminstall.c:188 +#: lib/rpminstall.c:254 #, c-format msgid " ... as %s\n" msgstr "" -#: lib/rpminstall.c:192 +#: lib/rpminstall.c:258 #, c-format msgid "skipping %s - transfer failed - %s\n" msgstr "" -#: lib/rpminstall.c:219 +#: lib/rpminstall.c:285 #, c-format msgid "retrieved %d packages\n" msgstr "" -#: lib/rpminstall.c:231 lib/rpminstall.c:400 +#: lib/rpminstall.c:297 lib/rpminstall.c:469 #, c-format msgid "cannot open file %s: %s\n" msgstr "" -#: lib/rpminstall.c:249 lib/rpminstall.c:541 +#: lib/rpminstall.c:315 lib/rpminstall.c:610 #, c-format msgid "%s cannot be installed\n" msgstr "" -#: lib/rpminstall.c:264 +#: lib/rpminstall.c:330 #, c-format msgid "cannot open Packages database in %s\n" msgstr "" -#: lib/rpminstall.c:284 +#: lib/rpminstall.c:350 #, c-format msgid "package %s is not relocateable\n" msgstr "" -#: lib/rpminstall.c:329 +#: lib/rpminstall.c:395 #, c-format msgid "error reading from file %s\n" msgstr "" -#: lib/rpminstall.c:334 +#: lib/rpminstall.c:400 #, c-format msgid "file %s requires a newer version of RPM\n" msgstr "" -#: lib/rpminstall.c:351 +#: lib/rpminstall.c:417 #, c-format msgid "found %d source and %d binary packages\n" msgstr "" -#: lib/rpminstall.c:362 +#: lib/rpminstall.c:428 msgid "failed dependencies:\n" msgstr "" -#: lib/rpminstall.c:380 +#: lib/rpminstall.c:449 msgid "installing binary packages\n" msgstr "" -#: lib/rpminstall.c:479 +#: lib/rpminstall.c:548 #, c-format msgid "\"%s\" specifies multiple packages\n" msgstr "" -#: lib/rpminstall.c:502 +#: lib/rpminstall.c:571 msgid "removing these packages would break dependencies:\n" msgstr "" -#: lib/rpminstall.c:530 +#: lib/rpminstall.c:599 #, c-format msgid "cannot open %s: %s\n" msgstr "" -#: lib/rpminstall.c:536 +#: lib/rpminstall.c:605 #, c-format msgid "Installing %s\n" msgstr "" diff --git a/python/Makefile.in b/python/Makefile.in index b9eb16ad0..3689ec5cf 100644 --- a/python/Makefile.in +++ b/python/Makefile.in @@ -74,6 +74,8 @@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ DATADIRNAME = @DATADIRNAME@ DBLIBOBJS = @DBLIBOBJS@ DLLTOOL = @DLLTOOL@ diff --git a/scripts/Makefile.in b/scripts/Makefile.in deleted file mode 100644 index ba82bd3ba..000000000 --- a/scripts/Makefile.in +++ /dev/null @@ -1,309 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Makefile for rpm scripts. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_alias = @build_alias@ -build_triplet = @build@ -host_alias = @host_alias@ -host_triplet = @host@ -target_alias = @target_alias@ -target_triplet = @target@ -AR = @AR@ -AS = @AS@ -AWK = @AWK@ -BUILD_RPMNLSTOOLS = @BUILD_RPMNLSTOOLS@ -BZIP2BIN = @BZIP2BIN@ -CATALOGS = @CATALOGS@ -CATOBJEXT = @CATOBJEXT@ -CC = @CC@ -CPP = @CPP@ -CSCOPE = @CSCOPE@ -CTAGS = @CTAGS@ -DATADIRNAME = @DATADIRNAME@ -DBLIBOBJS = @DBLIBOBJS@ -DLLTOOL = @DLLTOOL@ -FINDPROVIDES = @FINDPROVIDES@ -FINDREQUIRES = @FINDREQUIRES@ -FIXPERMS = @FIXPERMS@ -GENCAT = @GENCAT@ -GMOFILES = @GMOFILES@ -GMSGFMT = @GMSGFMT@ -GT_NO = @GT_NO@ -GT_YES = @GT_YES@ -GZIPBIN = @GZIPBIN@ -INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ -INCPATH = @INCPATH@ -INSTOBJEXT = @INSTOBJEXT@ -INTLDEPS = @INTLDEPS@ -INTLLIBS = @INTLLIBS@ -INTLOBJS = @INTLOBJS@ -LDFLAGS_STATIC = @LDFLAGS_STATIC@ -LIBDIR = @LIBDIR@ -LIBMISC = @LIBMISC@ -LIBOBJS = @LIBOBJS@ -LIBRPMALIAS_FILENAME = @LIBRPMALIAS_FILENAME@ -LIBRPMRC_FILENAME = @LIBRPMRC_FILENAME@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LOCALEDIR = @LOCALEDIR@ -MACROFILES = @MACROFILES@ -MAKEINFO = @MAKEINFO@ -MKDIR = @MKDIR@ -MKDIR_P = @MKDIR_P@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -MSGFMT = @MSGFMT@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -PGPBIN = @PGPBIN@ -POFILES = @POFILES@ -POSUB = @POSUB@ -RANLIB = @RANLIB@ -ROOT_GROUP = @ROOT_GROUP@ -RPM = @RPM@ -RPMCANONARCH = @RPMCANONARCH@ -RPMCANONOS = @RPMCANONOS@ -RPMCANONVENDOR = @RPMCANONVENDOR@ -RPMCONFIGDIR = @RPMCONFIGDIR@ -SYSCONFIGDIR = @SYSCONFIGDIR@ -TOP_SOURCEDIR = @TOP_SOURCEDIR@ -U = @U@ -USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ -USE_NLS = @USE_NLS@ -VERSION = @VERSION@ -__CAT = @__CAT@ -__CHGRP = @__CHGRP@ -__CHGRP_RHF = @__CHGRP_RHF@ -__CHMOD = @__CHMOD@ -__CHOWN = @__CHOWN@ -__CHOWN_RHF = @__CHOWN_RHF@ -__CP = @__CP@ -__CPIO = @__CPIO@ -__GREP = @__GREP@ -__ID = @__ID@ -__ID_U = @__ID_U@ -__INSTALL = @__INSTALL@ -__LD = @__LD@ -__MAKE = @__MAKE@ -__MKDIR = @__MKDIR@ -__MV = @__MV@ -__NM = @__NM@ -__OBJCOPY = @__OBJCOPY@ -__OBJDUMP = @__OBJDUMP@ -__PATCH = @__PATCH@ -__PERL = @__PERL@ -__RM = @__RM@ -__RSH = @__RSH@ -__SED = @__SED@ -__SSH = @__SSH@ -__STRIP = @__STRIP@ -__TAR = @__TAR@ -l = @l@ -libdb1 = @libdb1@ -libdb2 = @libdb2@ -libdb3 = @libdb3@ -testdir = @testdir@ -tmpdir = @tmpdir@ -varprefix = @varprefix@ - -AUTOMAKE_OPTIONS = 1.4 foreign - -EXTRA_DIST = brp-compress brp-redhat brp-strip brp-strip-comment-note brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh find-prov.pl find-req.pl cpanflute find-provides.perl find-requires.perl get_magic.pl getpo.sh http.req magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh vpkg-provides.sh vpkg-provides2.sh - - -installprefix = $(DESTDIR) - -configdir = ${prefix}/lib/rpm -config_SCRIPTS = brp-compress brp-redhat brp-strip brp-strip-comment-note brp-sparc64-linux check-prereqs convertrpmrc.sh find-lang.sh find-prov.pl find-req.pl cpanflute find-provides.perl find-requires.perl get_magic.pl getpo.sh http.req magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi u_pkg.sh vpkg-provides.sh vpkg-provides2.sh - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = brp-redhat -SCRIPTS = $(config_SCRIPTS) - -DIST_COMMON = Makefile.am Makefile.in brp-redhat.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -brp-redhat: $(top_builddir)/config.status brp-redhat.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -install-configSCRIPTS: $(config_SCRIPTS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(configdir) - @list='$(config_SCRIPTS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(configdir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $$p $(DESTDIR)$(configdir)/`echo $$p|sed '$(transform)'`; \ - else if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(configdir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(configdir)/`echo $$p|sed '$(transform)'`; \ - else :; fi; fi; \ - done - -uninstall-configSCRIPTS: - @$(NORMAL_UNINSTALL) - list='$(config_SCRIPTS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(configdir)/`echo $$p|sed '$(transform)'`; \ - done -tags: TAGS -TAGS: - - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = scripts - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign scripts/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: install-configSCRIPTS -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-configSCRIPTS -uninstall: uninstall-am -all-am: Makefile $(SCRIPTS) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(configdir) - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-generic clean-am - -rm -f libtool - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: uninstall-configSCRIPTS install-configSCRIPTS tags distdir \ -info-am info dvi-am dvi check check-am installcheck-am installcheck \ -install-exec-am install-exec install-data-am install-data install-am \ -install uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -all: - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: |