Bump to 0.32 accepted/tizen_unified accepted/tizen_unified_x accepted/tizen_unified_x_asan sandbox/perl-Try-Tiny_0.32 tizen accepted/tizen/unified/20241224.130117 accepted/tizen/unified/x/20241224.221556 accepted/tizen/unified/x/asan/20250113.002059
authorTizenOpenSource <tizenopensrc@samsung.com>
Mon, 23 Dec 2024 08:09:25 +0000 (17:09 +0900)
committerTizenOpenSource <tizenopensrc@samsung.com>
Mon, 23 Dec 2024 08:09:25 +0000 (17:09 +0900)
Change-Id: I9be3c81311fb8ba89b83369e6923190cac34e561
Signed-off-by: TizenOpenSource <tizenopensrc@samsung.com>
packaging/perl-Try-Tiny.manifest [new file with mode: 0644]
packaging/perl-Try-Tiny.spec [new file with mode: 0644]

diff --git a/packaging/perl-Try-Tiny.manifest b/packaging/perl-Try-Tiny.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/perl-Try-Tiny.spec b/packaging/perl-Try-Tiny.spec
new file mode 100644 (file)
index 0000000..e7f48df
--- /dev/null
@@ -0,0 +1,73 @@
+Name:           perl-Try-Tiny
+Version:        0.32
+Release:        1
+License:        MIT
+Summary:        Minimal try/catch with proper preservation of $@
+Url:            https://metacpan.org/pod/Try::Tiny
+Group:          Development/Libraries
+Source0:        %{name}-%{version}.tar.gz
+Source1001:    perl-Try-Tiny.manifest
+BuildRequires:  perl
+BuildRequires:  perl(MIME::Base64)
+
+%description
+This module provides bare bones try/catch/finally statements that are 
+designed to minimize common mistakes with eval blocks, and NOTHING else.
+
+This is unlike TryCatch which provides a nice syntax and avoids adding 
+another call stack layer, and supports calling return from the try block 
+to return from the parent subroutine. These extra features come 
+at a cost of a few dependencies, namely Devel::Declare and Scope::Upper 
+which are occasionally problematic, and the additional catch filtering 
+uses Moose type constraints which may not be desirable either.
+
+The main focus of this module is to provide simple and reliable error 
+handling for those having a hard time installing TryCatch, but who still 
+want to write correct eval blocks without 5 lines of boilerplate each time.
+
+It's designed to work as correctly as possible in light of the various 
+pathological edge cases (see "BACKGROUND") and to be compatible with 
+any style of error values (simple strings, references, objects, overloaded 
+objects, etc).
+
+If the try block dies, it returns the value of the last statement executed 
+in the catch block, if there is one. Otherwise, it returns undef in scalar 
+context or the empty list in list context. The following examples 
+all assign "bar" to $x:
+
+my $x = try { die "foo" } catch { "bar" };
+my $x = try { die "foo" } || "bar";
+my $x = (try { die "foo" }) // "bar";
+
+ my $x = eval { die "foo" } || "bar";
+ You can add finally blocks, yielding the following:
+
+ my $x;
+ try { die 'foo' } finally { $x = 'bar' };
+ try { die 'foo' } catch { warn "Got a die: $_" } finally { $x = 'bar' };
+
+ finally blocks are always executed making them suitable for cleanup code 
+ which cannot be handled using local. You can add as many finally blocks 
+ to a given try block as you like.
+
+ Note that adding a finally block without a preceding catch block suppresses 
+ any errors. This behaviour is consistent with using a standalone eval, 
+ but it is not consistent with try/finally patterns found in other programming 
+ languages, such as Java, Python, Javascript or C#. If you learned 
+ the try/finally pattern from one of these languages, watch out for this.
+
+%prep
+%setup -q -n %{name}-%{version}
+cp %{SOURCE1001} .
+
+%build
+perl Makefile.PL INSTALLDIRS=vendor
+make %{?_smp_mflags}
+
+%install
+%perl_make_install
+%perl_process_packlist
+%perl_gen_filelist
+
+%files -f %{name}.files
+%license LICENCE