> The original author used os.getenv() in python argparse, so the output
> of `mini-buildd --help' really depend on $HOME env var

I agree that upstream are using an environment variable called HOME and
note that it ends up in the manpage.

However, this does not imply that the string "$HOME" will be interpolated,
so your patch breaks mini-buildd.

> Unfortunately in my opinion there is no better option except fixed text
> string.

A fixed text string is indeed required, but "$HOME" is not that string :)
What's wrong with my expanduser suggestion?

Patch attached.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/mini-buildd       2016-08-03 08:56:33.531642844 -0400
--- b/mini-buildd       2016-08-03 09:08:26.614952941 -0400
@@ -77,9 +77,9 @@
                                 help="SMTP credentials in format 
'[USER]:[PASSWORD]@smtp|ssmtp://HOST:PORT'.")
         group_conf.add_argument("-U", "--dedicated-user", action="store", 
default="mini-buildd",
                                 help="Force a custom dedicated user name (to 
run as a different user than 'mini-buildd').")
-        group_conf.add_argument("-H", "--home", action="store", 
default=os.getenv("HOME"),
+        group_conf.add_argument("-H", "--home", action="store", default="~",
                                 help="Run with this home dir. The only use 
case to change this for debugging, really.")
-        group_conf.add_argument("-F", "--pidfile", action="store", 
default=os.path.join(os.getenv("HOME"), ".mini-buildd.pid"),
+        group_conf.add_argument("-F", "--pidfile", action="store", 
default="~/.mini-buildd.pid",
                                 help="Set pidfile path.")
         group_conf.add_argument("-f", "--foreground", action="store_true",
                                 help="Don't daemonize, log to console.")
@@ -118,6 +118,9 @@
         if args.set_admin_password or args.loaddata or args.dumpdata:
             args.foreground = True
 
+        args.home = os.path.expanduser(args.home)
+        args.pidfile = os.path.expanduser(args.pidfile)
+
         return args
 
     def _setup(self):

Reply via email to