.
OBS-URL: https://build.opensuse.org/package/show/Base:System/procps?expand=0&rev=158
This commit is contained in:
parent
28d00ee5ec
commit
ae3dca39dd
@ -1,6 +1,7 @@
|
||||
---
|
||||
pmap.c | 50 +++++++++++++++++++++++++++++++++++++-------------
|
||||
1 file changed, 37 insertions(+), 13 deletions(-)
|
||||
pmap.c | 50 +++++++++++++++++++++++++++++++------------
|
||||
testsuite/pmap.test/pmap.exp | 17 ++++++--------
|
||||
2 files changed, 45 insertions(+), 22 deletions(-)
|
||||
|
||||
--- pmap.c
|
||||
+++ pmap.c 2016-05-30 11:36:45.447592219 +0000
|
||||
@ -163,3 +164,56 @@
|
||||
break;
|
||||
case 'q':
|
||||
q_option = 1;
|
||||
--- testsuite/pmap.test/pmap.exp
|
||||
+++ testsuite/pmap.test/pmap.exp 2016-07-12 15:12:26.592609617 +0000
|
||||
@@ -8,16 +8,16 @@ set pmap_procname "${mypid}:\\s+\\S+\[^\
|
||||
set pmap_initname "1:\\s+\\S+\[^\\r\]+\\s+"
|
||||
set pmap_std_header $pmap_procname
|
||||
set pmap_device_header "${pmap_procname}Address\\s+Kbytes\\s+Mode\\s+Offset\\s+Device\\s+Mapping\\s+"
|
||||
-set pmap_ext_header "${pmap_procname}Address\\s+Kbytes\\s+RSS\\s+Dirty\\s+Mode\\s+Mapping\\s+"
|
||||
+set pmap_ext_header "${pmap_procname}Address\\s+Kbytes\\s+RSS\\s+PSS\\s+Dirty\\s+Swap\\s+Mode\\s+Mapping\\s+"
|
||||
set pmap_generic_header "${pmap_procname}\\s+\(?:\[A-Z\]\[a-z\]+ +\)+"
|
||||
|
||||
-set pmap_std_items "\(\[0-9a-f\]+\\s+\\d+K \[rwx-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
|
||||
-set pmap_device_items "\(\[0-9a-f\]+\\s+\\d+ \[rwx-\]{5}\\s+\[0-9a-f\]+\\s+\[0-9a-f\]{3}:\[0-9a-f\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
|
||||
-set pmap_ext_items "\(\[0-9a-f\]+\\s+\\d+\\s+\\d+\\s+\\d+ \[rwx-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
|
||||
+set pmap_std_items "\(\[0-9a-f\]+\\s+\\d+K \[rwxp-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
|
||||
+set pmap_device_items "\(\[0-9a-f\]+\\s+\\d+ \[rwxp-\]{5}\\s+\[0-9a-f\]+\\s+\[0-9a-f\]{3}:\[0-9a-f\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
|
||||
+set pmap_ext_items "\(\[0-9a-f\]+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+ \[rwxp-\]{5}\\s+\\S+\[^\\r\]+\\s*\)+"
|
||||
|
||||
set pmap_std_footer "total\\s+\\d+K\\s*\$"
|
||||
set pmap_device_footer "mapped:\\s+\\d+K\\s+writeable\/private:\\s+\\d+K\\s+shared:\\s+\\d+K\\s*\$"
|
||||
-set pmap_ext_footer "\[ -\]+\\s+total kB\\s+\\d+(\\s+\[\\d-\]+){2,3}\\s*\$"
|
||||
+set pmap_ext_footer "total kB\\s+\\d+(\\s+\[\\d-\]+){4,5}\\s*\$"
|
||||
|
||||
set test "pmap with no arguments"
|
||||
spawn $pmap
|
||||
@@ -26,17 +26,16 @@ expect_pass "$test" "Usage:\\s+\(lt-\)?p
|
||||
|
||||
set test "pmap standard output"
|
||||
spawn $pmap $mypid
|
||||
-expect_table $test $pmap_std_header $pmap_std_items $pmap_std_footer
|
||||
+expect_table $test $pmap_ext_header $pmap_ext_items $pmap_ext_footer
|
||||
|
||||
set test "pmap standard output with quiet"
|
||||
spawn $pmap -q $mypid
|
||||
-expect_table $test $pmap_procname $pmap_std_items "\$"
|
||||
+expect_table $test $pmap_procname $pmap_ext_items "\$"
|
||||
|
||||
set test "pmap device output"
|
||||
spawn $pmap -d $mypid
|
||||
expect_table $test $pmap_device_header $pmap_device_items $pmap_device_footer
|
||||
|
||||
-
|
||||
set test "pmap device output quiet (dq)"
|
||||
spawn $pmap -dq $mypid
|
||||
expect_table $test $pmap_procname $pmap_device_items "\$"
|
||||
@@ -47,7 +46,7 @@ expect_table $test $pmap_procname $pmap_
|
||||
|
||||
set test "pmap extended output"
|
||||
spawn $pmap -x $mypid
|
||||
-expect_table $test $pmap_ext_header $pmap_ext_items $pmap_ext_footer
|
||||
+expect_table $test $pmap_std_header $pmap_std_items $pmap_std_footer
|
||||
|
||||
# -X and -XX have no real format as its dependent on smaps
|
||||
set test "pmap extra extended output"
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 12 16:01:19 UTC 2016 - werner@suse.de
|
||||
|
||||
- Use test suite but avoid the w command due dummy utmp
|
||||
* This requires dejagnu for the runtest command
|
||||
* This requires screen to be able to provide a tty
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 11 13:28:02 UTC 2016 - werner@suse.de
|
||||
|
||||
|
74
procps.spec
74
procps.spec
@ -25,6 +25,7 @@ Name: procps
|
||||
#Also: http://gitorious.org/procps/
|
||||
Url: http://sf.net/projects/procps-ng/
|
||||
BuildRequires: automake
|
||||
BuildRequires: dejagnu
|
||||
%ifarch ia64 x86_64 ppc64 ppc %sparc
|
||||
BuildRequires: libnuma-devel
|
||||
%endif
|
||||
@ -39,6 +40,7 @@ BuildRequires: pkgconfig(libsystemd-login)
|
||||
BuildRequires: pkgconfig(libsystemd)
|
||||
%endif
|
||||
%endif
|
||||
BuildRequires: screen
|
||||
BuildRequires: xz
|
||||
Version: 3.3.12
|
||||
Release: 0
|
||||
@ -146,6 +148,9 @@ the process information pseudo-file system,
|
||||
%patch33
|
||||
|
||||
%build
|
||||
#
|
||||
#
|
||||
#
|
||||
test -s .tarball-version || echo %{version} > .tarball-version
|
||||
#./autogen.sh
|
||||
autoreconf
|
||||
@ -182,6 +187,7 @@ export LFS_CFLAGS="$(getconf LFS_CFLAGS)"
|
||||
--disable-modern-top
|
||||
make %{?_smp_mflags}
|
||||
|
||||
LD_LIBRARY_PATH=$PWD/proc/.libs \
|
||||
./pmap $$ || {
|
||||
uname -a
|
||||
echo /proc/$$/maps
|
||||
@ -211,6 +217,23 @@ rm -f %{buildroot}%{_libdir}/*.la
|
||||
rm -rf %{buildroot}%{_datadir}/doc/procps-ng
|
||||
|
||||
%if %{with bin2usr}
|
||||
#
|
||||
# Identical binaries
|
||||
#
|
||||
if cmp -s %{buildroot}/%{_bindir}/pgrep %{buildroot}/%{_bindir}/pkill
|
||||
then
|
||||
rm -vf %{buildroot}/%{_bindir}/pkill
|
||||
pushd %{buildroot}/%{_bindir}
|
||||
ln pgrep pkill
|
||||
popd
|
||||
fi
|
||||
if cmp -s %{buildroot}/%{_bindir}/snice %{buildroot}/%{_bindir}/skill
|
||||
then
|
||||
rm -vf %{buildroot}/%{_bindir}/skill
|
||||
pushd %{buildroot}/%{_bindir}
|
||||
ln snice skill
|
||||
popd
|
||||
fi
|
||||
ln -s %{_bindir}/ps %{buildroot}/bin/
|
||||
ln -s %{_bindir}/pgrep %{buildroot}/bin/
|
||||
ln -s %{_bindir}/pkill %{buildroot}/bin/
|
||||
@ -220,6 +243,23 @@ mv %{buildroot}%{_bindir}/ps %{buildroot}/bin/
|
||||
mv %{buildroot}%{_bindir}/pgrep %{buildroot}/bin/
|
||||
mv %{buildroot}%{_bindir}/pkill %{buildroot}/bin/
|
||||
mv %{buildroot}%{_sbindir}/sysctl %{buildroot}/sbin/
|
||||
#
|
||||
# Identical binaries
|
||||
#
|
||||
if cmp -s %{buildroot}/bin/pgrep %{buildroot}/bin/pkill
|
||||
then
|
||||
rm -vf %{buildroot}/bin/pkill
|
||||
pushd %{buildroot}/bin
|
||||
ln pgrep pkill
|
||||
popd
|
||||
fi
|
||||
if cmp -s %{buildroot}/%{_bindir}/snice %{buildroot}/%{_bindir}/skill
|
||||
then
|
||||
rm -vf %{buildroot}/%{_bindir}/skill
|
||||
pushd %{buildroot}/%{_bindir}
|
||||
ln snice skill
|
||||
popd
|
||||
fi
|
||||
ln -s /bin/ps %{buildroot}%{_bindir}/ps
|
||||
ln -s /bin/pgrep %{buildroot}%{_bindir}/pgrep
|
||||
ln -s /bin/pkill %{buildroot}%{_bindir}/pkill
|
||||
@ -239,7 +279,39 @@ ln -s /sbin/sysctl %{buildroot}%{_sbindir}/sysctl
|
||||
%postun -n %{libname} -p /sbin/ldconfig
|
||||
|
||||
%check
|
||||
make check
|
||||
#
|
||||
# Skip w test as there is no valid utmp
|
||||
#
|
||||
rm -rvf testsuite/w.test
|
||||
#
|
||||
# Provide a tty for testing
|
||||
#
|
||||
LANG=POSIX
|
||||
LC_ALL=$LANG
|
||||
unset LC_CTYPE
|
||||
SCREENDIR=$(mktemp -d ${PWD}/screen.XXXXXX) || exit 1
|
||||
SCREENRC=${SCREENDIR}/bash
|
||||
export SCREENRC SCREENDIR
|
||||
exec 0< /dev/null
|
||||
SCREENLOG=${SCREENDIR}/log
|
||||
cat > $SCREENRC<<-EOF
|
||||
deflogin off
|
||||
logfile $SCREENLOG
|
||||
logfile flush 1
|
||||
logtstamp off
|
||||
log on
|
||||
setsid on
|
||||
scrollback 0
|
||||
silence on
|
||||
utf8 on
|
||||
EOF
|
||||
TMPDIR=$(mktemp -d /tmp/bash.XXXXXXXXXX) || exit 1
|
||||
> $SCREENLOG
|
||||
tail -q -s 0.5 -f $SCREENLOG & pid=$!
|
||||
env HOME=$PWD TERM=$TERM TMPDIR=$TMPDIR SCREENRC=$SCREENRC SCREENDIR=$SCREENDIR \
|
||||
screen -L -D -m make check
|
||||
kill -TERM $pid
|
||||
grep -E '^(XFAIL|FAIL|ERROR):' testsuite/*.log && exit 1
|
||||
|
||||
%files
|
||||
%defattr (-,root,root,755)
|
||||
|
Loading…
Reference in New Issue
Block a user