diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d2f36f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/time-1.7.tar.gz diff --git a/.time.metadata b/.time.metadata new file mode 100644 index 0000000..0470783 --- /dev/null +++ b/.time.metadata @@ -0,0 +1 @@ +dde0c28c7426960736933f3e763320680356cc6a SOURCES/time-1.7.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index ce46a88..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -\ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch b/SOURCES/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch new file mode 100644 index 0000000..008f46c --- /dev/null +++ b/SOURCES/time-1.7-Recompute-CPU-usage-at-microsecond-level.patch @@ -0,0 +1,72 @@ +From 0d743a7d946fe176a07baf2586a6af0e867fd89c Mon Sep 17 00:00:00 2001 +From: H.J. Lu +Date: Wed, 11 May 2011 16:19:55 +0200 +Subject: [PATCH] Recompute CPU usage at microsecond level + +If job finishes quickly, miliseconds arithmetic rounds to zero. If +that happens, recalculate CPU usage ratio with microsecond accuracy +to raise chance to get non-zero values. +--- + resuse.h | 2 ++ + time.c | 15 +++++++++++++++ + 2 files changed, 17 insertions(+), 0 deletions(-) + +diff --git a/resuse.h b/resuse.h +index 992143f..7a3ee66 100644 +--- a/resuse.h ++++ b/resuse.h +@@ -33,9 +33,11 @@ struct timeval + #if HAVE_SYS_RUSAGE_H + /* This rusage structure measures nanoseconds instead of microseconds. */ + # define TV_MSEC tv_nsec / 1000000 ++# define TV_USEC tv_nsec / 1000 + # include + #else + # define TV_MSEC tv_usec / 1000 ++# define TV_USEC tv_usec + # if HAVE_WAIT3 + # include + # else +diff --git a/time.c b/time.c +index 43aec0b..96cfdde 100644 +--- a/time.c ++++ b/time.c +@@ -326,6 +326,8 @@ summarize (fp, fmt, command, resp) + { + unsigned long r; /* Elapsed real milliseconds. */ + unsigned long v; /* Elapsed virtual (CPU) milliseconds. */ ++ unsigned long ru; /* Elapsed real microseconds. */ ++ unsigned long vu; /* Elapsed virtual (CPU) microseconds. */ + + if (verbose) + { +@@ -350,6 +352,17 @@ summarize (fp, fmt, command, resp) + v = resp->ru.ru_utime.tv_sec * 1000 + resp->ru.ru_utime.TV_MSEC + + resp->ru.ru_stime.tv_sec * 1000 + resp->ru.ru_stime.TV_MSEC; + ++ if (r == 0 && v == 0) ++ { ++ ru = resp->elapsed.tv_usec; ++ vu = resp->ru.ru_utime.TV_USEC + resp->ru.ru_stime.TV_USEC; ++ } ++ else ++ { ++ ru = 0; ++ vu = 0; ++ } ++ + while (*fmt) + { + switch (*fmt) +@@ -408,6 +421,8 @@ summarize (fp, fmt, command, resp) + /* % cpu is (total cpu time)/(elapsed time). */ + if (r > 0) + fprintf (fp, "%lu%%", (v * 100 / r)); ++ else if (ru > 0) ++ fprintf (fp, "%lu%%", (vu * 100 / ru)); + else + fprintf (fp, "?%%"); + break; +-- +1.7.4.4 + diff --git a/SOURCES/time-1.7-destdir.patch b/SOURCES/time-1.7-destdir.patch new file mode 100644 index 0000000..926ee77 --- /dev/null +++ b/SOURCES/time-1.7-destdir.patch @@ -0,0 +1,37 @@ +--- time-1.7/Makefile.in.destdir 2007-02-27 12:13:10.000000000 +0100 ++++ time-1.7/Makefile.in 2007-02-27 12:18:07.000000000 +0100 +@@ -114,10 +114,10 @@ + maintainer-clean-binPROGRAMS: + + install-binPROGRAMS: $(bin_PROGRAMS) +- $(mkinstalldirs) $(bindir) ++ $(mkinstalldirs) $(DESTDIR)/$(bindir) + list="$(bin_PROGRAMS)"; for p in $$list; do \ + if test -f $$p; then \ +- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \ ++ $(INSTALL_PROGRAM) $$p $(DESTDIR)/$(bindir)/`echo $$p|sed '$(transform)'`; \ + else :; fi; \ + done + +@@ -176,10 +176,10 @@ + TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $< + + install-info: $(INFO_DEPS) +- $(mkinstalldirs) $(infodir) ++ $(mkinstalldirs) $(DESTDIR)/$(infodir) + for file in $(INFO_DEPS); do \ + for ifile in `cd $(srcdir) && echo $$file*`; do \ +- $(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \ ++ $(INSTALL_DATA) $(srcdir)/$$ifile $(DESTDIR)/$(infodir)/$$ifile; \ + done; \ + done + +@@ -279,7 +279,7 @@ + install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install + installdirs: +- $(mkinstalldirs) $(bindir) $(infodir) ++ $(mkinstalldirs) $(DESTDIR)/$(bindir) $(DESTDIR)/$(infodir) + + + mostlyclean-generic: diff --git a/SOURCES/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch b/SOURCES/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch new file mode 100644 index 0000000..1f68f9b --- /dev/null +++ b/SOURCES/time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch @@ -0,0 +1,32 @@ +From ad24a929bdcc15abae14a64ea21b821bcd8cb030 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 11 May 2011 15:19:11 +0200 +Subject: [PATCH] ru_maxrss is in kilobytes on Linux + +Since 2.6.32 Linux returns ru_maxrss in kilobytes. Not in pages. + +See http://lists.gnu.org/archive/html/bug-gnu-utils/2008-12/msg00047.html +for discussion. +--- + time.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/time.c b/time.c +index d15fee4..43aec0b 100644 +--- a/time.c ++++ b/time.c +@@ -395,7 +395,11 @@ summarize (fp, fmt, command, resp) + ptok ((UL) resp->ru.ru_ixrss) / MSEC_TO_TICKS (v)); + break; + case 'M': /* Maximum resident set size. */ ++#ifdef __linux__ ++ fprintf (fp, "%ld", resp->ru.ru_maxrss); ++#else + fprintf (fp, "%lu", ptok ((UL) resp->ru.ru_maxrss)); ++#endif + break; + case 'O': /* Outputs. */ + fprintf (fp, "%ld", resp->ru.ru_oublock); +-- +1.7.4.4 + diff --git a/SOURCES/time-1.7-verbose.patch b/SOURCES/time-1.7-verbose.patch new file mode 100644 index 0000000..6eb012d --- /dev/null +++ b/SOURCES/time-1.7-verbose.patch @@ -0,0 +1,19 @@ +--- time-1.7/time.c.verbose Fri Jun 14 05:38:21 1996 ++++ time-1.7/time.c Sun Nov 4 16:21:09 2001 +@@ -327,6 +327,8 @@ + unsigned long r; /* Elapsed real milliseconds. */ + unsigned long v; /* Elapsed virtual (CPU) milliseconds. */ + ++ if (verbose) ++ { + if (WIFSTOPPED (resp->waitstatus)) + fprintf (fp, "Command stopped by signal %d\n", + WSTOPSIG (resp->waitstatus)); +@@ -336,6 +338,7 @@ + else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus)) + fprintf (fp, "Command exited with non-zero status %d\n", + WEXITSTATUS (resp->waitstatus)); ++ } + + /* Convert all times to milliseconds. Occasionally, one of these values + comes out as zero. Dividing by zero causes problems, so we first diff --git a/SPECS/time.spec b/SPECS/time.spec new file mode 100644 index 0000000..45b4392 --- /dev/null +++ b/SPECS/time.spec @@ -0,0 +1,202 @@ +Summary: A GNU utility for monitoring a program's use of system resources +Name: time +Version: 1.7 +Release: 45%{?dist} +License: GPLv2+ +Group: Applications/System +Url: http://www.gnu.org/software/time/ +Source: ftp://prep.ai.mit.edu/pub/gnu/%{name}/%{name}-%{version}.tar.gz +Patch0: time-1.7-destdir.patch +Patch1: time-1.7-verbose.patch +# Bug #702826 +Patch2: time-1.7-ru_maxrss-is-in-kilobytes-on-Linux.patch +# Bug #527276 +Patch3: time-1.7-Recompute-CPU-usage-at-microsecond-level.patch +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info + +%description +The GNU time utility runs another program, collects information about +the resources used by that program while it is running, and displays +the results. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 -b .ru_maxrss +%patch3 -p1 -b .recompute_cpu + +%build +echo "ac_cv_func_wait3=\${ac_cv_func_wait3='yes'}" >> config.cache +%configure +make %{?_smp_mflags} + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +%post +/sbin/install-info %{_infodir}/time.info.gz %{_infodir}/dir \ + --entry="* time: (time). GNU time Utility" >/dev/null 2>&1 || : + +%preun +if [ "$1" = 0 ]; then + /sbin/install-info --delete %{_infodir}/time.info.gz %{_infodir}/dir \ + --entry="* time: (time). GNU time Utility" >/dev/null 2>&1 || : +fi + +%files +%doc AUTHORS ChangeLog COPYING NEWS README +%{_bindir}/time +%{_infodir}/time.info* + +%changelog +* Fri Jan 24 2014 Daniel Mach - 1.7-45 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 1.7-44 +- Mass rebuild 2013-12-27 + +* Fri Feb 15 2013 Fedora Release Engineering - 1.7-43 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Sep 06 2012 Petr Pisar - 1.7-42 +- Package AUTHORS and ChangeLog + +* Sat Jul 21 2012 Fedora Release Engineering - 1.7-41 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 1.7-40 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed May 11 2011 Petr Pisar - 1.7-39 +- Fix maximal RSS report (bug #702826) +- Clean spec file +- Recompute CPU usage at finer level (bug #527276) + +* Wed Feb 09 2011 Fedora Release Engineering - 1.7-38 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Aug 11 2009 Roman Rakus - 1.7-37 +- Don't print errors in post and preun sections (#515936) + +* Sun Jul 26 2009 Fedora Release Engineering - 1.7-36 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 1.7-35 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sun Sep 21 2008 Ville Skyttä - 1.7-34 +- Fix Patch:/%%patch0 mismatch. + Resolves: #463067 + +* Tue Mar 4 2008 Roman Rakus - 1.7-33 +- Added patch from JW (redhat@zacglen.com), less nonverbose output + +* Tue Feb 19 2008 Fedora Release Engineering - 1.7-32 +- Autorebuild for GCC 4.3 + +* Tue Jan 08 2008 Florian La Roche - 1.7-31 +- update url/license tags + +* Tue Aug 21 2007 Florian La Roche - 1.7-30 +- rebuild + +* Tue Feb 27 2007 Karsten Hopp 1.7-29 +- remove trailing dot from summary +- replace tabs with spaces +- replace PreReq with Requires(post)/Requires(preun) +- include license file in %%doc +- add smp flags +- use make install DESTDIR= + +* Mon Jan 22 2007 Florian La Roche +- add dist tag +- fix rhbz#223720 + +* Wed Jul 12 2006 Jesse Keating - 1.7-27.2.2 +- rebuild + +* Fri Feb 10 2006 Jesse Keating - 1.7-27.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 1.7-27.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Wed Mar 02 2005 Karsten Hopp 1.7-27 +- build with gcc-4 + +* Wed Feb 09 2005 Karsten Hopp 1.7-26 +- update source URL +- rebuilt + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Tue Jun 17 2003 Florian La Roche +- rebuild + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Tue Nov 19 2002 Tim Powers +- rebuild on all arches + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Wed Jun 19 2002 Florian La Roche +- do not strip apps, do not compress info page + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Mon Feb 25 2002 Elliot Lee +- Remove HAVE_WAIT3 hack, tried to replace it with a requirement for an +autoconf with the fixed test, didn't work, put in another less-bad hack +instead. + +* Wed Dec 05 2001 Tom Tromey +- Bump release, force HAVE_WAIT3 to be defined at build time + +* Sun Jun 24 2001 Elliot Lee +- Bump release + rebuild. + +* Wed Jan 31 2001 Preston Brown +- prereq install-info (#24715) + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Thu Jun 29 2000 Preston Brown +- using / as the file manifesto has weird results. + +* Sun Jun 4 2000 Jeff Johnson +- FHS packaging. + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 9) + +* Mon Aug 10 1998 Erik Troan +- buildrooted and defattr'd + +* Mon Apr 27 1998 Prospector System +- translations modified for de, fr, tr + +* Mon Oct 27 1997 Cristian Gafton +- fixed info handling + +* Thu Oct 23 1997 Cristian Gafton +- updated the spec file; added info file handling + +* Mon Jun 02 1997 Erik Troan +- built against glibc