From: Evan Silberman Subject: rdist.1: replace predefined strings and typewriter quotes To: tech@openbsd.org Date: Fri, 29 Nov 2024 11:08:06 -0800 mandoc_char(7) says predefined strings are _not recommended_, and less-than and greater-than don't need escaping anyway. We also have .Sq and can use that consistently instead of `typewriter quotes'. Extracted from an earlier diff, starting with the easier fixes before I resubmit other parts, per jmc@ suggestion. Evan ----------------------------------------------- commit 04748df0a1fd53e69e9ca5545982613c20ae0ce5 (evan) from: Evan Silberman date: Fri Nov 29 19:04:16 2024 UTC Replace predefined strings and typewriter quotes diff ea5a4cace30cc1a1ceca4b1290e0f10c1102bd7b 04748df0a1fd53e69e9ca5545982613c20ae0ce5 commit - ea5a4cace30cc1a1ceca4b1290e0f10c1102bd7b commit + 04748df0a1fd53e69e9ca5545982613c20ae0ce5 blob - 0a9734d48e3b26211655841b94e946b0a5e9bef1 blob + 0e4d361eabe62aa620e965badcdf7374a29127ea --- usr.bin/rdist/rdist.1 +++ usr.bin/rdist/rdist.1 @@ -119,7 +119,7 @@ Otherwise, .Nm will run the command: .Bd -literal -offset indent -ssh \*(Lthost\*(Gt -l \*(Ltlogin_name\*(Gt rdistd -S +ssh -l rdistd -S .Ed .Pp .Ar host @@ -140,7 +140,7 @@ option was specified, .Nm will attempt to run the command: .Bd -literal -offset indent -\*(Ltrdistd path\*(Gt -S + -S .Ed .Pp If no @@ -180,7 +180,7 @@ $ rdist -c name ... [login@]host[:dest] .Pp The equivalent distfile is as follows: .Bd -literal -offset indent -( name ... ) -\*(Gt [login@]host +( name ... ) -> [login@]host install [dest] ; .Ed .It Fl D @@ -415,9 +415,9 @@ to be copied, the destination hosts, and what operatio to do the updating. Each entry has one of the following formats. .Bd -literal -offset indent -\*(Ltvariable name\*(Gt = \*(Ltname list\*(Gt -[ label: ] \*(Ltsource list\*(Gt -\*(Gt \*(Ltdestination list\*(Gt \*(Ltcommand list\*(Gt -[ label: ] \*(Ltsource list\*(Gt :: \*(Lttimestamp file\*(Gt \*(Ltcommand list\*(Gt + = +[ label: ] -< +[ label: ] :: .Ed .Pp The first format is used for defining variables. @@ -454,11 +454,11 @@ They are used to identify a specific command to execut .Pp The source and destination lists have the following format: .Bd -literal -offset indent -\*(Ltname\*(Gt + .Ed or .Bd -literal -compact -offset indent -`(' \*(Ltzero or more names separated by whitespace\*(Gt `)' +`(' `)' .Ed .Pp These simple lists can be modified by using one level of set addition, @@ -478,29 +478,43 @@ then the list will have to be explicitly constructed i .Dq temporary variables. .Pp -The shell meta-characters `[', `]', `{', `}', `*', and `?' +The shell meta-characters +.Sq \&[ , +.Sq \&] , +.Sq \&{ , +.Sq \&} , +.Sq * , +and +.Sq \&? are recognized and expanded (on the local host only) in the same way as .Xr ksh 1 . They can be escaped with a backslash. -The `~' character is also expanded in the same way as +The +.Sq ~ +character is also expanded in the same way as .Xr ksh 1 but is expanded separately on the local and destination hosts. When the .Fl o Ar whole -option is used with a file name that begins with `~', everything except the -home directory is appended to the destination name. -File names which do not begin with `/' or `~' use the destination user's +option is used with a file name that begins with +.Sq \&~ , +everything except the home directory is appended to the destination name. +File names which do not begin with +.Sq / +or +.Sq ~ +use the destination user's home directory as the root directory for the rest of the file name. .Pp The command list consists of zero or more commands of the following format: .Bl -column "except_pat" "" "opt_dest_name" ";" -offset indent -.It install Ta \*(Ltoptions\*(Gt Ta opt_dest_name Ta ; -.It notify Ta \*(Ltname list\*(Gt Ta "" Ta ; -.It except Ta \*(Ltname list\*(Gt Ta "" Ta ; -.It except_pat Ta \*(Ltpattern list\*(Gt Ta "" Ta ; -.It special Ta \*(Ltname list\*(Gt Ta string Ta ; -.It cmdspecial Ta \*(Ltname list\*(Gt Ta string Ta ; +.It install Ta Ta opt_dest_name Ta ; +.It notify Ta Ta "" Ta ; +.It except Ta Ta "" Ta ; +.It except_pat Ta Ta "" Ta ; +.It special Ta Ta string Ta ; +.It cmdspecial Ta Ta string Ta ; .El .Pp The @@ -554,12 +568,17 @@ is a list of basic regular expressions for details). If one of the patterns matches some string within a file name, that file will be ignored. -Note that since `\e' is a quote character, it must be doubled to become +Note that since +.Sq \e +is a quote character, it must be doubled to become part of the regular expression. Variables are expanded in .Ar pattern list but not shell file pattern matching characters. -To include a `$', it must be escaped with `\e'. +To include a +.Sq $ , +it must be escaped with +.Sq \e . .Pp The .Cm special @@ -573,7 +592,9 @@ If the is omitted then the shell commands will be executed for every file updated or installed. .Ar string -starts and ends with `"' and can cross multiple lines in +starts and ends with +.Sq \&" +and can cross multiple lines in .Pa distfile . Multiple commands to the shell should be separated by `;'. Commands are executed in the user's home directory on the host @@ -750,20 +771,20 @@ FILES = ( /bin /lib /usr/bin /usr/games EXLIB = ( Mail.rc aliases aliases.db crontab dshrc sendmail.cf sendmail.hf sendmail.st uucp vfont ) -${FILES} -\*(Gt ${HOSTS} +${FILES} -> ${HOSTS} install -oremove,chknfs ; except /usr/lib/${EXLIB} ; except /usr/games/lib ; special /usr/lib/sendmail "/usr/lib/sendmail -bi" ; srcs: -/usr/src/bin -\*(Gt arpa +/usr/src/bin -> arpa except_pat ( \e\e.o\e$ /SCCS\e$ ) ; IMAGEN = (ips dviimp catdvi) imagen: -/usr/local/${IMAGEN} -\*(Gt arpa +/usr/local/${IMAGEN} -> arpa install /usr/local/lib ; notify ralph ;