Changeset 1661 in ProjectBuilder for devel/pb-modules/lib/ProjectBuilder/Base.pm


Ignore:
Timestamp:
Oct 21, 2012, 2:38:01 PM (12 years ago)
Author:
Bruno Cornec
Message:
  • Introduce a pb_exit function and use it in all apps
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Base.pm

    r1660 r1661  
    4040
    4141our @ISA = qw(Exporter);
    42 our @EXPORT = qw(pb_mkdir_p pb_system pb_rm_rf pb_get_date pb_log pb_log_init pb_get_uri pb_get_content pb_set_content pb_display_file pb_syntax_init pb_syntax pb_temp_init pb_get_arch pb_get_osrelease pb_check_requirements pb_check_req pb_path_expand $pbdebug $pbLOG $pbdisplaytype $pblocale);
     42our @EXPORT = qw(pb_mkdir_p pb_system pb_rm_rf pb_get_date pb_log pb_log_init pb_get_uri pb_get_content pb_set_content pb_display_file pb_syntax_init pb_syntax pb_temp_init pb_get_arch pb_get_osrelease pb_check_requirements pb_check_req pb_path_expand pb_exit $pbdebug $pbLOG $pbdisplaytype $pblocale);
    4343($VERSION,$REVISION) = pb_version_init();
    4444
     
    390390};
    391391if ($@) {
    392     # No Pod::Usage found not printing usage. Ole perl only
     392    # No Pod::Usage found not printing usage. Old perl only
     393    pb_exit();
    393394} else {
    394395    pod2usage(  -message => $pbsynmsg,
     
    433434    pb_mkdir_p("$ENV{'TMPDIR'}/$template");
    434435} else {
    435     $cleanup = 0 if ($pbdebug >= 1);
     436    $cleanup = 0 if ($pbdebug gt 1);
    436437    $ENV{'PBTMP'} = tempdir( "pb.XXXXXXXXXX", DIR => $ENV{'TMPDIR'}, CLEANUP => $cleanup );
    437438}
     
    558559}
    559560
     561
     562=item B<pb_exit>
     563
     564Fundtion to call before exiting pb so cleanup is done
     565
     566=cut
     567
     568sub pb_exit {
     569
     570my $ret = shift || 0;
     571pb_log(0,"Please remove manually $ENV{'PBTMP'} after debug analysis\n" if ($pbdebug gt 1);
     572exit($ret);
     573}
     574
    560575=back
    561576
Note: See TracChangeset for help on using the changeset viewer.