Dpkg.pm 2.3 KB

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