From 9a2d84d9fb95086208b38cffee0595dff0b8e0ac Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Dec 21 2015 16:55:53 +0000 Subject: 0.55.0-1: bump upstream package + generate better man pages Signed-off-by: Jan Pokorný --- diff --git a/.gitignore b/.gitignore index 58aa137..4655ec8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /clufter-*.tar.gz +/clufter-*-tests.tar.xz diff --git a/clufter.spec b/clufter.spec index f928f22..af188a0 100644 --- a/clufter.spec +++ b/clufter.spec @@ -1,5 +1,9 @@ +# versatility++ +# https://fedoraproject.org/wiki/EPEL:Packaging?rd=Packaging:EPEL#The_.25license_tag +%{!?_licensedir:%global license %doc} + Name: clufter -Version: 0.50.5 +Version: 0.55.0 Release: 1%{?dist} Group: System Environment/Base Summary: Tool/library for transforming/analyzing cluster configuration formats @@ -14,6 +18,9 @@ BuildRequires: python-setuptools BuildRequires: python-lxml Source0: https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-%{version}.tar.gz +Source1: https://people.redhat.com/jpokorny/pkgs/%{name}/%{name}-%{version}-tests.tar.xz + +Patch0: filter-get-along-without-dev-tty-that-may-not-exist.patch %description While primarily aimed at (CMAN,rgmanager)->(Corosync/CMAN,Pacemaker) cluster @@ -96,7 +103,7 @@ configuration: either experimental commands or internally unused, reusable formats and filters. %prep -%autosetup -p1 -S git +%autosetup -p1 -S git -b 1 ## for some esoteric reason, the line above has to be empty %{__python2} setup.py saveopts -f setup.cfg pkg_prepare \ @@ -109,18 +116,41 @@ formats and filters. %{__python2} setup.py build ./run-dev --skip-ext --completion-bash 2>/dev/null \ | sed 's|run[-_]dev|%{name}|g' > .bashcomp +# generate man pages (proper commands and aliases from a sorted sequence) %{__mkdir_p} -- .manpages/man1 -help2man -N -h -H -n "$(sed -n '2s|[^(]\+(\([^)]\+\))|\1|p' README)" ./run-dev \ - | sed 's|run[-_]dev|%{name}|g' \ - > .manpages/man1/%{name}.1 -for cmd in $(./run-dev -l | sed -n 's|^ \(\S\+\).*|\1|p'); do - echo -e "#\!/bin/sh\n[ \$# -ge 1 ] && [ \"\$1\" = \"--version\" ] \ - && ./run-dev \"\$@\" || ./run-dev ${cmd} \"\$@\"" > .tmp-${cmd} - chmod +x .tmp-${cmd} - help2man -N -h -H -n "${cmd}" ./.tmp-${cmd} \ - | sed 's|run[-_]dev|%{name}|g' \ - > .manpages/man1/%{name}-${cmd}.1 -done +./run-dev -l | sed -n 's|^ \(\S\+\).*|\1|p' | sort > .subcmds +sed -e 's:\(.*\):\\\&\\fIrun_dev-\1\\fR\\\|(1), :' \ + -e '1s|\(.*\)|\[SEE ALSO\]\n\1|' \ + -e '$s|\(.*\)|\1\nand perhaps more|' \ + .subcmds > .see-also +help2man -N -h -H -i .see-also \ + -n "$(sed -n '2s|[^(]\+(\([^)]\+\))|\1|p' README)" ./run-dev \ + | sed 's|run\\\?[-_]dev|%{name}|g' \ + > ".manpages/man1/%{name}.1" +while read cmd; do + echo -e "#\!/bin/sh\n{ [ \$# -ge 1 ] && [ \"\$1\" = \"--version\" ] \ + && ./run-dev \"\$@\" || ./run-dev \"${cmd}\" \"\$@\"; }" > ".tmp-${cmd}" + chmod +x ".tmp-${cmd}" + grep -v "^${cmd}\$" .subcmds \ + | grep "$(echo ${cmd} | cut -d- -f1)\(-\|\$\)" \ + | sed -e 's:\(.*\):\\\&\\fIrun_dev-\1\\fR\\\|(1), :' \ + -e '1s|\(.*\)|\[SEE ALSO\]\n\\\&\\fIrun_dev\\fR\\\|(1), \n\1|' \ + -e '$s|\(.*\)|\1\nand perhaps more|' > .see-also + # XXX uses ";;&" bashism + case "${cmd}" in + ccs[2-]*) + sed -i \ + '1s:\(.*\):\1\n\\\&\\fIcluster.conf\\fR\\\|(5), \\\&\\fIccs\\fR\\\|(7), :' \ + .see-also + ;;& + *[2-]pcscmd*) + sed -i '1s:\(.*\):\1\n\\\&\\fIpcs\\fR\\\|(8), :' .see-also + ;;& + esac + help2man -N -h -H -i .see-also -n "${cmd}" "./.tmp-${cmd}" \ + | sed 's|run\\\?[-_]dev|%{name}|g' \ + > ".manpages/man1/%{name}-${cmd}.1" +done < .subcmds %install @@ -168,7 +198,7 @@ declare ret=0 \ ccs_flatten_dir="$(dirname '%{buildroot}%{_libexecdir}/%{name}-%{version}/ccs_flatten')" ln -s '%{buildroot}%{_datadir}/cluster'/*.'metadata' \ "${ccs_flatten_dir}" -PATH="${PATH:+${PATH}:}${ccs_flatten_dir}" ./run-check +PATH="${PATH:+${PATH}:}${ccs_flatten_dir}" ./run-tests ret=$? %{__rm} -f -- "${ccs_flatten_dir}"/*.'metadata' [ ${ret} -eq 0 ] || exit ${ret} @@ -227,6 +257,11 @@ test -x '%{_bindir}/%{name}' && test -f "${bashcomp}" \ %{python2_sitelib}/%{name}/ext-plugins/lib-pcs %changelog +* Mon Dec 21 2015 Jan Pokorný - 0.55.0-1 +- auto-generate SEE ALSO sections for the man pages +- bump upstream package (intentional jump on upstream front), + see https://github.com/jnpkrn/clufter/releases/tag/v0.55.0 + * Fri Oct 09 2015 Jan Pokorný - 0.50.5-1 - generate man pages also for offered commands - bump upstream package diff --git a/filter-get-along-without-dev-tty-that-may-not-exist.patch b/filter-get-along-without-dev-tty-that-may-not-exist.patch new file mode 100644 index 0000000..c54aebe --- /dev/null +++ b/filter-get-along-without-dev-tty-that-may-not-exist.patch @@ -0,0 +1,37 @@ +From 445068fce088f3c3a3fb53cff6617cd940462dcd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= +Date: Mon, 21 Dec 2015 16:14:16 +0100 +Subject: [PATCH] filter: get along without /dev/tty that may not exist +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Jan Pokorný +--- + filter.py | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/clufter/filter.py b/clufter/filter.py +index fc9f31f..116b00d 100644 +--- a/clufter/filter.py ++++ b/clufter/filter.py +@@ -394,10 +394,12 @@ def _try_edit(cls, res_snippet, schema_path, schema_snippet, msgs, cnt, + assert len(editor_args) >= 2 + editor_args[0] = which(editor_args[0]) + try: +- # pty.spawn doesn't work as nicely +- with open('/dev/tty') as f_tty: +- log.info("running `{0}'".format(' '.join(editor_args))) +- check_call(editor_args, stdin=f_tty) ++ # pty.spawn doesn't work as nicely, ++ # /dev/tty may not be present (with open('/dev/tty') as si) ++ # and we decide whether to be interactive per ++ # sys.__stdin__ anyway ++ log.info("running `{0}'".format(' '.join(editor_args))) ++ check_call(editor_args, stdin=__stdin__) + except (CalledProcessError, IOError) as e: + raise FilterError(cls, str(e)) + except OSError: +-- +2.4.3 + diff --git a/sources b/sources index 93e24ce..fa9ba13 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -8706a396276cff159e4dbd4dc487cc18 clufter-0.50.5.tar.gz +52064cfc423525b72c60fbce66563d94 clufter-0.55.0.tar.gz +0799c55df627c24c2c40c6e86a83f203 clufter-0.55.0-tests.tar.xz