Would you consider adding host argument support without providing a
[ppa] implementation? Users could then opt-in by adding a [ppa]
section to their /etc/dput.cf (or ~/.dput.cf). Here's just that piece
of the Ubuntu delta:

diff -urpN dput-1.1.2.orig/doc/man/dput.1 dput-1.1.2/doc/man/dput.1
--- dput-1.1.2.orig/doc/man/dput.1      2022-07-01 16:15:28.000000000 -0600
+++ dput-1.1.2/doc/man/dput.1   2022-09-20 15:28:47.064454572 -0600
@@ -15,7 +15,7 @@
 .OP \-DPUVdflosu
 .OP \-c CONFIGFILE
 .OP \-e DAYS
-.RI [ HOSTNAME ]
+.RI [ HOSTNAME [:ARGUMENT] ]
 .I CHANGESFILE
 \f[R].\|.\|.\f[]
 .YS
@@ -65,6 +65,10 @@ can perform on each package.
 configuration. If not specified, \f[I]HOSTNAME\f[] defaults to the
 value of the \f[B]default_host_main\f[] configuration parameter.
 .
+You also can
+pass an argument to the host by appending the hostname with a colon followed
+by the argument.
+.
 .P
 The file transfer method is determined by the \f[B]method\f[]
 configuration parameter for the specified host. See
diff -urpN dput-1.1.2.orig/doc/man/dput.cf.5 dput-1.1.2/doc/man/dput.cf.5
--- dput-1.1.2.orig/doc/man/dput.cf.5   2022-07-01 16:15:28.000000000 -0600
+++ dput-1.1.2/doc/man/dput.cf.5        2022-09-20 15:27:07.403817539 -0600
@@ -340,6 +340,14 @@ for packages that are allowed to be uplo
 This variable is used when guessing the host to upload to.
 .
 .\" ==========
+.SH HOST ARGUMENT
+.P
+If a user passes an argument to a host by appending the hostname with a colon,
+.B %(HOSTNAME)s
+will be replaced with the specified argument. Otherwise, it will be replaced
+with an empty string.
+.
+.\" ==========
 .SH FILES
 .
 .TP
diff -urpN dput-1.1.2.orig/dput/dput.py dput-1.1.2/dput/dput.py
--- dput-1.1.2.orig/dput/dput.py        2022-07-01 16:15:28.000000000 -0600
+++ dput-1.1.2/dput/dput.py     2022-09-20 15:31:00.221305900 -0600
@@ -979,6 +979,19 @@ def main():
     if len(args) == 1 and not options.check_only:
         changes_file_paths = args[0:]
     else:
+        if ':' in args[0]:
+            sys.stdout.write("D: Splitting host argument out of  %s.\n" % 
args[0])
+            args[0], host_argument = args[0].split(":", 1)
+        else:
+            host_argument = ""
+
+        if config.has_section(args[0]):
+            sys.stdout.write("D: Setting host argument.\n")
+            config.set(args[0], args[0], host_argument)
+        else:
+            # Let the code below handle this as it is sometimes okay (ie. -o)
+            pass
+
         if not options.check_only:
             if options.debug:
                 sys.stdout.write(

Reply via email to