/usr/share/perl5/Debian/DocBase/Common.pm is in doc-base 0.10.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | # vim:cindent:ts=2:sw=2:et:fdm=marker:cms=\ #\ %s
#
# $Id: Common.pm 216 2011-02-20 22:42:12Z robert $
package Debian::DocBase::Common;
use Exporter();
use strict;
use warnings;
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw($DATA_DIR $CONTROL_DIR $LOCAL_CONTROL_DIR $VAR_CTRL_DIR $OMF_DIR
$DOCBASE_SECTIONS_MAP $DOCBASE_VALID_SECTIONS_LIST $CTIME_FIELDNO
$DB_FILES $DB_STATUS
@SUPPORTED_FORMATS @NEED_INDEX_FORMATS
$FLD_DOCUMENT $FLD_VERSION $FLD_SECTION $FLD_TITLE $FLD_AUTHOR $FLD_ABSTRACT
$FLD_FORMAT $FLD_INDEX $FLD_FILES
%FIELDS_DEF
$FLDDEF_TYPE
$FLDTYPE_MAIN $FLDTYPE_FORMAT
$FLDDEF_REQUIRED
$FLDDEF_MULTILINE
$opt_verbose $opt_debug $exitval $opt_rootdir $opt_update_menus $on_fatal_handler
$ERR_NONE $ERR_USAGE $ERR_PARSING $ERR_FSACCESS $ERR_PROCESSING $ERR_INTERNAL $ERR_DATABASE
GetFldKeys
);
our $DATA_DIR = "/var/lib/doc-base/info";
our $DB_FILES = "$DATA_DIR/files.yml";
our $DB_STATUS = "$DATA_DIR/status.yml";
our $CONTROL_DIR = "/usr/share/doc-base";
our $DOCBASE_SECTIONS_MAP = "$CONTROL_DIR/data/doc-base.map";
our $DOCBASE_VALID_SECTIONS_LIST = "$CONTROL_DIR/data/section.list";
our $LOCAL_CONTROL_DIR = "/etc/doc-base/documents";
our $VAR_CTRL_DIR = "/var/lib/doc-base/documents";
our $CTIME_FIELDNO = 10;
our $OMF_DIR = "/var/lib/doc-base/omf";
our $ERR_NONE = 0;
our $ERR_USAGE = 1;
our $ERR_PARSING = 2;
our $ERR_PROCESSING = 3;
our $ERR_FSACCESS = 4; # file system access
our $ERR_INTERNAL = 5;
our $ERR_DATABASE = 10; # manipulating *.yml data base files, note the value is used in postinst
# ---configuration-part---
# All formats handled by the doc-base
our @SUPPORTED_FORMATS = (
'html',
'text',
'pdf',
'postscript',
'info',
'dvi',
'debiandoc-sgml'
);
# Formats which need the Index: field
our @NEED_INDEX_FORMATS = (
'html',
'info'
);
our $FLD_DOCUMENT = 'document';
our $FLD_VERSION = 'version';
our $FLD_SECTION = 'section';
our $FLD_TITLE = 'title';
our $FLD_AUTHOR = 'author';
our $FLD_ABSTRACT = 'abstract';
our $FLD_FORMAT = 'format';
our $FLD_INDEX = 'index';
our $FLD_FILES = 'files';
# doc-base control file fields definitions
our $FLDDEF_TYPE = 'type';
our $FLDTYPE_MAIN = 1;
our $FLDTYPE_FORMAT = 2;
our $FLDDEF_REQUIRED = 'required';
our $FLDDEF_MULTILINE = 'multiline';
our $FLDDEF_POSITION = 'position';
# Fields in doc-base file:
our %FIELDS_DEF = (
# Main fields:
$FLD_DOCUMENT => {
$FLDDEF_POSITION => 0,
$FLDDEF_TYPE => $FLDTYPE_MAIN,
$FLDDEF_REQUIRED => 1,
$FLDDEF_MULTILINE => 0
},
$FLD_VERSION => {
$FLDDEF_POSITION => 1,
$FLDDEF_TYPE => $FLDTYPE_MAIN,
$FLDDEF_REQUIRED => 0,
$FLDDEF_MULTILINE => 0
},
$FLD_SECTION => {
$FLDDEF_POSITION => 2,
$FLDDEF_TYPE => $FLDTYPE_MAIN,
$FLDDEF_REQUIRED => 0,
$FLDDEF_MULTILINE => 0
},
$FLD_TITLE => {
$FLDDEF_POSITION => 3,
$FLDDEF_TYPE => $FLDTYPE_MAIN,
$FLDDEF_REQUIRED => 1,
$FLDDEF_MULTILINE => 1
},
$FLD_AUTHOR => {
$FLDDEF_POSITION => 4,
$FLDDEF_TYPE => $FLDTYPE_MAIN,
$FLDDEF_REQUIRED => 0,
$FLDDEF_MULTILINE => 1
},
$FLD_ABSTRACT => {
$FLDDEF_POSITION => 5,
$FLDDEF_TYPE => $FLDTYPE_MAIN,
$FLDDEF_REQUIRED => 0,
$FLDDEF_MULTILINE => 1
},
# Format fields:
$FLD_FORMAT => {
$FLDDEF_POSITION => 6,
$FLDDEF_TYPE => $FLDTYPE_FORMAT,
$FLDDEF_REQUIRED => 1,
$FLDDEF_MULTILINE => 0
},
$FLD_INDEX => {
$FLDDEF_POSITION => 7,
$FLDDEF_TYPE => $FLDTYPE_FORMAT,
$FLDDEF_REQUIRED => 0,
$FLDDEF_MULTILINE => 0
},
$FLD_FILES => {
$FLDDEF_POSITION => 8,
$FLDDEF_TYPE => $FLDTYPE_FORMAT,
$FLDDEF_REQUIRED => 0, #
$FLDDEF_MULTILINE => 1
}
);
sub GetFldKeys($) {
my $fldtype = shift;
my @fldkeys = sort { $FIELDS_DEF{$a}->{$FLDDEF_POSITION} <=> $FIELDS_DEF{$b}->{$FLDDEF_POSITION} }
grep { $FIELDS_DEF{$_}->{$FLDDEF_TYPE} eq $fldtype }
keys %FIELDS_DEF;
return @fldkeys;
}
# ---end-of-configuration-part---
# ---global-variables---
our $opt_verbose = 0;
our $opt_debug = 0;
our $opt_update_menus = 1;
our $opt_rootdir = "";
our $exitval = 0;
our $on_fatal_handler = undef;
1;
|