Dpkg.pm 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.02';
  24. our @EXPORT_OK = qw(
  25. $PROGNAME
  26. $PROGVERSION
  27. $PROGTAR
  28. $CONFDIR
  29. $ADMINDIR
  30. $LIBDIR
  31. $DATADIR
  32. );
  33. our @EXPORT = qw(
  34. $version
  35. $progname
  36. $admindir
  37. $dpkglibdir
  38. $pkgdatadir
  39. );
  40. use Exporter qw(import);
  41. =head1 VARIABLES
  42. =over 4
  43. =item $Dpkg::PROGNAME
  44. Contains the name of the current program.
  45. =item $Dpkg::PROGVERSION
  46. Contains the version of the dpkg suite.
  47. =item $Dpkg::PROGTAR
  48. Contains the name of the system GNU tar program.
  49. =item $Dpkg::CONFDIR
  50. Contains the path to the dpkg system configuration directory.
  51. =item $Dpkg::ADMINDIR
  52. Contains the path to the dpkg database directory.
  53. =item $Dpkg::LIBDIR
  54. Contains the path to the dpkg methods and plugins directory.
  55. =item $Dpkg::DATADIR
  56. Contains the path to the dpkg architecture tables directory.
  57. =back
  58. =cut
  59. our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)};
  60. # The following lines are automatically fixed at install time
  61. our $PROGVERSION = '1.18.x';
  62. our $PROGTAR = $ENV{DPKG_PROGTAR} // 'tar';
  63. our $CONFDIR = '/etc/dpkg';
  64. our $ADMINDIR = '/var/lib/dpkg';
  65. our $LIBDIR = '.';
  66. our $DATADIR = $ENV{DPKG_DATADIR} // '..';
  67. # XXX: Backwards compatibility, to be removed on VERSION 2.00.
  68. ## no critic (Variables::ProhibitPackageVars)
  69. our $version = $PROGVERSION;
  70. our $admindir = $ADMINDIR;
  71. our $dpkglibdir = $LIBDIR;
  72. our $pkgdatadir = $DATADIR;
  73. ## use critic
  74. =head1 CHANGES
  75. =head2 Version 1.02 (dpkg 1.18.11)
  76. New variable: $PROGTAR.
  77. =head2 Version 1.01 (dpkg 1.17.0)
  78. New variables: $PROGNAME, $PROGVERSION, $CONFDIR, $ADMINDIR, $LIBDIR and
  79. $DATADIR.
  80. Deprecated variables: $version, $admindir, $dpkglibdir and $pkgdatadir.
  81. =head2 Version 1.00 (dpkg 1.15.6)
  82. Mark the module as public.
  83. =cut
  84. 1;