Accepting request 1066861 from devel:languages:perl:CPAN-H
For perl-Perl-LanguageServer update OBS-URL: https://build.opensuse.org/request/show/1066861 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Hash-SafeKeys?expand=0&rev=1
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
## Default LFS
|
||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.osc
|
||||||
3
Hash-SafeKeys-0.04.tar.gz
Normal file
3
Hash-SafeKeys-0.04.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a524ad3bf9da677c1f8be6e15971b76575408f744923da27647ae8f1d3c37ccc
|
||||||
|
size 9262
|
||||||
5
perl-Hash-SafeKeys.changes
Normal file
5
perl-Hash-SafeKeys.changes
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 20 17:11:33 UTC 2023 - Dirk Stoecker <opensuse@dstoecker.de>
|
||||||
|
|
||||||
|
- initial package 0.04
|
||||||
|
* created by cpanspec 1.83.00
|
||||||
76
perl-Hash-SafeKeys.spec
Normal file
76
perl-Hash-SafeKeys.spec
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
#
|
||||||
|
# spec file for package perl-Hash-SafeKeys
|
||||||
|
#
|
||||||
|
# Copyright (c) 2023 SUSE LLC
|
||||||
|
#
|
||||||
|
# All modifications and additions to the file contributed by third parties
|
||||||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
# upon. The license for this file, and modifications and additions to the
|
||||||
|
# file, is the same license as for the pristine package itself (unless the
|
||||||
|
# license for the pristine package is not an Open Source License, in which
|
||||||
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%define cpan_name Hash-SafeKeys
|
||||||
|
Name: perl-Hash-SafeKeys
|
||||||
|
Version: 0.04
|
||||||
|
Release: 0
|
||||||
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
||||||
|
Summary: Get hash contents without resetting each iterator
|
||||||
|
URL: https://metacpan.org/release/%{cpan_name}
|
||||||
|
Source0: https://cpan.metacpan.org/authors/id/M/MO/MOB/%{cpan_name}-%{version}.tar.gz
|
||||||
|
BuildRequires: perl
|
||||||
|
BuildRequires: perl-macros
|
||||||
|
%{perl_requires}
|
||||||
|
|
||||||
|
%description
|
||||||
|
Every hash variable in Perl has its own internal iterator, accessed by the
|
||||||
|
builtin 'each', 'keys', and 'values' functions. The iterator is also
|
||||||
|
implicitly used whenever the hash is evaluated in list context. The
|
||||||
|
iterator is "reset" whenever 'keys' or 'values' is called on a hash,
|
||||||
|
including the implicit calls when the hash is evaluated in list context.
|
||||||
|
That makes it dangerous to do certain hash operations inside a 'while ...
|
||||||
|
each' loop:
|
||||||
|
|
||||||
|
while (my($k,$v) = each %hash) {
|
||||||
|
...
|
||||||
|
@k = sort keys %hash; # Infinite loop!
|
||||||
|
@v = grep { /foo/ }, values %hash; # Ack!
|
||||||
|
print join ' ', %hash; # Run away!
|
||||||
|
}
|
||||||
|
|
||||||
|
'Hash::SafeKeys' provides alternate functions to access the keys, values,
|
||||||
|
or entire contents of a hash in a way that does not reset the iterator,
|
||||||
|
making them safe to use in such contexts:
|
||||||
|
|
||||||
|
while (my($k,$v) = each %hash) {
|
||||||
|
...
|
||||||
|
@k = sort safekeys %hash; # Can do
|
||||||
|
@v = grep { /foo/ }, safevalues %hash; # No problem
|
||||||
|
print join ' ', safecopy %hash; # Right away, sir
|
||||||
|
}
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{cpan_name}-%{version}
|
||||||
|
|
||||||
|
%build
|
||||||
|
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
|
||||||
|
%make_build
|
||||||
|
|
||||||
|
%check
|
||||||
|
make test
|
||||||
|
|
||||||
|
%install
|
||||||
|
%perl_make_install
|
||||||
|
%perl_process_packlist
|
||||||
|
%perl_gen_filelist
|
||||||
|
|
||||||
|
%files -f %{name}.files
|
||||||
|
%doc Changes README
|
||||||
|
|
||||||
|
%changelog
|
||||||
Reference in New Issue
Block a user