Added some code to peer into a data structure in Maemian/Schedule.pm. Also added the
[maemian] / nokia-lintian / checks / common_data.pm
1 #! /usr/bin/perl -w
2
3 package common_data;
4 use base qw(Exporter);
5
6 our @EXPORT = qw
7 (
8    %known_archs %known_sections %known_non_us_parts %known_archive_parts
9    %known_prios %known_source_fields %known_binary_fields %known_udeb_fields
10    %known_obsolete_fields %known_essential %known_build_essential
11    %known_obsolete_packages %known_obsolete_emacs %known_virtual_packages
12    %known_libstdcs %known_tcls %known_tclxs %known_tks %known_tkxs
13    %known_libpngs %known_x_metapackages
14    %non_standard_archs %all_cpus %all_oses
15    %known_doc_base_formats
16 );
17
18 # To let "perl -cw" test know we use these variables;
19 use vars qw
20 (
21   %known_archs %known_sections %known_non_us_parts %known_archive_parts
22   %known_prios %known_source_fields %known_binary_fields %known_udeb_fields
23   %known_obsolete_fields %known_essential %known_build_essential
24   %known_obsolete_emacs %known_virtual_packages
25   %known_libstdcs %known_tcls %known_tclxs %known_tks %known_tkxs
26   %known_libpngs %known_x_metapackages
27   %all_cpus %all_oses
28   %known_doc_base_formats
29 );
30
31 # simple defines for commonly needed data
32
33 # From /usr/share/dpkg/cputable, included here to make lintian results
34 # consistent no matter what dpkg one has installed.
35 %all_cpus = map { $_ => 1 }
36     ('i386', 'ia64', 'alpha', 'amd64', 'armeb', 'arm', 'hppa', 'm32r', 'm68k',
37      'mips', 'mipsel', 'powerpc', 'ppc64', 's390', 's390x', 'sh3', 'sh3eb',
38      'sh4', 'sh4eb', 'sparc');
39
40 # From /usr/share/dpkg/triplettable, included here to make lintian results
41 # consistent no matter what dpkg one has installed.  This lists all of the
42 # foo-<cpu> rules.  Note that linux is not present in the current dpkg and
43 # hence is not present here.
44 %all_oses = map { $_ => 1 }
45     ('kfreebsd', 'knetbsd', 'hurd', 'freebsd', 'openbsd', 'netbsd', 'darwin',
46      'solaris');
47
48 # Yes, this includes combinations that are rather unlikely to ever exist, like
49 # hurd-sh3, but the chances of those showing up as errors are rather low and
50 # this reduces the necessary updating.
51 #
52 # armel and lpia are special cases, so handle them separately here.  (They're
53 # handled separately in /usr/share/dpkg/triplettable.)  any and all are also
54 # special cases.
55 %known_archs = map { $_ => 1 }
56     grep { !$known_archs{$_} }
57         (keys %all_cpus,
58          map { my $os = $_; map { "$os-$_" } keys %all_cpus } keys %all_oses),
59     ('armel', 'lpia', 'any', 'all');
60
61 %known_sections = map { $_ => 1 }
62     ('admin', 'comm', 'devel', 'doc', 'editors', 'electronics',
63      'embedded', 'games', 'gnome', 'graphics', 'hamradio', 'interpreters',
64      'kde', 'libdevel', 'libs', 'mail', 'math', 'misc', 'net', 'news',
65      'oldlibs', 'otherosfs', 'perl', 'python', 'science', 'shells',
66      'sound', 'tex', 'text', 'utils', 'web', 'x11'
67     );
68
69 %known_non_us_parts = map { $_ => 1 } ('non-free', 'contrib', 'main' );
70
71 %known_archive_parts = map { $_ => 1 }
72     ('non-free', 'contrib', 'non-US', 'non-us' );
73
74 %known_prios = map { $_ => 1 }
75     ('required', 'important', 'standard', 'optional', 'extra');
76
77 # The Ubuntu original-maintainer field is handled separately.
78 %known_source_fields = map { $_ => 1 }
79     ('source', 'version', 'maintainer', 'binary', 'architecture',
80      'standards-version', 'files', 'build-depends', 'build-depends-indep',
81      'build-conflicts', 'build-conflicts-indep', 'format', 'origin',
82      'uploaders', 'python-version', 'autobuild', 'homepage', 'vcs-arch',
83      'vcs-bzr', 'vcs-cvs', 'vcs-darcs', 'vcs-git', 'vcs-hg', 'vcs-mtn',
84      'vcs-svn', 'vcs-browser', 'dm-upload-allowed', 'bugs', 'checksums-sha1',
85      'checksums-sha256', 'checksums-md5');
86
87 # The Ubuntu original-maintainer field is handled separately.
88 %known_binary_fields = map { $_ => 1 }
89     ('package', 'version', 'architecture', 'depends', 'pre-depends',
90      'recommends', 'suggests', 'enhances', 'conflicts', 'provides',
91      'replaces', 'breaks', 'essential', 'maintainer', 'section', 'priority',
92      'source', 'description', 'installed-size', 'python-version', 'homepage',
93      'bugs', 'origin');
94
95 # The Ubuntu original-maintainer field is handled separately.
96 %known_udeb_fields = map { $_ => 1 }
97     ('package', 'version', 'architecture', 'subarchitecture', 'depends',
98      'recommends', 'enhances', 'provides', 'replaces', 'breaks', 'replaces',
99      'maintainer', 'section', 'priority', 'source', 'description',
100      'installed-size', 'kernel-version', 'installer-menu-item', 'bugs',
101      'origin');
102
103 %known_obsolete_fields = map { $_ => 1 }
104     ('revision', 'package-revision', 'package_revision',
105      'recommended', 'optional', 'class');
106
107 %known_essential = map { $_ => 1 }
108     ('base-files', 'base-passwd', 'bash', 'bsdutils', 'coreutils',
109      'debianutils', 'diff', 'dpkg', 'e2fsprogs', 'findutils', 'grep', 'gzip',
110      'hostname', 'login', 'mktemp', 'mount', 'ncurses-base', 'ncurses-bin',
111      'perl-base', 'sed', 'sysvinit', 'sysvinit-utils', 'tar', 'util-linux');
112
113 %known_build_essential = map { $_ => 1 }
114     ('libc6-dev', 'libc-dev', 'gcc', 'g++', 'make', 'dpkg-dev');
115
116 # Still in the archive but shouldn't be the primary Emacs dependency.
117 %known_obsolete_emacs = map { $_ => 1 }
118     ('emacs21');
119
120 # Used only (at least lintian 1.23.1) for giving a warning about a
121 # virtual-only dependency
122 %known_virtual_packages = map { $_ => 1 }
123     ('x-terminal-emulator', 'x-window-manager', 'xserver', 'awk', 'c-compiler',
124      'c-shell', 'dotfile-module', 'emacsen', 'fortran77-compiler',
125      'ftp-server', 'httpd', 'ident-server', 'info-browser',
126      'ispell-dictionary', 'kernel-image',
127      'linux-kernel-log-daemon', 'lambdamoo-core', 'lambdamoo-server',
128      'libc-dev', 'man-browser', 'pdf-preview', 'pdf-viewer',
129      'postscript-preview', 'postscript-viewer',
130      'system-log-daemon', 'tclsh', 'telnet-client', 'telnet-server',
131      'time-daemon', 'ups-monitor', 'wish', 'wordlist', 'www-browser',
132      'imap-client', 'imap-server', 'mail-reader', 'mail-transport-agent',
133      'news-reader', 'news-transport-system', 'pop3-server',
134      'mp3-encoder', 'mp3-decoder',
135      'java-compiler', 'java2-compiler',
136      'java-virtual-machine',
137      'java1-runtime', 'java2-runtime',
138      'dict-client',
139      'foomatic-data',
140      'audio-mixer', 'x-audio-mixer',
141      'debconf-2.0',
142      'aspell-dictionary',
143      'radius-server',
144      'libgl-dev', 'libglu-dev',
145      'automaken'
146     );
147
148 %known_libstdcs = map { $_ => 1 }
149     ('libstdc++2.9-glibc2.1', 'libstdc++2.10', 'libstdc++2.10-glibc2.2',
150      'libstdc++3', 'libstdc++3.0', 'libstdc++4', 'libstdc++5',
151      'libstdc++6', 'lib64stdc++6',
152     );
153
154 %known_tcls = map { $_ => 1 }
155     ( 'tcl74', 'tcl8.0', 'tcl8.2', 'tcl8.3', 'tcl8.4', 'tcl8.5', );
156
157 %known_tclxs = map { $_ => 1 }
158     ( 'tclx76', 'tclx8.0.4', 'tclx8.2', 'tclx8.3', 'tclx8.4', );
159
160 %known_tks = map { $_ => 1 }
161     ( 'tk40', 'tk8.0', 'tk8.2', 'tk8.3', 'tk8.4', 'tk8.5', );
162
163 %known_tkxs = map { $_ => 1 }
164     ( 'tkx8.2', 'tkx8.3', );
165
166 %known_libpngs = map { $_ => 1 }
167     ( 'libpng12-0', 'libpng2', 'libpng3', );
168
169 %known_x_metapackages = map { $_ => 1 }
170     ( 'x-window-system', 'x-window-system-dev', 'x-window-system-core',
171       'xorg', 'xorg-dev', );
172
173 # Supported documentation formats for doc-base files.
174 %known_doc_base_formats = map { $_ => 1 }
175     ( 'html', 'text', 'pdf', 'postscript', 'info', 'dvi', 'debiandoc-sgml' );
176
177 1;
178
179 # Local Variables:
180 # indent-tabs-mode: nil
181 # cperl-indent-level: 4
182 # End:
183 # vim: syntax=perl sw=4 sts=4 ts=4 et shiftround