diff --git a/ps_mem.py b/ps_mem.py old mode 100755 new mode 100644 index 04d2a19..8e30bce --- a/ps_mem.py +++ b/ps_mem.py @@ -36,7 +36,7 @@ # Patch from patrice.bouchand.fedora@gmail.com # V1.9 20 Feb 2008 Fix invalid values reported when PSS is available. # Reported by Andrey Borzenkov -# V3.5 29 Sep 2015 +# V3.6 16 Oct 2015 # http://github.com/pixelb/scripts/commits/master/scripts/ps_mem.py # Notes: @@ -438,9 +438,8 @@ def print_memory_usage(sorted_cmds, shareds, count, total): def verify_environment(): if os.geteuid() != 0: sys.stderr.write("Sorry, root permission required.\n") - if __name__ == '__main__': - sys.stderr.close() - sys.exit(1) + sys.stderr.close() + sys.exit(1) try: kv = kernel_ver() @@ -454,7 +453,7 @@ def verify_environment(): else: raise -if __name__ == '__main__': +def main(): split_args, pids_to_show, watch, only_total = parse_options() verify_environment() @@ -490,3 +489,5 @@ if __name__ == '__main__': vm_accuracy = shared_val_accuracy() show_shared_val_accuracy( vm_accuracy, only_total ) + +if __name__ == '__main__': main() diff --git a/ps_mem.spec b/ps_mem.spec index ef4153a..0901743 100644 --- a/ps_mem.spec +++ b/ps_mem.spec @@ -1,20 +1,18 @@ Name: ps_mem -Version: 3.5 -Release: 2%{?dist} +Version: 3.6 +Release: 1%{?dist} Summary: Memory profiling tool Group: Applications/System License: LGPLv2 URL: https://github.com/pixelb/ps_mem -Source0: https://raw.github.com/pixelb/ps_mem/7e295aec/ps_mem.py +Source0: https://raw.githubusercontent.com/pixelb/ps_mem/c80287d/ps_mem.py Source1: http://www.gnu.org/licenses/lgpl-2.1.txt Source2: ps_mem.1 BuildArch: noarch -Requires: python - %description The ps_mem tool reports how much core memory is used per program @@ -31,8 +29,8 @@ cp -p %{SOURCE0} %{name} cp -p %{SOURCE1} LICENSE cp -p %{SOURCE2} %{name}.1 -# use system default python -sed -i "s|/usr/bin/env python|%{__python}|" %{name} +# use python3 +sed -i "s|/usr/bin/env python|%{__python3}|" %{name} touch -r %{SOURCE0} %{name} @@ -48,6 +46,10 @@ install -Dpm644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 %changelog +* Wed Jun 08 2016 Lumir Balhar - 3.6-1 +- Latest upstream release +- Package ported to Python3 with dependencies + * Thu Feb 04 2016 Fedora Release Engineering - 3.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild