Hi Ged,
Thank you for your helpful reply.
I can confirm that Fedora uses /usr/share/BackupPC as the install directory and 
is defined in config.pl as such.
$Conf{InstallDir} = '/usr/share/BackupPC';
 
 
I don't have a /usr/local/BackupPC directory on my system 
Here is the result of the grep you suggested:
 
--------------------------
$ sudo grep -r 'use lib' /usr/share/BackupPC/*
/usr/share/BackupPC/bin/BackupPC:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_Admin_SCGI:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_archive:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_archiveHost:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_archiveStart:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_attribPrint:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_backupDelete:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_backupDuplicate:use lib 
"/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_dump:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_fixupBackupSummary:use lib 
"/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_fsck:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_ls:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_migrateV3toV4:use lib 
"/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_nightly:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_poolCntPrint:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_refCountUpdate:use lib 
"/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_restore:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_rrdUpdate:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_sendEmail:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_serverMesg:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_tarCreate:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_tarExtract:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_zcat:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/bin/BackupPC_zipCreate:use lib "/usr/share/BackupPC/lib";
/usr/share/BackupPC/sbin/BackupPC_Admin:use lib "/usr/share/BackupPC/lib";
--------------------------
 
This is the content of /usr/share/BackupPC/lib/BackupPC 
 
sudo ls -l /usr/share/BackupPC/lib/BackupPC 
total 104
drwxr-xr-x. 1 root root   556 Nov 28 15:59 CGI
drwxr-xr-x. 1 root root    14 Nov 28 15:59 Config
-rw-r--r--. 1 root root 13916 Jul 17 01:00 DirOps.pm
drwxr-xr-x. 1 root root   142 Nov 28 15:59 Lang
-rw-r--r--. 1 root root 39670 Jul 17 01:00 Lib.pm
drwxr-xr-x. 1 root root    14 Nov 28 15:59 Storage
-rw-r--r--. 1 root root  2918 Jul 17 01:00 Storage.pm
-rw-r--r--. 1 root root 36516 Jul 17 01:00 View.pm
drwxr-xr-x. 1 root root    94 Nov 28 15:59 Xfer
-rw-r--r--. 1 root root  4994 Jul 17 01:00 Xfer.pm
drwxr-xr-x. 1 root root    26 Nov 28 15:59 Zip
 
grep -r 'BPC_DT_ALL'  /usr/share/BackupPC/lib/BackupPC/* 
/usr/share/BackupPC/lib/BackupPC/DirOps.pm:%EXPORT_TAGS = ('BPC_DT_ALL' => 
[@EXPORT, @EXPORT_OK]);
/usr/share/BackupPC/lib/BackupPC/View.pm:use BackupPC::DirOps qw( :BPC_DT_ALL );
 
Only DirOps.pm has a reference to ‘BPC_DT_ALL’,  there is no reference to 
'BPC_DT_ALL' in the module Lib.pm , could this be why Perl is failing when it 
encounters the "use BackupPC::Lib qw( :BPC_DT_ALL );"  statement.
 
I have also found a change that was introduced in Perl 5.39.1 - see 
https://perldoc.perl.org/5.39.1/perldelta#Calling-the-import-method-of-an-unknown-package-produces-an-error
 
Apparently calling an import method of an unknown package succeeded silently 
with Perl 5.38 but at 5.39 produces an error.  So perhaps this has always 
happened but is now being reported as part of the upgrade from Perl 5.38 to 
Perl 5.40.
 
Here is the output from Perl -V
 
$ perl -V | tail -n 8
  Compiled at Oct 15 2024 00:00:00
  @INC:
    /usr/local/lib64/perl5/5.40
    /usr/local/share/perl5/5.40
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5
$
 
 
I'll continue looking at this and am grateful for your suggestions.
Thanks
Alan



Sent from my iPhone
> On 10 Dec 2024, at 14:31, G.W. Haywood 
> <backup_at_jubileegroup_co_uk_cdp1g1fcmdccb4_jarq5...@icloud.com> wrote:
> Hi there,
> 
> On Tue, 10 Dec 2024, Alan wrote:
> 
>> Since upgrading from Fedora 40 to 41 I?ve started seeing the following Perl 
>> error message when the BackupPC_nightly and BackupPC_rrdUpdate routines are 
>> run:
>> 
>> Attempt to call undefined import method with arguments (":BPC_DT_ALL") via 
>> package "BackupPC::Lib" (Perhaps you forgot to load the package?) at 
>> /usr/share/BackupPC/bin/BackupPC_nightly line 89.
>> 
>> Attempt to call undefined import method with arguments (":BPC_DT_ALL") via 
>> package "BackupPC::Lib" (Perhaps you forgot to load the package?) at 
>> /usr/share/BackupPC/bin/BackupPC_rrdUpdate line 42.
>> 
>> 
>> In both cases the statement causing the error in the nightly and rrdUpdate 
>> scripts is:
>> 
>> use BackupPC::Lib qw( :BPC_DT_ALL );
>> 
>> I think this may be related to the move to Perl version 5.40.0 under Fedora 
>> 41.    Fedora 40 used Perl version 5.38.2 and no error occurs.
> 
> You're probably right.  Perl uses a couple of mechanisms to find
> libraries like those in
> 
> /usr/<something>/BackupPC/lib/
> 
> and it looks like your upgrade has scrambled some configuration.
> 
> The <something> will probably be either 'local' or 'share' and my
> *guess* is that it's the other one that you want.
> 
>> The (":BPC_DT_ALL") argument doesn?t seem to appear in any other
>> scripts  Can this error be ignored as it doesn?t seem to affect
>> anything other than generate that error message?
> 
> That value is a hash key defined in
> 
> /usr/local/BackupPC/lib/BackupPC/DirOps.pm
> 
> Personally I wouldn't ignore it, as I would expect other problems, I
> would look into the Perl library path configuration to see what has
> been changed.  If you run
> 
> $ grep -r 'use lib' /usr/local/BackupPC/*
> 
> you should see the same path multiple times, one for each Perl script.
> I'm *guessing* that the path in the 'use lib' directive will not be
> the correct path to your BackupPC library directory.  These paths are
> set up when BackupPC is installed on your system.  You can make sure
> that it is, add it to Perl's configured paths, or maybe add a symlink.
> 
> Here's the output from my system:
> 
> 8<----------------------------------------------------------------------
> $ grep -r 'use lib' /usr/local/BackupPC/*
> /usr/local/BackupPC/bin/BackupPC_archive:use lib "/usr/local/BackupPC/lib";
> /usr/local/BackupPC/bin/BackupPC_nightly:use lib "/usr/local/BackupPC/lib";
> ... snipped lots more lines ...
> /usr/local/BackupPC/bin/BackupPC_zcat:use lib "/usr/local/BackupPC/lib";
> /usr/local/BackupPC/bin/BackupPC_dump:use lib "/usr/local/BackupPC/lib";
> 8<----------------------------------------------------------------------
> 
> Again *assuming* my guesses are correct there are at least three ways
> to fix it below.
> 
> FIX 1.  You *could* just edit all those files to correct the path.
> 
> 
> FIX 2.  If you run
> 
> perl -V
> 
> you will see a long list of configuration stuff.  The last few lines
> (about ten lines) will look *something* *like* this:
> 
> 8<----------------------------------------------------------------------
> $ perl -V | tail -n 11
>  Compiled at Nov 25 2023 21:03:14
>  @INC:
>    /etc/perl
>    /usr/local/lib/aarch64-linux-gnu/perl/5.32.1
>    /usr/local/share/perl/5.32.1
>    /usr/lib/aarch64-linux-gnu/perl5/5.32
>    /usr/share/perl5
>    /usr/lib/aarch64-linux-gnu/perl-base
>    /usr/lib/aarch64-linux-gnu/perl/5.32
>    /usr/share/perl/5.32
>    /usr/local/lib/site_perl
> $ 8<----------------------------------------------------------------------
> 
> you could if you wish add
> 
> /usr/share/BackupPC/lib/ (or whatever the correct path is)
> 
> to the list so Perl always knows it.  Most of the time Perl doesn't
> need to know that path so it isn't *necessary* to do it that way.
> 
> 
> FIX 3.  Instead of editing BackupPC files or changing Perl's paths, if
> it's as simple as a change from
> 
> /usr/share/BackupPC/
> /usr/local/BackupPC/
> 
> then you could kludge it with a symlink.  For example if your lib
> files are in
> 
> /usr/share/BackupPC/lib/
> 
> but your Perl is being told to look in
> 
> /usr/local/BackupPC/lib/
> 
> ant there's no BackupPC directory in /usr/local/ you could simply
> insert a symlink like this:
> 
> # cd /usr/local
> # ln -s /usr/share/BackupPC
> #
> 
> That's a horrible kludge, but it's quick and I've done worse in my time.
> 
> 
> Finally it could be something a bit like what I've described but not
> exactly.  You might be able to figure it out from what I've written
> but if you can't, let us see the output of the 'grep' commands above
> and anything else you think might help... :)
> 
> --
> 
> 73,
> Ged.
> 
> 
> _______________________________________________
> BackupPC-users mailing list
> BackupPC-users@lists.sourceforge.net
> List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
> Wiki:    https://github.com/backuppc/backuppc/wiki
> Project: https://backuppc.github.io/backuppc/
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to