Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
c8f819d77d
!13 License compliance rectification
From: @hongjinghao 
Reviewed-by: @licunlong 
Signed-off-by: @licunlong
2022-10-25 02:38:16 +00:00
hongjinghao
47fdff0330 License compliance rectification 2022-10-25 09:23:40 +08:00
openeuler-ci-bot
aa6081c712
!10 添加sw架构
From: @wuzx065891 
Reviewed-by: @overweight 
Signed-off-by: @overweight
2022-07-25 02:50:35 +00:00
wzx
17735e102e sw 2022-07-22 16:56:54 +08:00
openeuler-ci-bot
18d040be61
!6 [sync] PR-4: 命令行添加帮助选项
From: @openeuler-sync-bot 
Reviewed-by: @overweight 
Signed-off-by: @overweight
2022-03-31 13:55:35 +00:00
Lv Genggeng
35137ab5b9 add help opt cmdline
Signed-off-by: Lv Genggeng <lvgenggeng@uniontech.com>
(cherry picked from commit 8041797958a159f6d01369a9011b2db3987721bf)
2022-03-31 10:39:51 +08:00
openeuler-ci-bot
099ff388bc !2 add yaml file in package
Merge pull request !2 from Markeryang/master
2020-06-18 15:04:48 +08:00
Markeryang
cb120f8bc3 add time.yaml. 2020-06-16 17:55:45 +08:00
openeuler-ci-bot
dc8b84701a !1 time
Merge pull request !1 from syyhao/init
2020-01-09 09:51:41 +08:00
openeuler-basic
f9baf10993 remove unnecessary files 2020-01-08 16:54:18 +08:00
7 changed files with 104 additions and 185 deletions

View File

@ -1,36 +0,0 @@
src/time.c: GPLv3+
COPYING: GPLv3 text
doc/time.texi: GFDL
doc/fdl.texi: GFDL 1.3 text
doc/time.info: GFDL
lib/stdnoreturn.in.h: GPLv3+
lib/strerror-override.c: GPLv3+
lib/error.h: GPLv3+
Not in a binary package
tests/init.sh: GPLv3+
INSTALL: FSFAP
configure: FSFUL
build-aux/config.guess: GPLv3+ with exceptions
build-aux/install-sh: MIT and Public Domain
build-aux/config.rpath: FSFULLR
build-aux/test-driver: GPLv2+ with exceptions
build-aux/update-copyright: GPLv3+
build-aux/useless-if-before-free: GPLv3+
build-aux/vc-list-files: GPLv3+
build-aux/missing: GPLv2+ with exceptions
build-aux/compile: GPLv2+ with exceptions
build-aux/config.sub: GPLv3+ with exceptions
build-aux/gitlog-to-changelog: GPLv3+
build-aux/git-version-gen: GPLv3+
build-aux/texinfo.tex: GPLv3+ with exceptions
build-aux/depcomp: GPLv2+ with exceptions
build-aux/mdate-sh: GPLv2+ with exceptions
GNUmakefile: GPLv3+
m4/asm-underscore.m4: FSFULLR
m4/gnulib-cache.m4: GPLv3+ with exceptions
m4/host-cpu-c-abi.m4: FSFULLR
m4/longlong.m4: FSFULLR
m4/ssize_t.m4: FSFULLR
m4/stdnoreturn.m4: FSFULLR
maint.mk: GPLv3+
tests/time-posix-quiet.sh: GPLv3+

13
add-help-opt.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/time.c b/src/time.c
index 7e07995..231e8cb 100644
--- a/src/time.c
+++ b/src/time.c
@@ -657,7 +657,7 @@ getargs (argc, argv)
if (format)
output_format = format;
- while ((optc = getopt_long (argc, argv, "+af:o:pqvV", longopts, (int *) 0))
+ while ((optc = getopt_long (argc, argv, "+af:ho:pqvV", longopts, (int *) 0))
!= EOF)
{
switch (optc)

View File

@ -1,108 +0,0 @@
From a3c400a8553b598bc2fd01eb0f63c5748b2147e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 8 Nov 2017 17:02:42 +0100
Subject: [PATCH] Prefer clock_gettime(CLOCK_MONOTONIC)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
gettimeofday() reports wrong elapsed real time if a time step was
inserted while running a program. This can happen on initial time
adjustment from NTP server or by manual adjustement by date command.
This patch uses clock_gettime(CLOCK_MONOTONIC) instead (if available)
that does not suffer from the issue.
<http://lists.gnu.org/archive/html/bug-gnu-utils/2013-09/msg00008.html>
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
configure.ac | 3 +++
src/resuse.c | 27 +++++++++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index ede8fd5..d2950bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,9 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
AC_CHECK_FUNCS(strerror)
+AC_SEARCH_LIBS(clock_gettime, [rt])
+test "$ac_cv_search_clock_gettime" != "no" && \
+ AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [System provides clock_gettime() call])
# What memory units are reported by getrusage(2) ?
diff --git a/src/resuse.c b/src/resuse.c
index d2ab870..ec54863 100644
--- a/src/resuse.c
+++ b/src/resuse.c
@@ -26,7 +26,14 @@
#include <sys/wait.h>
#include <sys/resource.h>
-#if !HAVE_WAIT3
+#if HAVE_WAIT3
+# if HAVE_CLOCK_GETTIME
+# ifndef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 199309L
+# endif
+# include <time.h>
+# endif
+#else
# include <sys/times.h>
# ifndef HZ
# include <sys/param.h>
@@ -51,7 +58,14 @@ resuse_start (resp)
RESUSE *resp;
{
#if HAVE_WAIT3
+#if HAVE_CLOCK_GETTIME
+ struct timespec res;
+ clock_gettime(CLOCK_MONOTONIC, &res);
+ resp->start.tv_sec = res.tv_sec;
+ resp->start.tv_usec = res.tv_nsec / 1000;
+#else
gettimeofday (&resp->start, (struct timezone *) 0);
+#endif /* !HAVE_CLOCK_GETTIME */
#else
long value;
struct tms tms;
@@ -59,7 +73,7 @@ resuse_start (resp)
value = times (&tms);
resp->start.tv_sec = value / HZ;
resp->start.tv_usec = value % HZ * (1000000 / HZ);
-#endif
+#endif /* !HAVE_WAIT3 */
}
/* Wait for and fill in data on child process PID.
@@ -79,6 +93,9 @@ resuse_end (pid, resp)
int status;
#if HAVE_WAIT3
+#if HAVE_CLOCK_GETTIME
+ struct timespec res;
+#endif
pid_t caught;
/* Ignore signals, but don't ignore the children. When wait3
@@ -89,7 +106,13 @@ resuse_end (pid, resp)
return 0;
}
+#if HAVE_CLOCK_GETTIME
+ clock_gettime(CLOCK_MONOTONIC, &res);
+ resp->elapsed.tv_sec = res.tv_sec;
+ resp->elapsed.tv_usec = res.tv_nsec / 1000;
+#else
gettimeofday (&resp->elapsed, (struct timezone *) 0);
+#endif
#else /* !HAVE_WAIT3 */
long value;
struct tms tms;
--
2.13.6

View File

@ -1,32 +0,0 @@
From d8cf31417c84646497657280830c432b6f412495 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 18 Jun 2018 10:05:06 +0200
Subject: [PATCH] Improve info directory index entry description
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Describing "time" as "time" is not explanatory. Use better
description.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
doc/time.texi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/time.texi b/doc/time.texi
index 63d25b4..dac65b4 100644
--- a/doc/time.texi
+++ b/doc/time.texi
@@ -28,7 +28,7 @@ Texts. A copy of the license is included in the section entitled
@dircategory Basics
@direntry
-* Time: (time). time
+* Time: (time). GNU time utility.
@end direntry
--
2.14.4

65
time-1.9-sw.patch Executable file
View File

@ -0,0 +1,65 @@
diff -Naur time-1.9.org/config.in time-1.9.sw/config.in
--- time-1.9.org/config.in 2022-02-28 08:27:55.070000000 +0000
+++ time-1.9.sw/config.in 2022-02-28 08:31:36.570000000 +0000
@@ -13,6 +13,9 @@
#ifndef __alpha__
#undef __alpha__
#endif
+#ifndef __sw_64__
+#undef __sw_64__
+#endif
#ifndef __arm__
#undef __arm__
#endif
diff -Naur time-1.9.org/configure time-1.9.sw/configure
--- time-1.9.org/configure 2022-02-28 08:27:55.060000000 +0000
+++ time-1.9.sw/configure 2022-02-28 08:33:43.010000000 +0000
@@ -7989,6 +7989,10 @@
gl_cv_host_cpu_c_abi=alpha
;;
+ sw_64* )
+ gl_cv_host_cpu_c_abi=sw_64
+ ;;
+
arm* | aarch64 )
# Assume arm with EABI.
# On arm64 systems, the C compiler may be generating code in one of
diff -Naur time-1.9.org/lib/unistd.in.h time-1.9.sw/lib/unistd.in.h
--- time-1.9.org/lib/unistd.in.h 2022-02-28 08:27:55.070000000 +0000
+++ time-1.9.sw/lib/unistd.in.h 2022-02-28 08:30:24.650000000 +0000
@@ -871,7 +871,7 @@
# endif
/* This is for older VMS. */
# if !defined _gl_getpagesize && defined __VMS
-# ifdef __ALPHA
+# ifdef __ALPHA || defined __SW_64
# define _gl_getpagesize() 8192
# else
# define _gl_getpagesize() 512
diff -Naur time-1.9.org/m4/host-cpu-c-abi.m4 time-1.9.sw/m4/host-cpu-c-abi.m4
--- time-1.9.org/m4/host-cpu-c-abi.m4 2022-02-28 08:27:55.090000000 +0000
+++ time-1.9.sw/m4/host-cpu-c-abi.m4 2022-02-28 08:36:06.690000000 +0000
@@ -96,6 +96,12 @@
gl_cv_host_cpu_c_abi=alpha
;;
+changequote(,)dnl
+ sw_64* )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=sw_64
+ ;;
+
arm* | aarch64 )
# Assume arm with EABI.
# On arm64 systems, the C compiler may be generating code in one of
@@ -304,6 +310,9 @@
#ifndef __alpha__
#undef __alpha__
#endif
+#ifndef __sw_64__
+#undef __sw_64__
+#endif
#ifndef __arm__
#undef __arm__
#endif

View File

@ -1,14 +1,12 @@
Name: time
Version: 1.9
Release: 6
Release: 10
Summary: Monitoring the system resources used by running program
License: GPLv3+ and GFDL
License: GPLv3+ and GFDL-1.3-or-later
URL: http://www.gnu.org/software/%{name}/
Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz
Source1: LicenseList
Patch0: time-1.8-Prefer-clock_gettime-CLOCK_MONOTONIC.patch
Patch1: time-1.9-Improve-info-directory-index-entry-description.patch
Patch0: add-help-opt.patch
Patch1: time-1.9-sw.patch
BuildRequires: autoconf automake bash coreutils gcc make texinfo sed
@ -19,9 +17,6 @@ collected by the system while the program was running.
%package_help
%description help
This package contains the document for %{name}
%prep
%autosetup -n %{name}-%{version} -p1
@ -46,5 +41,23 @@ make check %{?_smp_mflags}
%{_infodir}/time.info*
%changelog
* Tue Oct 25 2022 hongjinghao<hongjinghao@huawei.com> - 1.9.10
- License compliance rectification
* Wed Jul 20 2022 wuzx<wuzx1226@qq.com> - 1.9-9
- add sw64 patch
* Tue Mar 22 2022 Lv Genggeng <lvgenggeng@uniontech.com> - 1.9-8
- Type: enhancement
- ID: NA
- SUG: NA
- DESC: add help opt in cmdline
* Wed Jan 8 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.9-7
- Type: enhancement
- ID: NA
- SUG: NA
- DESC: remove unnecessary files
* Wed Aug 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.9-6
- Package init

4
time.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: git
src_repo: https://git.savannah.gnu.org/git/time.git
tag_prefix: ^v
seperator: .