diff options
4 files changed, 45 insertions, 323 deletions
diff --git a/meta-networking/recipes-extended/mime-construct/files/Signal.pm b/meta-networking/recipes-extended/mime-construct/files/Signal.pm deleted file mode 100644 index 9280e88681..0000000000 --- a/meta-networking/recipes-extended/mime-construct/files/Signal.pm +++ /dev/null | |||
| @@ -1,132 +0,0 @@ | |||
| 1 | # $Id: Signal.pm,v 1.4 1998-10-27 16:16:13-05 roderick Exp $ | ||
| 2 | # | ||
| 3 | # Copyright (c) 1997 Roderick Schertler. All rights reserved. This | ||
| 4 | # program is free software; you can redistribute it and/or modify it | ||
| 5 | # under the same terms as Perl itself. | ||
| 6 | |||
| 7 | package IPC::Signal; | ||
| 8 | |||
| 9 | use 5.003_94; # __PACKAGE__ | ||
| 10 | use strict; | ||
| 11 | use vars qw($VERSION @ISA @EXPORT_OK $AUTOLOAD %Sig_num @Sig_name); | ||
| 12 | |||
| 13 | require Exporter; | ||
| 14 | |||
| 15 | $VERSION = '1.00'; | ||
| 16 | @ISA = qw(Exporter); | ||
| 17 | @EXPORT_OK = qw(sig_num sig_name sig_translate_setup %Sig_num @Sig_name); | ||
| 18 | %Sig_num = (); | ||
| 19 | @Sig_name = (); | ||
| 20 | |||
| 21 | sub sig_num ($); | ||
| 22 | sub sig_name ($); | ||
| 23 | |||
| 24 | sub sig_translate_setup () { | ||
| 25 | return if %Sig_num && @Sig_name; | ||
| 26 | |||
| 27 | require Config; | ||
| 28 | |||
| 29 | # In 5.005 the sig_num entries are comma separated and there's a | ||
| 30 | # trailing 0. | ||
| 31 | my $num = $Config::Config{'sig_num'}; | ||
| 32 | if ($num =~ s/,//g) { | ||
| 33 | $num =~ s/\s+0$//; | ||
| 34 | } | ||
| 35 | |||
| 36 | my @name = split ' ', $Config::Config{'sig_name'}; | ||
| 37 | my @num = split ' ', $num; | ||
| 38 | |||
| 39 | @name or die 'No signals defined'; | ||
| 40 | @name == @num or die 'Signal name/number mismatch'; | ||
| 41 | |||
| 42 | @Sig_num{@name} = @num; | ||
| 43 | keys %Sig_num == @name or die 'Duplicate signal names present'; | ||
| 44 | for (@name) { | ||
| 45 | $Sig_name[$Sig_num{$_}] = $_ | ||
| 46 | unless defined $Sig_name[$Sig_num{$_}]; | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | # This autoload routine just is just for sig_num() and sig_name(). It | ||
| 51 | # calls sig_translate_setup() and then snaps the real function definitions | ||
| 52 | # into place. | ||
| 53 | |||
| 54 | sub AUTOLOAD { | ||
| 55 | if ($AUTOLOAD ne __PACKAGE__ . '::sig_num' | ||
| 56 | && $AUTOLOAD ne __PACKAGE__ . '::sig_name') { | ||
| 57 | require Carp; | ||
| 58 | Carp::croak("Undefined subroutine &$AUTOLOAD called"); | ||
| 59 | } | ||
| 60 | sig_translate_setup; | ||
| 61 | *sig_num = sub ($) { $Sig_num{$_[0]} }; | ||
| 62 | *sig_name = sub ($) { $Sig_name[$_[0]] }; | ||
| 63 | goto &$AUTOLOAD; | ||
| 64 | } | ||
| 65 | |||
| 66 | 1 | ||
| 67 | |||
| 68 | __END__ | ||
| 69 | |||
| 70 | =head1 NAME | ||
| 71 | |||
| 72 | IPC::Signal - Utility functions dealing with signals | ||
| 73 | |||
| 74 | =head1 SYNOPSIS | ||
| 75 | |||
| 76 | $number = sig_num $name; | ||
| 77 | $name = sig_name $number; | ||
| 78 | |||
| 79 | sig_translate_setup; | ||
| 80 | $number = $Sig_num{$name}; | ||
| 81 | $name = $Sig_name[$number]; | ||
| 82 | |||
| 83 | =head1 DESCRIPTION | ||
| 84 | |||
| 85 | This module contains utility functions for dealing with signals. | ||
| 86 | |||
| 87 | Nothing is exported by default. | ||
| 88 | |||
| 89 | =over | ||
| 90 | |||
| 91 | =item B<sig_num> I<chopped-signal-name> | ||
| 92 | |||
| 93 | Returns the signal number of the signal whose name (sans C<SIG>) is | ||
| 94 | I<chopped-signal-name>, or undef if there is no such signal. | ||
| 95 | |||
| 96 | This function is prototyped to take a single scalar argument. | ||
| 97 | |||
| 98 | =item B<sig_name> I<signal-number> | ||
| 99 | |||
| 100 | Returns the chopped signal name (like C<HUP>) of signal number | ||
| 101 | I<signal-number>, or undef if there is no such signal. | ||
| 102 | |||
| 103 | This function is prototyped to take a single scalar argument. | ||
| 104 | |||
| 105 | =item B<sig_translate_setup> | ||
| 106 | |||
| 107 | If you want to use the @Sig_name and %Sig_num variables directly you must | ||
| 108 | call B<sig_translate_setup> to initialize them. This isn't necessary if | ||
| 109 | you only use the function interfaces sig_name() and sig_num(). | ||
| 110 | |||
| 111 | This function is prototyped to take no arguments. | ||
| 112 | |||
| 113 | =item B<%Sig_num> | ||
| 114 | |||
| 115 | A hash with chopped signal name keys (like C<HUP>) and integer signal | ||
| 116 | number values. | ||
| 117 | |||
| 118 | =item B<@Sig_name> | ||
| 119 | |||
| 120 | An array mapping signal numbers to chopped signal names (like C<HUP>). | ||
| 121 | |||
| 122 | =back | ||
| 123 | |||
| 124 | =head1 AUTHOR | ||
| 125 | |||
| 126 | Roderick Schertler <F<roderick@argon.org>> | ||
| 127 | |||
| 128 | =head1 SEE ALSO | ||
| 129 | |||
| 130 | perl(1). | ||
| 131 | |||
| 132 | =cut | ||
diff --git a/meta-networking/recipes-extended/mime-construct/files/WaitStat.pm b/meta-networking/recipes-extended/mime-construct/files/WaitStat.pm deleted file mode 100644 index 337e52a705..0000000000 --- a/meta-networking/recipes-extended/mime-construct/files/WaitStat.pm +++ /dev/null | |||
| @@ -1,178 +0,0 @@ | |||
| 1 | # $Id: WaitStat.pm,v 1.3 1999-10-21 12:39:43-04 roderick Exp $ | ||
| 2 | # | ||
| 3 | # Copyright (c) 1997 Roderick Schertler. All rights reserved. This | ||
| 4 | # program is free software; you can redistribute it and/or modify it | ||
| 5 | # under the same terms as Perl itself. | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Proc::WaitStat - Interpret and act on wait() status values | ||
| 10 | |||
| 11 | =head1 SYNOPSIS | ||
| 12 | |||
| 13 | $description = waitstat $?; | ||
| 14 | exit waitstat_reuse $?; | ||
| 15 | waitstat_die $?, 'program-name'; | ||
| 16 | close_die COMMAND, 'program-name'; | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | This module contains functions for interpreting and acting on wait | ||
| 21 | status values. | ||
| 22 | |||
| 23 | Nothing is exported by default. | ||
| 24 | |||
| 25 | =over | ||
| 26 | |||
| 27 | =cut | ||
| 28 | |||
| 29 | package Proc::WaitStat; | ||
| 30 | |||
| 31 | use 5.003_98; # piped close errno resetting | ||
| 32 | use strict; | ||
| 33 | use vars qw($VERSION @ISA @EXPORT_OK); | ||
| 34 | |||
| 35 | use Carp qw(croak); | ||
| 36 | use Exporter (); | ||
| 37 | use IPC::Signal qw(sig_name); | ||
| 38 | use POSIX qw(:sys_wait_h); | ||
| 39 | |||
| 40 | $VERSION = '1.00'; | ||
| 41 | @ISA = qw(Exporter); | ||
| 42 | @EXPORT_OK = qw(waitstat waitstat_reuse waitstat_die close_die); | ||
| 43 | |||
| 44 | =item B<waitstat> I<wait-status> | ||
| 45 | |||
| 46 | Returns a string representation of wait() status value I<wait-status>. | ||
| 47 | Values returned are like C<"0"> and C<"64"> and C<"killed (SIGHUP)">. | ||
| 48 | |||
| 49 | This function is prototyped to take a single scalar argument. | ||
| 50 | |||
| 51 | =cut | ||
| 52 | |||
| 53 | sub waitstat ($) { | ||
| 54 | my $status = shift; | ||
| 55 | |||
| 56 | if (WIFEXITED $status) { | ||
| 57 | WEXITSTATUS $status | ||
| 58 | } | ||
| 59 | elsif (WIFSIGNALED $status) { | ||
| 60 | # XXX WCOREDUMP | ||
| 61 | 'killed (SIG' . sig_name(WTERMSIG $status) . ')' | ||
| 62 | } | ||
| 63 | elsif (WIFSTOPPED $status) { | ||
| 64 | 'stopped (SIG' . sig_name(WSTOPSIG $status) . ')' | ||
| 65 | } | ||
| 66 | # XXX WIFCONTINUED | ||
| 67 | else { | ||
| 68 | "invalid wait status $status" | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | =item B<waitstat_reuse> I<wait-status> | ||
| 73 | |||
| 74 | Turn I<wait-status> into a value which can be passed to B<exit>, converted | ||
| 75 | in the same manner the shell uses. If I<wait-status> indicates a normal | ||
| 76 | exit, return the exit value. If I<wait-status> instead indicates death by | ||
| 77 | signal, return 128 plus the signal number. | ||
| 78 | |||
| 79 | This function is prototyped to take a single scalar argument. | ||
| 80 | |||
| 81 | =cut | ||
| 82 | |||
| 83 | sub waitstat_reuse ($) { | ||
| 84 | my $status = shift; | ||
| 85 | |||
| 86 | if (WIFEXITED $status) { | ||
| 87 | WEXITSTATUS $status | ||
| 88 | } | ||
| 89 | elsif (WIFSIGNALED $status) { | ||
| 90 | 128 + WTERMSIG $status | ||
| 91 | } | ||
| 92 | elsif (WIFSTOPPED $status) { | ||
| 93 | 128 + WSTOPSIG $status | ||
| 94 | } | ||
| 95 | else { | ||
| 96 | croak "Invalid wait status $status"; | ||
| 97 | } | ||
| 98 | } | ||
| 99 | |||
| 100 | =item B<waitstat_die> I<wait-status> I<program-name> | ||
| 101 | |||
| 102 | die() if I<wait-status> is non-zero (mentioning I<program-name> as the | ||
| 103 | source of the error). | ||
| 104 | |||
| 105 | This function is prototyped to take two scalar arguments. | ||
| 106 | |||
| 107 | =cut | ||
| 108 | |||
| 109 | sub waitstat_die ($$) { | ||
| 110 | my ($status, $program) = @_; | ||
| 111 | croak "Non-zero exit (" . waitstat($status) . | ||
| 112 | ") from $program" | ||
| 113 | if $status; | ||
| 114 | } | ||
| 115 | |||
| 116 | =item B<close_die> I<filehandle> I<name> | ||
| 117 | |||
| 118 | Close I<filehandle>, if that fails die() with an appropriate message | ||
| 119 | which refers to I<name>. This handles failed closings of both programs | ||
| 120 | and files properly. | ||
| 121 | |||
| 122 | This function is prototyped to take a filehandle (actually, a glob ref) | ||
| 123 | and a scalar. | ||
| 124 | |||
| 125 | =cut | ||
| 126 | |||
| 127 | sub close_die (*$) { | ||
| 128 | my ($fh, $name) = @_; | ||
| 129 | |||
| 130 | unless (ref $fh || ref \$fh eq 'GLOB') { | ||
| 131 | require Symbol; | ||
| 132 | $fh = Symbol::qualify_to_ref($fh, caller); | ||
| 133 | } | ||
| 134 | |||
| 135 | unless (close $fh) { | ||
| 136 | croak "Error closing $name: ", | ||
| 137 | $!+0 ? "$!" : 'non-zero exit (' . waitstat($?) . ')'; | ||
| 138 | } | ||
| 139 | } | ||
| 140 | |||
| 141 | 1 | ||
| 142 | |||
| 143 | __END__ | ||
| 144 | |||
| 145 | =back | ||
| 146 | |||
| 147 | =head1 EXAMPLES | ||
| 148 | |||
| 149 | close SENDMAIL; | ||
| 150 | exit if $? == 0; | ||
| 151 | log "sendmail failure: ", waitstat $?; | ||
| 152 | exit EX_TEMPFAIL; | ||
| 153 | |||
| 154 | $pid == waitpid $pid, 0 or croak "Failed to reap $pid: $!"; | ||
| 155 | exit waitstat_reuse $?; | ||
| 156 | |||
| 157 | $output = `some-program -with args`; | ||
| 158 | waitstat_die $?, 'some-program'; | ||
| 159 | print "Output from some-process:\n", $output; | ||
| 160 | |||
| 161 | open PROGRAM, '| post-processor' or die "Can't fork: $!"; | ||
| 162 | while (<IN>) { | ||
| 163 | print PROGRAM pre_process $_ | ||
| 164 | or die "Error writing to post-processor: $!"; | ||
| 165 | } | ||
| 166 | # This handles both flush failures at close time and a non-zero exit | ||
| 167 | # from the subprocess. | ||
| 168 | close_die PROGRAM, 'post-processor'; | ||
| 169 | |||
| 170 | =head1 AUTHOR | ||
| 171 | |||
| 172 | Roderick Schertler <F<roderick@argon.org>> | ||
| 173 | |||
| 174 | =head1 SEE ALSO | ||
| 175 | |||
| 176 | perl(1), IPC::Signal(3pm). | ||
| 177 | |||
| 178 | =cut | ||
diff --git a/meta-networking/recipes-extended/mime-construct/files/fix-mime-construct-help-return-value.patch b/meta-networking/recipes-extended/mime-construct/files/fix-mime-construct-help-return-value.patch new file mode 100644 index 0000000000..5e4281d4e3 --- /dev/null +++ b/meta-networking/recipes-extended/mime-construct/files/fix-mime-construct-help-return-value.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 2b9ed06850410d70371b31de5f131e484ba1c851 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Lu Chong <Chong.Lu@windriver.com> | ||
| 3 | Date: Thu, 17 Oct 2013 16:06:04 +0800 | ||
| 4 | Subject: [PATCH] fix mime-construct --help return value | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | |||
| 8 | Signed-off-by: Lu Chong <Chong.Lu@windriver.com> | ||
| 9 | |||
| 10 | --- | ||
| 11 | mime-construct | 5 +++-- | ||
| 12 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/mime-construct b/mime-construct | ||
| 15 | index cad7d0e..707ed19 100755 | ||
| 16 | --- a/mime-construct | ||
| 17 | +++ b/mime-construct | ||
| 18 | @@ -39,7 +39,7 @@ usage: $Me switch... | ||
| 19 | |||
| 20 | Global settings: | ||
| 21 | --debug turn debugging on | ||
| 22 | - --help show this and then die | ||
| 23 | + --help show this | ||
| 24 | --output don\'t mail, output to stdout (loses bcc info) | ||
| 25 | --subpart generate subpart rather than whole message (turns | ||
| 26 | on --output, changes other semantics a bit) | ||
| 27 | @@ -150,7 +150,8 @@ sub xwarn { | ||
| 28 | |||
| 29 | sub usage { | ||
| 30 | xwarn @_ if @_; | ||
| 31 | - die $Usage; | ||
| 32 | + print $Usage; | ||
| 33 | + exit 0; | ||
| 34 | } | ||
| 35 | |||
| 36 | sub init { | ||
| 37 | -- | ||
| 38 | 1.7.9.5 | ||
| 39 | |||
diff --git a/meta-networking/recipes-extended/mime-construct/mime-construct_1.11.bb b/meta-networking/recipes-extended/mime-construct/mime-construct_1.11.bb index bf42a30510..9f1a779820 100644 --- a/meta-networking/recipes-extended/mime-construct/mime-construct_1.11.bb +++ b/meta-networking/recipes-extended/mime-construct/mime-construct_1.11.bb | |||
| @@ -9,21 +9,14 @@ LICENSE = "GPLv2+" | |||
| 9 | LIC_FILES_CHKSUM = "file://debian/copyright;md5=5e2e5da619ac8ef8c84767ccc4656e96" | 9 | LIC_FILES_CHKSUM = "file://debian/copyright;md5=5e2e5da619ac8ef8c84767ccc4656e96" |
| 10 | 10 | ||
| 11 | SRC_URI = "${CPAN_MIRROR}/authors/id/R/RO/ROSCH/mime-construct-${PV}.tar.gz \ | 11 | SRC_URI = "${CPAN_MIRROR}/authors/id/R/RO/ROSCH/mime-construct-${PV}.tar.gz \ |
| 12 | file://WaitStat.pm \ | 12 | file://fix-mime-construct-help-return-value.patch \ |
| 13 | file://Signal.pm \ | 13 | " |
| 14 | " | 14 | |
| 15 | SRC_URI[md5sum] = "73834ea780fbea81b89dbd9b2fb54f58" | 15 | SRC_URI[md5sum] = "73834ea780fbea81b89dbd9b2fb54f58" |
| 16 | SRC_URI[sha256sum] = "4cd7bb61b51d41192d1498c1051aa6a4ccd75aeb09b71d2ec706a7084a4a9303" | 16 | SRC_URI[sha256sum] = "4cd7bb61b51d41192d1498c1051aa6a4ccd75aeb09b71d2ec706a7084a4a9303" |
| 17 | 17 | ||
| 18 | inherit cpan | 18 | inherit cpan |
| 19 | 19 | ||
| 20 | do_install () { | 20 | RDEPENDS_${PN} = "libmime-types-perl libproc-waitstat-perl msmtp \ |
| 21 | oe_runmake install DESTDIR="${D}" | 21 | perl-module-filehandle perl-module-mime-base64 perl-module-mime-quotedprint perl-module-posix \ |
| 22 | install -d ${D}${libdir}/perl/vendor_perl/${@get_perl_version(d)}/Proc \ | 22 | " |
| 23 | ${D}${libdir}/perl/vendor_perl/${@get_perl_version(d)}/IPC | ||
| 24 | install -m 644 ${WORKDIR}/WaitStat.pm \ | ||
| 25 | ${D}${libdir}/perl/vendor_perl/${@get_perl_version(d)}/Proc | ||
| 26 | install -m 644 ${WORKDIR}/Signal.pm \ | ||
| 27 | ${D}${libdir}/perl/vendor_perl/${@get_perl_version(d)}/IPC | ||
| 28 | } | ||
| 29 | RDEPENDS_${PN} = "postfix perl" | ||
