[Lsb-messages] /var/www/bzr/lsb/devel/lsbspec r3796: mkcmdlist: support differenct cmd pages for different LSB versions

Denis Silakov denis.silakov at rosalab.ru
Tue Mar 13 09:06:39 UTC 2012


------------------------------------------------------------
revno: 3796
committer: Denis Silakov <denis.silakov at rosalab.ru>
branch nick: lsbspec
timestamp: Tue 2012-03-13 13:06:39 +0400
message:
  mkcmdlist: support differenct cmd pages for different LSB versions
added:
  LSB/generic/command/groupadd-5.0.sgml
  LSB/generic/command/groupdel-5.0.sgml
  LSB/generic/command/useradd-5.0.sgml
  LSB/generic/command/userdel-5.0.sgml
renamed:
  LSB/generic/command/groupadd.sgml => LSB/generic/command/groupadd-1.0.sgml
  LSB/generic/command/groupdel.sgml => LSB/generic/command/groupdel-1.0.sgml
  LSB/generic/command/useradd.sgml => LSB/generic/command/useradd-1.0.sgml
  LSB/generic/command/userdel.sgml => LSB/generic/command/userdel-1.0.sgml
modified:
  LSB/generic/command/cmdman.sgml
  mkcmdlist
-------------- next part --------------
=== modified file 'LSB/generic/command/cmdman.sgml'
--- a/LSB/generic/command/cmdman.sgml	2008-09-30 13:18:54 +0000
+++ b/LSB/generic/command/cmdman.sgml	2012-03-13 09:06:39 +0000
@@ -28,8 +28,8 @@
 m4_include(fuser.sgml)
 m4_include(gettext.sgml)
 m4_include(grep.sgml)
-m4_include(groupadd.sgml)
-m4_include(groupdel.sgml)
+m4_include(groupadd-1.0.sgml)
+m4_include(groupdel-1.0.sgml)
 m4_include(groupmod.sgml)
 m4_include(groups.sgml)
 m4_include(gunzip.sgml)
@@ -66,8 +66,8 @@
 m4_include(sync.sgml)
 m4_include(tar.sgml)
 m4_include(umount.sgml)
-m4_include(useradd.sgml)
-m4_include(userdel.sgml)
+m4_include(useradd-1.0.sgml)
+m4_include(userdel-1.0.sgml)
 m4_include(usermod.sgml)
 m4_include(xargs.sgml)
 m4_include(zcat.sgml)

=== renamed file 'LSB/generic/command/groupadd.sgml' => 'LSB/generic/command/groupadd-1.0.sgml'
=== added file 'LSB/generic/command/groupadd-5.0.sgml'
--- a/LSB/generic/command/groupadd-5.0.sgml	1970-01-01 00:00:00 +0000
+++ b/LSB/generic/command/groupadd-5.0.sgml	2012-03-13 09:06:39 +0000
@@ -0,0 +1,54 @@
+<REFENTRY id="groupadd">
+<REFMETA><REFENTRYTITLE>groupadd</REFENTRYTITLE></REFMETA>
+
+<REFNAMEDIV>
+<REFNAME>groupadd</REFNAME>
+
+<REFPURPOSE>
+create a new group
+</REFPURPOSE>
+
+</REFNAMEDIV>
+
+<REFSYNOPSISDIV>
+<CMDSYNOPSIS>
+<COMMAND>groupadd</COMMAND>
+<ARG>-g gid <ARG>-o</ARG></ARG> <ARG Choice=plain>group</ARG>
+</CMDSYNOPSIS>
+</REFSYNOPSISDIV>
+
+<REFSECT1>
+<TITLE>Description</TITLE>
+<PARA>
+If the caller has appropriate privilege, the 
+<COMMAND>groupadd</COMMAND> command shall create a new
+group named <PARAMETER Class=Option>group</PARAMETER>.  
+The group name shall be unique in the group database. If no
+<PARAMETER Class=option>gid</PARAMETER> is specified, 
+<COMMAND>groupadd</COMMAND> shall create the new group with a unique group ID.
+</PARA>
+<PARA>
+The <command>groupadd</command> command is a system administration utility,
+see <XREF LINKEND="FHS-SYSADMIN">.
+</PARA>
+</REFSECT1>
+<REFSECT1>
+<title>Options</title>
+<variablelist>
+
+<varlistentry>
+<term><PARAMETER Class=Option>-g <REPLACEABLE>gid</REPLACEABLE> [-o]</PARAMETER></term>
+<listitem>
+<para>
+The new group shall have group ID <PARAMETER>gid</PARAMETER>.
+If the <PARAMETER Class=option>-o</PARAMETER> option is not used, no other
+group shall have this group ID.
+The value of <PARAMETER>gid</PARAMETER> shall be non-negative.  
+</para>
+</listitem>
+</varlistentry>
+
+</variablelist>
+</REFSECT1>
+
+</REFENTRY>

=== renamed file 'LSB/generic/command/groupdel.sgml' => 'LSB/generic/command/groupdel-1.0.sgml'
=== added file 'LSB/generic/command/groupdel-5.0.sgml'
--- a/LSB/generic/command/groupdel-5.0.sgml	1970-01-01 00:00:00 +0000
+++ b/LSB/generic/command/groupdel-5.0.sgml	2012-03-13 09:06:39 +0000
@@ -0,0 +1,36 @@
+<REFENTRY id="groupdel">
+<REFMETA><REFENTRYTITLE>groupdel</REFENTRYTITLE></REFMETA>
+
+<REFNAMEDIV>
+<REFNAME>groupdel</REFNAME>
+
+<REFPURPOSE>
+delete a group
+</REFPURPOSE>
+
+</REFNAMEDIV>
+
+<REFSYNOPSISDIV>
+<CMDSYNOPSIS>
+<COMMAND>groupdel</COMMAND><ARG Choice="Plain">group</ARG>
+</CMDSYNOPSIS>
+</REFSYNOPSISDIV>
+<REFSECT1>
+<title>Description</title>
+<PARA>
+If the caller has sufficient privilege,
+the <COMMAND>groupdel</COMMAND> command shall modify the system group database,
+deleting the 
+group named <PARAMETER Class=Option>group</PARAMETER>.  
+If the group named <PARAMETER Class=Option>group</PARAMETER> does not exist,
+<COMMAND>groupdel</COMMAND> shall issue a diagnostic message and exit
+with a non-zero exit status.
+</PARA>
+<PARA>
+The <command>groupdel</command> command is a system administration utility,
+see <XREF LINKEND="FHS-SYSADMIN">.
+</PARA>
+
+</REFSECT1>
+
+</REFENTRY>

=== renamed file 'LSB/generic/command/useradd.sgml' => 'LSB/generic/command/useradd-1.0.sgml'
=== added file 'LSB/generic/command/useradd-5.0.sgml'
--- a/LSB/generic/command/useradd-5.0.sgml	1970-01-01 00:00:00 +0000
+++ b/LSB/generic/command/useradd-5.0.sgml	2012-03-13 09:06:39 +0000
@@ -0,0 +1,242 @@
+<REFENTRY id="useradd">
+<REFMETA><REFENTRYTITLE>useradd</REFENTRYTITLE></REFMETA>
+
+<REFNAMEDIV>
+<REFNAME>useradd</REFNAME>
+
+<REFPURPOSE>
+create a new user or update default new user information
+</REFPURPOSE>
+
+</REFNAMEDIV>
+
+<REFSYNOPSISDIV>
+<CMDSYNOPSIS>
+<COMMAND>useradd</COMMAND>
+<ARG>-c comment</ARG>
+<ARG>-d home_dir</ARG>
+<ARG>-g initial_group</ARG>
+<ARG rep=repeat>-G group</ARG>
+<ARG>-m <ARG>-k skeleton_dir</ARG></ARG>
+<ARG>-p passwd</ARG>
+<ARG>-r</ARG>
+<ARG>-s shell</ARG>
+<ARG>-u uid <ARG>-o</ARG></ARG> 
+<ARG choice=plain>login</ARG>
+<SBR>
+<COMMAND>useradd</COMMAND>
+<ARG choice=plain>-D</ARG>
+<ARG>-g default_group</ARG>
+<ARG>-b default_home</ARG>
+<ARG>-s default_shell</ARG>
+</CMDSYNOPSIS>
+</REFSYNOPSISDIV>
+
+<REFSECT1>
+<TITLE>Description</TITLE>
+<PARA>
+When invoked without the <parameter>-D</parameter>
+option, and with appropriate privilege, 
+<COMMAND>useradd</COMMAND> creates a new
+user account using the values specified on the command line and the
+default values from the system.  The new user account will be entered
+into the system files as needed, the home directory will be created,
+and initial files copied, depending on the command line options.
+</PARA>
+
+<PARA>
+When invoked with the <parameter>-D</parameter>
+option, <COMMAND>useradd</COMMAND> will either 
+display the current default values, or,
+with appropriate privilege, update the default values from 
+the command line.  If no options are specified, <COMMAND>useradd</COMMAND> 
+displays the current default values.
+</PARA>
+<PARA>
+The <command>useradd</command> command is a system administration utility,
+see <XREF LINKEND="FHS-SYSADMIN">.
+</PARA>
+</REFSECT1>
+
+<REFSECT1>
+<title>Standard Options</title>
+<variablelist>
+
+<varlistentry>
+<term>-c comment</term>
+<listitem>
+<para>
+specifies the new user's password file comment field value.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-d home_dir</term>
+<listitem>
+<para>
+creates the new user using home_dir as the value for the
+user's login directory.  The default is to append the login name to
+default_home and use that as the login directory name.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-g initial_group</term>
+<listitem>
+<para>
+specifies the group name or number of the user's initial login group. 
+The group name shall exist. A group number shall refer to an already 
+existing group. If <parameter>-g</parameter>
+is not specified, the implementation will follow 
+the normal user
+default for that system. This may create a new group or choose a default
+group that normal users are placed in. Applications which require control
+of the groups into which a user is placed should specify 
+<parameter>-g</parameter>.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-G group[,...]</term>
+<listitem>
+<para>
+specifies a list of supplementary groups which the user is also a member of.
+Each group is separated from the next by a comma, with no intervening
+whitespace.  The groups are subject to the same restrictions as the
+group given with the 
+<parameter>-g</parameter> option.  The default is for the user to belong
+only to the initial group.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-m [-k skeleton_dir]</term>
+<listitem>
+<para>
+specifies the user's home directory will be created if it does not exist. 
+The files contained in <filename>skeleton_dir</filename>
+will be copied to the home directory
+if the <parameter>-k</parameter>
+option is used, otherwise the files contained in 
+<filename>/etc/skel</filename>
+will be used instead.  Any directories contained in 
+<filename>skeleton_dir</filename> or
+<filename>/etc/skel</filename> 
+will be created in the user's home directory as well.  The
+<parameter>-k</parameter> 
+option is only valid in conjunction with the 
+<parameter>-m</parameter> option.  The
+default is to not create the directory and to not copy any files.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-p passwd</term>
+<listitem>
+<para>
+is the encrypted password, as returned by <function>crypt</function>.
+The default is to
+disable the account.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-r</term>
+<listitem>
+<para>
+creates a system account, that is, a user with a
+User ID in the range reserved for system account users. If there is not a
+User ID free in the reserved range the command will fail.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-s shell</term>
+<listitem>
+<para>
+specifies the name of the user's login shell.  The default is to leave this
+field blank, which causes the system to select the default login
+shell.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-u uid [-o]</term>
+<listitem>
+<para>
+specifies the numerical value of the user's ID.  This value shall be unique,
+unless the <parameter>-o</parameter> option is used.  The value shall be non-negative.
+The default is the smallest ID value greater than 499 which is not yet used. 
+</para>
+</listitem>
+</varlistentry>
+
+</variablelist>
+</REFSECT1>
+
+<REFSECT1>
+<title>Change Default Options</title>
+<variablelist>
+
+<varlistentry>
+<term>-b default_home</term>
+<listitem>
+<para>
+specifies the initial path prefix for a new user's home directory.  The user's
+name will be affixed to the end of default_home to create the new
+directory name if the -d option is not used when creating a new
+account.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-g default_group</term>
+<listitem>
+<para>
+specifies the group name or ID for a new user's initial group.  The named 
+group shall exist, and a numerical group ID shall have an existing entry.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-s default_shell</term>
+<listitem>
+<para>
+specifies the name of the new user's login shell.  The named program will be
+used for all future new user accounts.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>-c comment</term>
+<listitem>
+<para>
+specifies the new user's password file comment field value.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</REFSECT1>
+
+<REFSECT1>
+<TITLE>Application Usage</TITLE>
+<PARA>
+The <parameter>-D</parameter> 
+option will typically be used by system administration
+packages.  Most applications should not change defaults which will
+affect other applications and users.
+</PARA>
+</REFSECT1>
+
+</REFENTRY>

=== renamed file 'LSB/generic/command/userdel.sgml' => 'LSB/generic/command/userdel-1.0.sgml'
=== added file 'LSB/generic/command/userdel-5.0.sgml'
--- a/LSB/generic/command/userdel-5.0.sgml	1970-01-01 00:00:00 +0000
+++ b/LSB/generic/command/userdel-5.0.sgml	2012-03-13 09:06:39 +0000
@@ -0,0 +1,52 @@
+<REFENTRY id="userdel">
+<REFMETA><REFENTRYTITLE>userdel</REFENTRYTITLE></REFMETA>
+
+<REFNAMEDIV>
+<REFNAME>userdel</REFNAME>
+
+<REFPURPOSE>
+delete a user account and related files
+</REFPURPOSE>
+
+</REFNAMEDIV>
+
+<REFSYNOPSISDIV>
+<CMDSYNOPSIS>
+<COMMAND>userdel</COMMAND>
+<ARG>-r</ARG> <ARG choice=plain>login</ARG>
+</CMDSYNOPSIS>
+</REFSYNOPSISDIV>
+
+<REFSECT1>
+<TITLE>Description</TITLE>
+<PARA>
+Delete the user account named <REPLACEABLE
+CLASS="PARAMETER">login</REPLACEABLE>.  If there is also a group named
+<REPLACEABLE CLASS="PARAMETER">login</REPLACEABLE>, this command may
+delete the group as well, or may leave it alone.
+</PARA>
+<PARA>
+The <command>userdel</command> command is a system administration utility,
+see <XREF LINKEND="FHS-SYSADMIN">.
+</PARA>
+</REFSECT1>
+
+<REFSECT1>
+<title>Options</title>
+<variablelist>
+
+<varlistentry>
+<term>-r</term>
+<listitem>
+<para>
+removes files in the user's home directory along with the home
+directory itself.  Files located in other file system will have to be
+searched for and deleted manually.
+</para>
+</listitem>
+</varlistentry>
+
+</variablelist>
+</REFSECT1>
+
+</REFENTRY>

=== modified file 'mkcmdlist'
--- a/mkcmdlist	2010-09-16 08:17:53 +0000
+++ b/mkcmdlist	2012-03-13 09:06:39 +0000
@@ -28,8 +28,8 @@
 my $dbh = DBI->connect('DBI:mysql:database='.$LSBDB.';host='.$LSBDBHOST, $LSBUSER, $LSBDBPASSWD)
     or die "Couldn't connect to database: ".DBI->errstr;
 
-if( !$module ) { 
-    $moduleid=1; 
+if( !$module ) {
+    $moduleid=1;
 }
 else {
     ($moduleid) = $dbh->selectrow_array("SELECT SMid FROM SubModule WHERE SMname='$module'");
@@ -68,7 +68,36 @@
 
 for(1..$cth->rows) {
         $entry = $cth->fetchrow_hashref() or die "Fetchrow failed on $select query: ".DBI->errstr;
-        print "m4_include(".$entry->{'Cname'}.".sgml)\n";
+
+        # If there is a "Cname.sgml" file, just use it
+        if( -e $entry->{'Cname'}.".sgml" ) {
+            print "m4_include(".$entry->{'Cname'}.".sgml)\n";
+        }
+        else {
+            # Otherwise we have different files for different LSB versions
+            # Let's select the proper one
+            $Cname = $entry->{'Cname'};
+            $prev_ver = "";
+            $found = 0;
+
+            open( F, "ls -1 ".$Cname."*sgml |" );
+            while(<F>) {
+                if( /$Cname\-(.+)\.sgml/ ) {
+                    $ver = $1;
+                    if( $ver > $lsbversion ) {
+                        print "m4_include(".$Cname."-".$prev_ver.".sgml)\n";
+                        $found = 1;
+                        last;
+                    }
+                    $prev_ver = $ver;
+                }
+            }
+            close(F);
+
+            if( !$found ) {
+                print "m4_include(".$Cname."-".$prev_ver.".sgml)\n";
+            }
+        }
 }
 
 $cth->finish;



More information about the lsb-messages mailing list