Dpkg.pm 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # This program is free software; you can redistribute it and/or modify
  2. # it under the terms of the GNU General Public License as published by
  3. # the Free Software Foundation; either version 2 of the License, or
  4. # (at your option) any later version.
  5. #
  6. # This program is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. # GNU General Public License for more details.
  10. #
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  13. package Dpkg;
  14. =encoding utf8
  15. =head1 NAME
  16. Dpkg - module with core variables
  17. =head1 DESCRIPTION
  18. The Dpkg module provides a set of variables with information concerning
  19. this system installation.
  20. =cut
  21. use strict;
  22. use warnings;
  23. our $VERSION = '1.01';
  24. our @EXPORT_OK = qw(
  25. $PROGNAME
  26. $PROGVERSION
  27. $CONFDIR
  28. $ADMINDIR
  29. $LIBDIR
  30. $DATADIR
  31. );
  32. our @EXPORT = qw(
  33. $version
  34. $progname
  35. $admindir
  36. $dpkglibdir
  37. $pkgdatadir
  38. );
  39. use Exporter qw(import);
  40. =head1 VARIABLES
  41. =over 4
  42. =item $Dpkg::PROGNAME
  43. Contains the name of the current program.
  44. =item $Dpkg::PROGVERSION
  45. Contains the version of the dpkg suite.
  46. =item $Dpkg::CONFDIR
  47. Contains the path to the dpkg system configuration directory.
  48. =item $Dpkg::ADMINDIR
  49. Contains the path to the dpkg database directory.
  50. =item $Dpkg::LIBDIR
  51. Contains the path to the dpkg methods and plugins directory.
  52. =item $Dpkg::DATADIR
  53. Contains the path to the dpkg architecture tables directory.
  54. =back
  55. =cut
  56. our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)};
  57. # The following lines are automatically fixed at install time
  58. our $PROGVERSION = '1.18.x';
  59. our $CONFDIR = '/etc/dpkg';
  60. our $ADMINDIR = '/var/lib/dpkg';
  61. our $LIBDIR = '.';
  62. our $DATADIR = '..';
  63. $DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR};
  64. # XXX: Backwards compatibility, to be removed on VERSION 2.00.
  65. ## no critic (Variables::ProhibitPackageVars)
  66. our $version = $PROGVERSION;
  67. our $admindir = $ADMINDIR;
  68. our $dpkglibdir = $LIBDIR;
  69. our $pkgdatadir = $DATADIR;
  70. ## use critic
  71. =head1 CHANGES
  72. =head2 Version 1.01
  73. New variables: $PROGNAME, $PROGVERSION, $CONFDIR, $ADMINDIR, $LIBDIR and
  74. $DATADIR.
  75. Deprecated variables: $version, $admindir, $dpkglibdir and $pkgdatadir.
  76. =head2 Version 1.00
  77. Mark the module as public.
  78. =cut
  79. 1;