Skip to content

Commit

Permalink
Make the MAN_SUBDIR setting overide the name of the directry the man …
Browse files Browse the repository at this point in the history
…pages are placed in.
  • Loading branch information
hakanardo committed Jan 14, 2014
1 parent c5bc9fc commit 83b344d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/config.xml
Expand Up @@ -2689,7 +2689,7 @@ EXTRA_PACKAGES=times
]]>
</docs>
</option>
<option type='string' id='MAN_SUBDIR' format='string' defval='man3' depends='GENERATE_MAN'>
<option type='string' id='MAN_SUBDIR' format='string' defval='' depends='GENERATE_MAN'>
<docs>
<![CDATA[
The \c MAN_SUBDIR tag determines the name of the directory created within \c MAN_OUTPUT
Expand Down
20 changes: 15 additions & 5 deletions src/mangen.cpp
Expand Up @@ -64,9 +64,19 @@ static QCString getExtension()
return ext;
}

static QCString getSubdir()
{
QCString dir = Config_getString("MAN_SUBDIR");
if (dir.isEmpty())
{
dir = "man" + getExtension();
}
return dir;
}

ManGenerator::ManGenerator() : OutputGenerator()
{
dir=Config_getString("MAN_OUTPUT")+"/man" + getExtension();
dir=Config_getString("MAN_OUTPUT") + "/" + getSubdir();
firstCol=TRUE;
paragraph=TRUE;
col=0;
Expand Down Expand Up @@ -106,10 +116,10 @@ void ManGenerator::init()
err("Could not create output directory %s\n",manOutput.data());
exit(1);
}
d.setPath(manOutput+"/man"+ext);
if (!d.exists() && !d.mkdir(manOutput+"/man"+ext))
d.setPath(manOutput + "/" + getSubdir());
if (!d.exists() && !d.mkdir(manOutput + "/" + getSubdir()))
{
err("Could not create output directory %s/man%s\n",manOutput.data(),ext.data());
err("Could not create output directory %s/%s\n",manOutput.data(), getSubdir().data());
exit(1);
}
createSubDirs(d);
Expand Down Expand Up @@ -445,7 +455,7 @@ void ManGenerator::startDoxyAnchor(const char *,const char *manName,
FTextStream linkstream;
linkstream.setDevice(&linkfile);
//linkstream.setEncoding(QTextStream::UnicodeUTF8);
linkstream << ".so man" << getExtension() << "/" << buildFileName( manName ) << endl;
linkstream << ".so " << getSubdir() << "/" << buildFileName( manName ) << endl;
}
}
linkfile.close();
Expand Down

0 comments on commit 83b344d

Please sign in to comment.