[sane-devel] Getting Alpine Linux sane-backends builds compiler warning free

2017-07-22 Thread Olaf Meeuwissen
Hi Valery,

I'm one of the SANE developers and am trying to get rid of all compiler
warnings on a select subset of build environments.  Alpine Linux is one
of them and its parallel port IO support is giving me a bit of trouble.
Hope you can help me out a bit.

I don't see any libieee1284 packages for 3.6.  Is there any activity to
add libieee1284?  It would enable support for a few more backends.

A few backends also provide parallel port IO support if certain Linux
kernel headers are present.  Looking at the `makedepends` list in the
sane package's APKBUILD file, I don't see kernel-headers listed.  Can
I assume that the Alpine package build environment makes sure that is
present?  If not, you may want to add it.  It would make at least the
umax_pp backend do something more useful.  Without that package, it
compiles but essentially just no-ops just about all the I/O after
spitting out a warning, IIUC.

My builds have so far not included the kernel-headers package in the
list of packages to be installed but I'm leaning towards adding it.  It
would solve a major compiler warning headache for me ;-)

If Alpine Linux' default build environment always includes it, I feel
more justified to "take the easy way out".

You can find my build environment setup[1] as well as build logs[2] (the
middle stage, first on the drop-down list) over at GitLab.com.

 [1]: https://gitlab.com/sane-project/ci-envs/blob/master/alpine-3.6-musl.df
 [2]: https://gitlab.com/sane-project/backends/pipelines

Somewhat off-topic, but ...

I also see that you list the license as GPL in the APKBUILD file.  Is
that for that file only or does that apply to the binary packages?
If the latter, it's not correct and really should be fixed.

BTW, love the fact that you provide a package per backend!  Wishing
other distributions would do the same.

Thanks for any feedback in advance,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Softwarehttps://my.fsf.org/donate
 Join the Free Software Foundation  https://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 3/3] saned: reorganize flags, remove run_mode SANED_RUN_DEBUG

2017-07-22 Thread Luiz Angelo Daros de Luca
The two first patches are trivial bugfixes. However, this one proposes a
new organization
 on saned options, as shown at:

https://alioth.debian.org/tracker/index.php?func=detail=315747_id=30186=410366

All flags now do one thing and normally have an opposite flag that can
deactivate it.
The flag -a was kept compatible but, flags -d and -s now have a different
behavior.
-d only sets the debug level and -s only forces syslog. I guess this
breakage does little
harm as those flags are only used for dev (as they quits saned after first
client). If not,
I can introduce new flags for those actions and revert -d/-s previous
behavior.
-- 

Luiz Angelo Daros de Luca
luizl...@gmail.com
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org

[sane-devel] [PATCH 3/3] saned: reorganize flags, remove run_mode SANED_RUN_DEBUG

2017-07-22 Thread luizluca
From: Luiz Angelo Daros de Luca 

Flags like -a, -d and -s have many overlap effects. This patch restricts
the effect of flags to a simple action.

New -u (user) flag replaces -a optional argument for running saned as a 
different user.
The code that retrieve the user info and drop privileges migrated to 
runas_user().
As a side effect, PID file can be created even if getting user info fails.

New -l (listen) flag sets run_mode to standalone. It can be cancelled with -i.
New -i (inetd, default) flag sets run_mode to inetd. It is useful only to 
cancel -l.

New -D (daemonize) flag daemonizes saned after bind. Requires -l and it can be 
cancelled
by -f.
New -f (foreground) flag for running saned in foreground (useful for procd).
It can be cancelled using new -D flag.

New -o (once) make saned exit after the first client disconnects.

Flag -s (syslog) now only forces output to syslog and does not accept 
arguments. It can be
cancelled using -e. Previous behavior can be reproduced with '-a -d level -o -f 
-s'.
New -e (stderr) flag for redirecting output to stderr, instead of syslog. It 
can be
cancelled using -s.

Flag -d (debug) now only sets the debug level and argument is required. 
Previous behavior
can be reproduced with '-a -d level -o -f'.

The run_mode SANED_RUN_DEBUG and SANED_RUN_ALONE shared most of its code
path. With the new flags dealing with their difference, SANED_RUN_DEBUG is gone.

Flag '-a' still works as before but it can be replaced by '-l -D -u user'.

Current uses of -d (debug) or -s (syslog) will break.

Signed-off-by: Luiz Angelo Daros de Luca 
---
 doc/saned.man|  78 --
 frontend/saned.c | 306 +++
 2 files changed, 220 insertions(+), 164 deletions(-)

diff --git a/doc/saned.man b/doc/saned.man
index 8542d254..0bddc58d 100644
--- a/doc/saned.man
+++ b/doc/saned.man
@@ -6,15 +6,21 @@ saned \- SANE network daemon
 .B saned
 .B [ \-a
 .I [ username ]
+.B ]
+.B [ \-u
+.I username
+.B ]
 .B [ \-b
 .I address
 .B ]
-.B | \-d
-.I [ n ]
-.B | \-s
-.I [ n ]
-.B | \-h
+.B [ \-l | \-i ]
+.B [ \-D | \-f ]
+.B [ \-o ]
+.B [ \-d
+.I n
 .B ]
+.B [ \-s | \-e ]
+.B [ \-h ]
 .SH DESCRIPTION
 .B saned
 is the SANE (Scanner Access Now Easy) daemon that allows remote clients
@@ -22,51 +28,63 @@ to access image acquisition devices available on the local 
host.
 .SH OPTIONS
 .PP
 The
-.B \-a
+.B \-l
 flag requests that
 .B saned
 run in standalone daemon mode. In this mode,
 .B saned
-will detach from the console and run in the background, listening for incoming
-client connections;
+will listening for incoming client connections;
 .B inetd
 is not required for
 .B saned
-operations in this mode. If the optional
-.B username
-is given after
-.B \-a
-,
+operations in this mode. The
+.B \-b
+flag can control which address
 .B saned
-will drop root privileges and run as this user (and group).
+will bind. The
+.B \-u
+.I username
+flag requests that
+.B saned
+drop root privileges and run as this user (and group) after bind.
+The
+.B \-B
+flag will request
+.B saned
+to detach from the console and run in the background, while 
+.B \-f
+flag will keep it attached to the console and running foreground.
+The flag
+.B \-a
+is equals to
+.B \-l \-B \-u
+.I username
+.
+.PP
+The
+.B \-e
+flag will request that 
+.B saned
+output to stderr while the
+.B \-s
+flag forces the output to syslog.
 .PP
 The
 .B \-d
-and
-.B \-s
-flags request that
+flag sets the debug level of
 .B saned
-run in debug mode (as opposed to
-.BR inetd (8)
-daemon mode).  In this mode,
-.B saned
-explicitly waits for a connection request.  When compiled with
-debugging enabled, these flags may be followed by a number to request
+. When compiled with debugging enabled, these flags may be followed by a 
number to request
 debug info. The larger the number, the more verbose the debug output.
 E.g.,
 .B \-d128
 will request printing of all debug info. Debug level 0 means no debug output
-at all. The default value is 2. If flag
-.B \-d
-is used, the debug messages will be printed to stderr while
-.B \-s
-requests using syslog.
+at all. The default value is 2.
 .PP
 The
-.B \-b
+.B \-o
 flag requests that
 .B saned
-bind to a specific address.
+exits after the first client disconnects. Useful for debugging.
 .PP
 If
 .B saned
diff --git a/frontend/saned.c b/frontend/saned.c
index 6b97e914..93afd612 100644
--- a/frontend/saned.c
+++ b/frontend/saned.c
@@ -251,6 +251,8 @@ static Wire wire;
 static int num_handles;
 static int debug;
 static int run_mode;
+static int run_foreground;
+static int run_once;
 static Handle *handle;
 static char *bind_addr;
 static union
@@ -298,9 +300,10 @@ static SANE_Bool log_to_syslog = SANE_TRUE;
 static int process_request (Wire * w);
 
 #define SANED_RUN_INETD  0
-#define SANED_RUN_DEBUG  1
-#define SANED_RUN_ALONE  2
+#define SANED_RUN_ALONE  1
 
+#define SANED_EXEC_FOREGROUND 0
+#define SANED_EXEC_BACKGROUND 1
 

[sane-devel] [PATCH 2/3] saned: update man for option -b

2017-07-22 Thread luizluca
From: Luiz Angelo Daros de Luca 

---
 doc/saned.man | 9 +
 1 file changed, 9 insertions(+)

diff --git a/doc/saned.man b/doc/saned.man
index 34764f1f..8542d254 100644
--- a/doc/saned.man
+++ b/doc/saned.man
@@ -6,6 +6,9 @@ saned \- SANE network daemon
 .B saned
 .B [ \-a
 .I [ username ]
+.B [ \-b
+.I address
+.B ]
 .B | \-d
 .I [ n ]
 .B | \-s
@@ -59,6 +62,12 @@ is used, the debug messages will be printed to stderr while
 .B \-s
 requests using syslog.
 .PP
+The
+.B \-b
+flag requests that
+.B saned
+bind to a specific address.
+.PP
 If
 .B saned
 is run from inetd, xinetd or systemd, no option can be given.
-- 
2.11.0


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] [PATCH 1/3] saned: fix --debug help message (output is stderr)

2017-07-22 Thread luizluca
From: Luiz Angelo Daros de Luca 

Man page was correct.

Signed-off-by: Luiz Angelo Daros de Luca 
---
 frontend/saned.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frontend/saned.c b/frontend/saned.c
index 2fc33216..6b97e914 100644
--- a/frontend/saned.c
+++ b/frontend/saned.c
@@ -3300,7 +3300,7 @@ static void usage(char *me, int err)
"Usage: %s [OPTIONS]\n\n"
" Options:\n\n"
"  -a, --alone[=user]   run standalone and fork in background as 
`user'\n"
-   "  -d, --debug[=level]  run foreground with output to stdout\n"
+   "  -d, --debug[=level]  run foreground with output to stderr\n"
"   and debug level `level' (default is 2)\n"
"  -s, --syslog[=level] run foreground with output to syslog\n"
"   and debug level `level' (default is 2)\n"
-- 
2.11.0


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org