From owner-p4-projects@FreeBSD.ORG Tue Aug 26 19:51:56 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8779E1065675; Tue, 26 Aug 2008 19:51:56 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 288131065672 for ; Tue, 26 Aug 2008 19:51:56 +0000 (UTC) (envelope-from andenore@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 06E3A8FC15 for ; Tue, 26 Aug 2008 19:51:56 +0000 (UTC) (envelope-from andenore@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7QJptrQ003725 for ; Tue, 26 Aug 2008 19:51:55 GMT (envelope-from andenore@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7QJpt3b003723 for perforce@freebsd.org; Tue, 26 Aug 2008 19:51:55 GMT (envelope-from andenore@FreeBSD.org) Date: Tue, 26 Aug 2008 19:51:55 GMT Message-Id: <200808261951.m7QJpt3b003723@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andenore@FreeBSD.org using -f From: Anders Nore To: Perforce Change Reviews Cc: Subject: PERFORCE change 148544 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Aug 2008 19:51:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=148544 Change 148544 by andenore@andenore_laptop on 2008/08/26 19:51:46 Fixed problem with large packages download status in url.c Affected files ... .. //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/CHANGES#13 edit .. //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/delete/perform.c#7 edit .. //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/info/show.c#10 edit .. //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/lib/plist.c#12 edit .. //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/lib/url.c#7 edit Differences ... ==== //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/CHANGES#13 (text+ko) ==== @@ -52,7 +52,7 @@ - A @comment DATE:YYYY-MM-DD hh:mm:ss has been added (affects add/create/info/lib) -Fixed bugs in -CURRENT: +Fixed bugs which exists in -CURRENT and possibly earlier versions: - Fixed a bug with the oldstyle -W handling of empty @cwd's, which leads to a number of files installed by packages not beeing recognized. - pkg_add -r of two packages (or more I assume) where the first depends on ==== //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/delete/perform.c#7 (text+ko) ==== @@ -41,7 +41,7 @@ struct reqr_by_head *rb_list; if (MatchType != MATCH_EXACT) { - matched = matchinstalled(MatchType, pkgs, &errcode); + matched = matchinstalled(MatchType * (DateMatch ? 10 : 1), pkgs, &errcode); if (errcode != 0) return 1; ==== //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/info/show.c#10 (text+ko) ==== @@ -198,6 +198,10 @@ "\tPackage origin: %s\n", p->name); break; + case PLIST_DATE: + printf(Quiet ? "$comment DATE:%s\n" : "\tInstalldate: %s", p->name); + break; + default: cleanup(0); errx(2, "%s: unknown command type %d (%s)", ==== //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/lib/plist.c#12 (text+ko) ==== @@ -271,7 +271,7 @@ void read_plist(Package *pkg, FILE *fp) { - char *cp, date[20], time[20], pline[FILENAME_MAX]; + char *cp, pline[FILENAME_MAX]; int cmd, major, minor; pkg->fmtver_maj = 1; ==== //depot/projects/soc2008/andenore_pkginstall/src/usr.sbin/pkg_install/lib/url.c#7 (text+ko) ==== @@ -37,7 +37,7 @@ char * fileGetURL(const char *base, const char *spec, int keep_package) { - char *cp, *rp, *tmp; + char *cp, *rp, *tmp, *strippedName; char fname[FILENAME_MAX]; char pen[FILENAME_MAX]; char pkg[FILENAME_MAX]; @@ -51,9 +51,10 @@ Boolean gotStat = FALSE; struct timeval oldtime, newtime; struct ttysize ws; - int cols = 80, dspeed = 0, acc = 0, fileSize, count=0; + int cols = 80, dspeed = 0, acc = 0; + off_t count = 0, fileSize = 0; double time = 0; - char tmpString[512]; + char tmpString[512], sFileSize[10]; bzero(&oldtime, sizeof(oldtime)); @@ -121,7 +122,8 @@ warn("Error: Could not get filestat for url: %s", fname); } else { gotStat = TRUE; - fileSize = (int)ustat.size; + fileSize = ustat.size; + snprintf(sFileSize, sizeof(sFileSize), "%s", (char *)getHumanReadable(fileSize)); } if ((ftp = fetchGetURL(fname, Verbose ? "v" : NULL)) == NULL) { @@ -132,7 +134,7 @@ if (isatty(0) || Verbose) { printf("Fetching %s from %s...\n", - gotStat ? (char *)getHumanReadable(fileSize) : "", fname); + gotStat ? sFileSize : "", fname); fflush(stdout); } pen[0] = '\0'; @@ -197,16 +199,14 @@ count += r; acc += r; - char *strippedName = strrchr(fname, '/'); - char progress[64]; - + strippedName = strrchr(fname, '/'); if (strippedName) strippedName++; - snprintf(progress, sizeof(progress), "%s", (char *)getHumanReadable(count)); - int perc = (int)count*100 / fileSize; + + int perc = (count*100) / fileSize; snprintf(tmpString, sizeof(tmpString), "%3i%% of %*s %*sps", - gotStat ? perc : 100, 9, progress, 9, + gotStat ? perc : 100, 9, sFileSize, 9, (char *)getHumanReadable(dspeed ? dspeed : acc)); if (isatty(0) || Verbose)