Skip to contentSkip to conversation

Add man page for alsaucm + other fixes

PATCH Applied Antonio Ospite 2 participants 8 messages Dec 9, 2016

lore
Share & tools
lore
#0 lore raw

cover Add man page for alsaucm + other fixes

Hi,

while adding the alsaucm man page (patch 4/5) I noticed some other things worth fixing, so here is the whole patch set.

In patch 4/5 the reStructuredText content is exactly the same reviewed by Liam, so I put his ACK in the commit message.

Thanks,
Antonio

Antonio Ospite (5):
alsaucm: mention the "list1" command in the usage output configure.ac: fix the check for xmlto availability configure.ac: add a check for rst2man, a reStructuredText man page
generator
alsaucm: add a man page, generated from reStructuredText
INSTALL: document how to configure a build for installation in a local
dir

 .gitignore          |   1 +
 INSTALL             |   7 ++
 alsaucm/Makefile.am |   7 ++
 alsaucm/alsaucm.rst | 235 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 alsaucm/usecase.c   |   3 +-
 configure.ac        |  15 +++-
 6 files changed, 264 insertions(+), 4 deletions(-)
 create mode 100644 alsaucm/alsaucm.rst
Signature · 7 lines
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
#1 lore raw

PATCH 1/5 alsaucm: mention the "list1" command in the usage output

---
 alsaucm/usecase.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
alsaucm/usecase.c +2 -1
index 1c94680..fbbe73a 100644
@@ -117,7 +117,8 @@ static void dump_help(struct context *context)
 "  reset                      reset sound card to default state\n"
 "  reload                     reload configuration\n"
 "  listcards                  list available cards\n"
-"  list IDENTIFIER            list command\n"
+"  list IDENTIFIER            list command, for items with value + comment\n"
+"  list1 IDENTIFIER           list command, for items without comments\n"
 "  get IDENTIFIER             get string value\n"
 "  geti IDENTIFIER            get integer value\n"
 "  set IDENTIFIER VALUE       set string value\n"
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/5 configure.ac: fix the check for xmlto availability

In reply to Antonio Ospite

The same $xmlto variable is used both in AC_ARG_ENABLE and AC_CHECK_PROG, but the latter is not setting a value to it when the program is not found.

These two facts result in the "yes" value from the AC_ARG_ENABLE macro to be still kept in the variable when the program is not found by AC_CHECK_PROG, causing USE_XMLTO to be always set, finally resulting in a build failure in case the xmlto program is not actually in the PATH.

As possible fix could have been to set "no" as a value in AC_CHECK_PROG when program is not found.

However using two separate variables is more explicit, so fix the issue this way.

---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
configure.ac +3 -3
index 2221617..c9629bb 100644
@@ -166,14 +166,14 @@ AC_ARG_ENABLE(alsaloop,
      esac],[alsaloop=true])
 AM_CONDITIONAL(ALSALOOP, test x$alsaloop = xtrue)
 
-xmlto=""
+xmlto_available=""
 AC_ARG_ENABLE(xmlto,
  AS_HELP_STRING([--disable-xmlto], [Disable man page creation via xmlto]),
  xmlto="$enableval", xmlto="yes")
 if test "$xmlto" = "yes"; then
-  AC_CHECK_PROG([xmlto], [xmlto], [yes])
+  AC_CHECK_PROG([xmlto_available], [xmlto], [yes])
 fi
-AM_CONDITIONAL(USE_XMLTO, test x"$xmlto" = xyes)
+AM_CONDITIONAL(USE_XMLTO, test x"$xmlto_available" = xyes)
 
 AC_ARG_WITH(
         [udev-rules-dir],
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/5 configure.ac: add a check for rst2man, a reStructuredText man page generator

In reply to Antonio Ospite

Define a USE_RST2MAN conditional so that, when available, rst2man can be used to generate man pages from reStructuredText source files.

The code follows what is done to check for xmlto.

On Debian system, the rst2man executable is provided by python-docutils or python3-docutils.

---
 configure.ac | 9 +++++++++
 1 file changed, 9 insertions(+)
configure.ac +9 -0
index c9629bb..d8fcf0f 100644
@@ -175,6 +175,15 @@ if test "$xmlto" = "yes"; then
 fi
 AM_CONDITIONAL(USE_XMLTO, test x"$xmlto_available" = xyes)
 
+rst2man_available=""
+AC_ARG_ENABLE(rst2man,
+ AS_HELP_STRING([--disable-rst2man], [Disable man page creation via rst2man]),
+ rst2man="$enableval", rst2man="yes")
+if test "$rst2man" = "yes"; then
+  AC_CHECK_PROG([rst2man_available], [rst2man], [yes])
+fi
+AM_CONDITIONAL(USE_RST2MAN, test x"$rst2man_available" = xyes)
+
 AC_ARG_WITH(
         [udev-rules-dir],
         AS_HELP_STRING([--with-udev-rules-dir=DIR],[Directory where to install udev rules to (default=auto)]),
Signature · 1 line
2.11.0
#4 lore raw

PATCH 4/5 alsaucm: add a man page, generated from reStructuredText

In reply to Antonio Ospite
---
 .gitignore          |   1 +
 alsaucm/Makefile.am |   7 ++
 alsaucm/alsaucm.rst | 235 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 243 insertions(+)
 create mode 100644 alsaucm/alsaucm.rst
.gitignore +1 -0
index f7e3e23..bc08f4f 100644
@@ -46,6 +46,7 @@ seq/aseqnet/aseqnet
 speaker-test/speaker-test
 alsaloop/alsaloop
 alsaucm/alsaucm
+alsaucm/alsaucm.1
 topology/alsatplg
 
 include/aconfig.h*
alsaucm/Makefile.am +7 -0
index 39a27b1..7047215 100644
@@ -1,9 +1,16 @@
 bin_PROGRAMS = \
         alsaucm
 
+if USE_RST2MAN
+man_MANS = alsaucm.1
+endif
+
 alsaucm_SOURCES = usecase.c
 
 AM_CPPFLAGS = \
          -Wall -I$(top_srcdir)/include
 
 alsaucm_LDADD = -lasound
+
+%.1: %.rst
+	rst2man $< > $@
alsaucm/alsaucm.rst new file +235 -0

235 lines not on this page · raw message

Signature · 1 line
2.11.0
#5 lore raw

PATCH 5/5 INSTALL: document how to configure a build for installation in a local dir

In reply to Antonio Ospite
---
 INSTALL | 7 +++++++
 1 file changed, 7 insertions(+)
INSTALL +7 -0
index 544d5d2..d95bb97 100644
@@ -42,5 +42,12 @@ For compilation you can use these commands:
 
 The included gitcompile script does this job for you.
 
+To configure the build to install in a local directory, a command like the
+following can be used:
+
+	./gitcompile --prefix="$PWD/build" \
+	  --with-systemdsystemunitdir="$PWD/build/$(pkg-config systemd --variable=systemdsystemunitdir)" \
+	  --with-udev-rules-dir="$PWD/build/$(pkg-config udev --variable=udevdir)"
+
 Note: Some automake packages have missing aclocal program. Use newer version
       in the case.
Signature · 1 line
2.11.0
Applied
#6 lore raw
In reply to Antonio Ospite
Quoted 8 lines · Antonio Ospite

Hi,

while adding the alsaucm man page (patch 4/5) I noticed some other things worth fixing, so here is the whole patch set.

In patch 4/5 the reStructuredText content is exactly the same reviewed by Liam, so I put his ACK in the commit message.

Thanks, applied now all patches.

The change of .gitignore was split from the patch 4, since it makes often backporting difficult. Other than that, all patches were applied as is.

Takashi

Quoted 31 lines

Thanks,
Antonio

Antonio Ospite (5):
alsaucm: mention the "list1" command in the usage output configure.ac: fix the check for xmlto availability configure.ac: add a check for rst2man, a reStructuredText man page
generator
alsaucm: add a man page, generated from reStructuredText
INSTALL: document how to configure a build for installation in a local
dir

 .gitignore          |   1 +
 INSTALL             |   7 ++
 alsaucm/Makefile.am |   7 ++
 alsaucm/alsaucm.rst | 235 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 alsaucm/usecase.c   |   3 +-
 configure.ac        |  15 +++-
 6 files changed, 264 insertions(+), 4 deletions(-)
 create mode 100644 alsaucm/alsaucm.rst
Signature · 7 lines
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
#7 lore raw
Quoted 8 lines · On Fri, 09 Dec 2016 17:33:08 +0100 Takashi Iwai <[email protected]> wrote:
Quoted 6 lines · Antonio Ospite

Hi,

while adding the alsaucm man page (patch 4/5) I noticed some other things worth fixing, so here is the whole patch set.

Quoted 9 lines
Quoted 2 lines

In patch 4/5 the reStructuredText content is exactly the same reviewed by Liam, so I put his ACK in the commit message.

Thanks, applied now all patches.

The change of .gitignore was split from the patch 4, since it makes often backporting difficult. Other than that, all patches were applied as is.

Awesome, thanks.

Ciao ciao,
Antonio

Signature · 7 lines
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?