diff --git a/lang/lua-eco/Makefile b/lang/lua-eco/Makefile index f4b0d4f92..1d472f226 100644 --- a/lang/lua-eco/Makefile +++ b/lang/lua-eco/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lua-eco -PKG_VERSION:=3.0.2 +PKG_VERSION:=3.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL=https://github.com/zhaojh329/lua-eco/releases/download/v$(PKG_VERSION) -PKG_HASH:=fd99d0671701c0972ef3a9cb84231cd31b6290c447e1d6b91a230c502e441016 +PKG_HASH:=bb48af3f65a2c5d69b06b32ec2734bcb77cc6315b208be4fe3b0ae5fc0a82a33 PKG_MAINTAINER:=Jianhui Zhao PKG_LICENSE:=MIT @@ -61,6 +61,7 @@ Package/lua-eco-termios=$(call Package/lua-eco/Module,termios) Package/lua-eco-netlink=$(call Package/lua-eco/Module,netlink,+lua-eco-socket) Package/lua-eco-ip=$(call Package/lua-eco/Module,ip utils,+lua-eco-netlink) Package/lua-eco-nl80211=$(call Package/lua-eco/Module,nl80211,+lua-eco-netlink) +Package/lua-eco-ssh=$(call Package/lua-eco/Module,ssh,+lua-eco-socket +libssh2) define Package/lua-eco-ssl/config choice @@ -182,6 +183,12 @@ define Package/lua-eco-nl80211/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/nl80211.so $(1)/usr/local/lib/lua/5.3/eco/core endef +define Package/lua-eco-ssh/install + $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3/eco/core + $(INSTALL_DATA) $(PKG_BUILD_DIR)/ssh.lua $(1)/usr/local/lib/lua/5.3/eco + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssh.so $(1)/usr/local/lib/lua/5.3/eco/core +endef + $(eval $(call BuildPackage,lua-eco)) $(eval $(call BuildPackage,lua-eco-log)) $(eval $(call BuildPackage,lua-eco-base64)) @@ -198,3 +205,4 @@ $(eval $(call BuildPackage,lua-eco-termios)) $(eval $(call BuildPackage,lua-eco-netlink)) $(eval $(call BuildPackage,lua-eco-ip)) $(eval $(call BuildPackage,lua-eco-nl80211)) +$(eval $(call BuildPackage,lua-eco-ssh)) diff --git a/lang/perl/Makefile b/lang/perl/Makefile index 7b603b5af..5249a0505 100644 --- a/lang/perl/Makefile +++ b/lang/perl/Makefile @@ -11,22 +11,15 @@ include perlver.mk PKG_NAME:=perl PKG_VERSION:=$(PERL_VERSION) -PKG_RELEASE:=10 +PKG_RELEASE:=1 -PKG_SOURCE_URL:=\ - https://cpan.metacpan.org/src/5.0 \ - https://cpan.uib.no/src/5.0 \ - https://mirrors.rit.edu/CPAN/src/5.0 \ - https://mirror.transip.net/CPAN/src/5.0 \ - https://mirrors.sonic.net/cpan/src/5.0 \ - https://www.cpan.org/src/5.0 +PKG_SOURCE_URL:=https://www.cpan.org/src/5.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=fea7162d4cca940a387f0587b93f6737d884bf74d8a9d7cfd978bc12cd0b202d +PKG_HASH:=eca551caec3bc549a4e590c0015003790bdd1a604ffe19cc78ee631d51f7072e PKG_LICENSE:=GPL-1.0-or-later Artistic-1.0-Perl PKG_LICENSE_FILES:=Copying Artistic README -PKG_MAINTAINER:=Marcel Denia , \ - Philip Prindeville +PKG_MAINTAINER:=Marcel Denia , Philip Prindeville PKG_CPE_ID:=cpe:/a:perl:perl # Build settings diff --git a/lang/perl/files/base.config b/lang/perl/files/base.config index f2d18f547..67232b6d8 100644 --- a/lang/perl/files/base.config +++ b/lang/perl/files/base.config @@ -81,6 +81,7 @@ d_asinh='define' d_atanh='define' d_atolf='undef' d_atoll='define' +d_attribute_always_inline='define' d_attribute_deprecated='define' d_attribute_format='define' d_attribute_malloc='define' @@ -88,6 +89,7 @@ d_attribute_nonnull='define' d_attribute_noreturn='define' d_attribute_pure='define' d_attribute_unused='define' +d_attribute_visibility='define' d_attribute_warn_unused_result='define' d_backtrace='define' d_bcmp='define' @@ -179,6 +181,8 @@ d_fd_macros='define' d_fd_set='define' d_fdclose='undef' d_fdim='define' +d_ffs='define' +d_ffsl='define' d_fgetpos='define' d_finite='define' d_finitel='undef' @@ -214,6 +218,7 @@ d_gdbm_ndbm_h_uses_prototypes='undef' d_gdbmndbm_h_uses_prototypes='undef' d_getaddrinfo='define' d_getcwd='define' +d_getenv_preserves_other_thread='define' d_getespwnam='undef' d_getfsstat='undef' d_getgrent='define' @@ -363,6 +368,8 @@ d_newlocale='define' d_nextafter='define' d_nice='define' d_nl_langinfo='define' +d_nl_langinfo_l='define' +d_non_int_bitfields='define' d_nv_zero_is_allbits_zero='define' d_old_pthread_create_joinable='undef' d_oldpthreads='undef' @@ -427,6 +434,7 @@ d_semget='define' d_semop='define' d_sendmsg='define' d_setegid='define' +d_setenv='define' d_seteuid='define' d_setgrent='define' d_setgrent_r='undef' @@ -436,6 +444,7 @@ d_sethostent_r='undef' d_setitimer='define' d_setlinebuf='define' d_setlocale='define' +d_setlocale_accepts_any_locale_name='undef' d_setlocale_r='undef' d_setnent='define' d_setnetent_r='undef' @@ -482,6 +491,7 @@ d_sitearch='define' d_snprintf='define' d_sockaddr_in6="$owrt:ipv6" d_sockaddr_sa_len='undef' +d_sockaddr_storage='define' d_sockatmark='undef' d_sockatmarkproto='undef' d_socket='define' @@ -524,6 +534,7 @@ d_strtoul='define' d_strtoull='define' d_strtouq='define' d_strxfrm='define' +d_strxfrm_l='define' d_suidsafe='undef' d_symlink='define' d_syscall='define' @@ -537,12 +548,15 @@ d_tcsetpgrp='define' d_telldir='define' d_telldirproto='define' d_tgamma='define' +d_thread_local='define' d_thread_safe_nl_langinfo_l='define' d_time='define' d_timegm='define' d_times='define' d_tm_tm_gmtoff='define' d_tm_tm_zone='define' +d_towlower='define' +d_towupper='define' d_trunc='define' d_truncate='define' d_truncl='define' @@ -571,6 +585,7 @@ d_vprintf='define' d_vsnprintf='define' d_wait4='define' d_waitpid='define' +d_wcrtomb='define' d_wcscmp='define' d_wcstombs='define' d_wcsxfrm='define' @@ -717,6 +732,7 @@ i_syssockio='undef' i_sysstat='define' i_sysstatfs='define' i_sysstatvfs='define' +i_syssyscall='define' i_systime='define' i_systimek='undef' i_systimes='define' @@ -737,6 +753,7 @@ i_varargs='undef' i_varhdr='stdarg.h' i_vfork='undef' i_wchar='define' +i_wctype='define' i_xlocale='undef' ignore_versioned_solibs='y' inc_version_list=' ' @@ -924,6 +941,8 @@ spackage='Perl5' spitshell='cat' src='.' ssizetype='ssize_t' +st_dev_sign='1' +st_dev_size='8' st_ino_sign='1' st_ino_size='8' startperl='#!/usr/bin/perl' @@ -969,6 +988,7 @@ uniq='uniq' use5005threads='undef' usecbacktrace='undef' usecrosscompile='define' +usedefaultstrict='undef' usedevel='undef' usedl='define' usedtrace='undef' @@ -1025,6 +1045,7 @@ versiononly='undef' vi='' voidflags='15' xlibpth='/usr/lib/386 /lib/386' +xlocale_needed='undef' yacc='yacc' yaccflags='' zcat='' diff --git a/lang/perl/files/libc.config b/lang/perl/files/libc.config index 93d190c5a..1b198981a 100644 --- a/lang/perl/files/libc.config +++ b/lang/perl/files/libc.config @@ -10,10 +10,6 @@ } ($owrt:libc eq 'musl') { - # musl does not provide a working setlocale(). It accepts arbitrary locales - # and makes them act as if they were C.UTF-8. - d_setlocale='undef' - d_stdio_ptr_lval='undef' d_stdio_ptr_lval_sets_cnt='undef' d_stdiobase='undef' diff --git a/lang/perl/files/version.config b/lang/perl/files/version.config index b318648e0..fbd036130 100644 --- a/lang/perl/files/version.config +++ b/lang/perl/files/version.config @@ -1,17 +1,17 @@ # Set the version here PERL_REVISION=5 -PERL_VERSION=28 -PERL_SUBVERSION=1 +PERL_VERSION=38 +PERL_SUBVERSION=0 # (api_revison, api_version, api_subversion) = (revision, version, 0) usually PERL_API_REVISION=5 -PERL_API_VERSION=28 +PERL_API_VERSION=38 PERL_API_SUBVERSION=0 -known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob Filter/Util/Call GDBM_File Hash/Util I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared Hash/Util/FieldHash' -extensions='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators Unicode/Normalize version' -nonxs_ext='Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators Unicode/Normalize version' -dynamic_ext='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd DB_File Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared' +dynamic_ext='attributes B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper DB_File Devel/Peek Devel/PPPort Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util Math/BigInt/FastCalc MIME/Base64 mro Opcode PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog threads threads/shared Time/HiRes Time/Piece Unicode/Collate Unicode/Normalize XS/APItest XS/Typemap' +extensions='attributes B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper DB_File Devel/Peek Devel/PPPort Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util Math/BigInt/FastCalc MIME/Base64 mro Opcode PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog threads threads/shared Time/HiRes Time/Piece Unicode/Collate Unicode/Normalize XS/APItest XS/Typemap Archive/Tar Attribute/Handlers autodie AutoLoader autouse base bignum Carp Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Devel/SelfStubber Digest Dumpvalue encoding/warnings Env Errno experimental Exporter ExtUtils/CBuilder ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS ExtUtils/PL2Bat FileCache File/Fetch File/Find File/Path File/Temp Filter/Simple FindBin GDBM_File Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags if IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP lib libnet Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata Net/Ping NEXT Params/Check parent perlfaq PerlIO/via/QuotedPrint Perl/OSType Pod/Checker Pod/Escapes Pod/Functions Pod/Html podlators Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Hash/NamedCapture Tie/Memoize Tie/RefHash Time/Local version XSLoader' +known_extensions='Amiga/ARexx Amiga/Exec Archive/Tar Attribute/Handlers attributes autodie AutoLoader autouse B base bignum Carp Compress/Raw/Bzip2 Compress/Raw/Zlib Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Cwd Data/Dumper DB_File Devel/Peek Devel/PPPort Devel/SelfStubber Digest Digest/MD5 Digest/SHA Dumpvalue Encode encoding/warnings Env Errno experimental Exporter ExtUtils/CBuilder ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS ExtUtils/PL2Bat Fcntl FileCache File/DosGlob File/Fetch File/Find File/Glob File/Path File/Temp Filter/Simple Filter/Util/Call FindBin GDBM_File Getopt/Long Hash/Util Hash/Util/FieldHash HTTP/Tiny I18N/Collate I18N/Langinfo I18N/LangTags if IO IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 IPC/SysV JSON/PP lib libnet List/Util Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigInt/FastCalc Math/BigRat Math/Complex Memoize MIME/Base64 Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata mro NDBM_File Net/Ping NEXT ODBM_File Opcode Params/Check parent perlfaq PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via PerlIO/via/QuotedPrint Perl/OSType Pod/Checker Pod/Escapes Pod/Functions Pod/Html podlators Pod/Perldoc Pod/Simple Pod/Usage POSIX re Safe SDBM_File Search/Dict SelfLoader Socket Storable Sys/Hostname Sys/Syslog Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue threads Thread/Semaphore threads/shared Tie/File Tie/Hash/NamedCapture Tie/Memoize Tie/RefHash Time/HiRes Time/Local Time/Piece Unicode/Collate Unicode/Normalize version VMS/DCLsym VMS/Filespec VMS/Stdio Win32 Win32API/File Win32CORE XS/APItest XSLoader XS/Typemap' +nonxs_ext='Archive/Tar Attribute/Handlers autodie AutoLoader autouse base bignum Carp Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Devel/SelfStubber Digest Dumpvalue encoding/warnings Env Errno experimental Exporter ExtUtils/CBuilder ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS ExtUtils/PL2Bat FileCache File/Fetch File/Find File/Path File/Temp Filter/Simple FindBin Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags if IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP lib libnet Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata Net/Ping NEXT Params/Check parent perlfaq PerlIO/via/QuotedPrint Perl/OSType Pod/Checker Pod/Escapes Pod/Functions Pod/Html podlators Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Hash/NamedCapture Tie/Memoize Tie/RefHash Time/Local version XSLoader' # No need to change anything from here on owrt:perllibpath="/usr/lib/perl5/$PERL_REVISION.$PERL_VERSION" diff --git a/lang/perl/patches/001-macos_11_support.patch b/lang/perl/patches/001-macos_11_support.patch deleted file mode 100644 index f61c519a1..000000000 --- a/lang/perl/patches/001-macos_11_support.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/hints/darwin.sh -+++ b/hints/darwin.sh -@@ -301,7 +301,7 @@ case "$osvers" in # Note: osvers is the - # We now use MACOSX_DEPLOYMENT_TARGET, if set, as an override by - # capturing its value and adding it to the flags. - case "$MACOSX_DEPLOYMENT_TARGET" in -- 10.*) -+ [1-9][0-9].*) - add_macosx_version_min ccflags $MACOSX_DEPLOYMENT_TARGET - add_macosx_version_min ldflags $MACOSX_DEPLOYMENT_TARGET - ;; -@@ -313,7 +313,7 @@ case "$osvers" in # Note: osvers is the - - *** Unexpected MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET - *** --*** Please either set it to 10.something, or to empty. -+*** Please either set it to a valid macOS version number (e.g., 10.15) or to empty. - - EOM - exit 1 -@@ -327,7 +327,7 @@ EOM - # "ProductVersion: 10.11" "10.11" - prodvers=`sw_vers|awk '/^ProductVersion:/{print $2}'|awk -F. '{print $1"."$2}'` - case "$prodvers" in -- 10.*) -+ [1-9][0-9].*) - add_macosx_version_min ccflags $prodvers - add_macosx_version_min ldflags $prodvers - ;; diff --git a/lang/perl/patches/002-add-Internals-getcwd.patch b/lang/perl/patches/002-add-Internals-getcwd.patch deleted file mode 100644 index d2a84977a..000000000 --- a/lang/perl/patches/002-add-Internals-getcwd.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 15f67d146cf1f32504e8a11de3faa2abc0f467cd Mon Sep 17 00:00:00 2001 -From: Tony Cook -Date: Mon, 25 Mar 2019 16:48:40 +1100 -Subject: [PATCH] (perl #133951) add Internals::getcwd - ---- - MANIFEST | 1 + - t/io/getcwd.t | 22 ++++++++++++++++++++++ - universal.c | 22 ++++++++++++++++++++++ - 3 files changed, 45 insertions(+) - create mode 100644 t/io/getcwd.t - ---- a/MANIFEST -+++ b/MANIFEST -@@ -5456,6 +5456,7 @@ t/io/errno.t See if $! is correctly se - t/io/errnosig.t Test case for restoration $! when leaving signal handlers - t/io/fflush.t See if auto-flush on fork/exec/system/qx works - t/io/fs.t See if directory manipulations work -+t/io/getcwd.t See if Internals::getcwd is sane - t/io/inplace.t See if inplace editing works - t/io/iofile.t See if we can load IO::File on demand - t/io/iprefix.t See if inplace editing works with prefixes ---- /dev/null -+++ b/t/io/getcwd.t -@@ -0,0 +1,22 @@ -+#!./perl -w -+ -+BEGIN { -+ chdir 't' if -d 't'; -+ require "./test.pl"; -+ set_up_inc('../lib'); -+} -+ -+use Config; -+ -+$Config{d_getcwd} -+ or plan skip_all => "no getcwd"; -+ -+my $cwd = Internals::getcwd(); -+ok(!defined $cwd || $cwd ne "", -+ "Internals::getcwd() returned a reasonable result"); -+ -+if (defined $cwd) { -+ ok(-d $cwd, "check a success result is a directory"); -+} -+ -+done_testing(); ---- a/universal.c -+++ b/universal.c -@@ -986,6 +986,25 @@ XS(XS_re_regexp_pattern) - NOT_REACHED; /* NOTREACHED */ - } - -+#ifdef HAS_GETCWD -+ -+XS(XS_Internals_getcwd) -+{ -+ dXSARGS; -+ SV *sv = sv_newmortal(); -+ -+ if (items != 0) -+ croak_xs_usage(cv, ""); -+ -+ (void)getcwd_sv(sv); -+ -+ SvTAINTED_on(sv); -+ PUSHs(sv); -+ XSRETURN(1); -+} -+ -+#endif -+ - #include "vutil.h" - #include "vxs.inc" - -@@ -1020,6 +1039,9 @@ static const struct xsub_details details - {"re::regnames", XS_re_regnames, ";$"}, - {"re::regnames_count", XS_re_regnames_count, ""}, - {"re::regexp_pattern", XS_re_regexp_pattern, "$"}, -+#ifdef HAS_GETCWD -+ {"Internals::getcwd", XS_Internals_getcwd, ""}, -+#endif - }; - - STATIC OP* diff --git a/lang/perl/patches/003-fallback-to-the-built-in-getcwd-if-we-ca.patch b/lang/perl/patches/003-fallback-to-the-built-in-getcwd-if-we-ca.patch deleted file mode 100644 index dcadb3141..000000000 --- a/lang/perl/patches/003-fallback-to-the-built-in-getcwd-if-we-ca.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/dist/PathTools/Cwd.pm -+++ b/dist/PathTools/Cwd.pm -@@ -659,6 +659,10 @@ if (exists $METHOD_MAP{$^O}) { - } - } - -+# built-in from 5.30 -+*getcwd = \&Internals::getcwd -+ if !defined &getcwd && defined &Internals::getcwd; -+ - # In case the XS version doesn't load. - *abs_path = \&_perl_abs_path unless defined &abs_path; - *getcwd = \&_perl_getcwd unless defined &getcwd; ---- a/dist/PathTools/t/cwd.t -+++ b/dist/PathTools/t/cwd.t -@@ -10,6 +10,7 @@ chdir 't'; - use Config; - use File::Spec; - use File::Path; -+use Errno qw(EACCES); - - use lib File::Spec->catdir('t', 'lib'); - use Test::More; -@@ -208,7 +209,15 @@ SKIP: { - - like($abs_path, qr|$want$|i, "Cwd::abs_path produced $abs_path"); - like($fast_abs_path, qr|$want$|i, "Cwd::fast_abs_path produced $fast_abs_path"); -- like($pas, qr|$want$|i, "Cwd::_perl_abs_path produced $pas") if $EXTRA_ABSPATH_TESTS; -+ if ($EXTRA_ABSPATH_TESTS) { -+ # _perl_abs_path() can fail if some ancestor directory isn't readable -+ if (defined $pas) { -+ like($pas, qr|$want$|i, "Cwd::_perl_abs_path produced $pas"); -+ } -+ else { -+ is($!+0, EACCES, "check we got the expected error on failure"); -+ } -+ } - - rmtree($test_dirs[0], 0, 0); - 1 while unlink $file; diff --git a/lang/perl/patches/010-musl-compat.patch b/lang/perl/patches/010-musl-compat.patch index 77ea26f46..e38a05be8 100644 --- a/lang/perl/patches/010-musl-compat.patch +++ b/lang/perl/patches/010-musl-compat.patch @@ -1,6 +1,6 @@ --- a/perl.c +++ b/perl.c -@@ -303,7 +303,7 @@ perl_construct(pTHXx) +@@ -317,7 +317,7 @@ perl_construct(pTHXx) PL_localpatches = local_patches; /* For possible -v */ #endif diff --git a/lang/perl/patches/020-storables-stacksize.patch b/lang/perl/patches/020-storables-stacksize.patch deleted file mode 100644 index 903d90b7d..000000000 --- a/lang/perl/patches/020-storables-stacksize.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 682a4acb98783a7f9b5c286b308f12863599fec3 Mon Sep 17 00:00:00 2001 -From: Tony Cook -Date: Mon, 30 Jul 2018 21:00:52 +1000 -Subject: (perl #133411) don't try to load Storable with -Dusecrosscompile - ---- - dist/Storable/Makefile.PL | 9 ++++++++- - dist/Storable/stacksize | 10 +++++++--- - 2 files changed, 15 insertions(+), 4 deletions(-) - ---- a/dist/Storable/Makefile.PL -+++ b/dist/Storable/Makefile.PL -@@ -90,12 +90,19 @@ sub depend { - # blib.pm needs arch/lib - $extra_deps = ' Storable.pm'; - } -+ my $whichperl; -+ if ($Config::Config{usecrosscompile}) { -+ $whichperl = '$(PERLRUN)'; -+ } -+ else { -+ $whichperl = '$(FULLPERLRUNINST)'; -+ } - my $linktype = uc($_[0]->{LINKTYPE}); - my $limit_pm = File::Spec->catfile('lib', 'Storable', 'Limit.pm'); - " - $limit_pm : stacksize \$(INST_$linktype)$extra_deps - \$(MKPATH) \$(INST_LIB) -- \$(FULLPERLRUNINST) stacksize $options -+ $whichperl stacksize $options - - release : dist - git tag \$(VERSION) ---- a/dist/Storable/stacksize -+++ b/dist/Storable/stacksize -@@ -7,6 +7,9 @@ use Cwd; - use File::Spec; - use strict; - -+-d "lib" or mkdir "lib"; -+-d "lib/Storable" or mkdir "lib/Storable"; -+ - my $fn = "lib/Storable/Limit.pm"; - my $ptrsize = $Config{ptrsize}; - my ($bad1, $bad2) = (65001, 25000); -@@ -29,6 +32,10 @@ sub is_miniperl { - } - - if (is_miniperl()) { -+ if ($Config{usecrosscompile}) { -+ write_limits(500, 265); -+ exit; -+ } - die "Should not run during miniperl\n"; - } - my $prefix = ""; -@@ -68,9 +75,6 @@ if ($ENV{PERL_CORE}) { - } - } - ---d "lib" or mkdir "lib"; ---d "lib/Storable" or mkdir "lib/Storable"; -- - if ($^O eq "MSWin32") { - require Win32; - my ($str, $major, $minor) = Win32::GetOSVersion(); diff --git a/lang/perl/patches/110-always_use_miniperl.patch b/lang/perl/patches/110-always_use_miniperl.patch index 2f7ebcbc4..806a31256 100644 --- a/lang/perl/patches/110-always_use_miniperl.patch +++ b/lang/perl/patches/110-always_use_miniperl.patch @@ -1,8 +1,8 @@ --- a/Makefile.SH +++ b/Makefile.SH -@@ -339,22 +339,11 @@ MANIFEST_SRT = MANIFEST.srt - - !GROK!THIS! +@@ -360,22 +360,11 @@ PERL_EXE_LDFLAGS=$exeldflags + ;; + esac -case "$usecrosscompile$perl" in -define?*) diff --git a/lang/perl/patches/120-remove-build-timestamp.patch b/lang/perl/patches/120-remove-build-timestamp.patch index b0e783462..ae044c8f1 100644 --- a/lang/perl/patches/120-remove-build-timestamp.patch +++ b/lang/perl/patches/120-remove-build-timestamp.patch @@ -1,8 +1,8 @@ --- a/perl.c +++ b/perl.c -@@ -1987,16 +1987,6 @@ S_Internals_V(pTHX_ CV *cv) +@@ -2098,16 +2098,6 @@ S_Internals_V(pTHX_ CV *cv) PUSHs(Perl_newSVpvn_flags(aTHX_ non_bincompat_options, - sizeof(non_bincompat_options) - 1, SVs_TEMP)); + sizeof(non_bincompat_options) - 1, SVs_TEMP)); -#ifndef PERL_BUILD_DATE -# ifdef __DATE__ @@ -16,4 +16,4 @@ - #ifdef PERL_BUILD_DATE PUSHs(Perl_newSVpvn_flags(aTHX_ - STR_WITH_LEN("Compiled at " PERL_BUILD_DATE), + STR_WITH_LEN("Compiled at " PERL_BUILD_DATE), diff --git a/lang/perl/patches/301-fix_macos_static_linking.patch b/lang/perl/patches/301-fix_macos_static_linking.patch deleted file mode 100644 index 4b4ef925e..000000000 --- a/lang/perl/patches/301-fix_macos_static_linking.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm -+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm -@@ -2738,14 +2738,14 @@ sub _find_static_libs { - - Called by a utility method of makeaperl. Checks whether a given file - is an XS library by seeing whether it defines any symbols starting --with C. -+with C (with an optional leading underscore – needed on MacOS). - - =cut - - sub xs_static_lib_is_xs { - my ($self, $libfile) = @_; - my $devnull = File::Spec->devnull; -- return `nm $libfile 2>$devnull` =~ /\bboot_/; -+ return `nm $libfile 2>$devnull` =~ /\b_?boot_/; - } - - =item makefile (o) diff --git a/lang/perl/patches/320-copy-pod-hack.patch b/lang/perl/patches/320-copy-pod-hack.patch index 9afb8a8ce..efe8e0c29 100644 --- a/lang/perl/patches/320-copy-pod-hack.patch +++ b/lang/perl/patches/320-copy-pod-hack.patch @@ -1,8 +1,8 @@ --- a/cpan/podlators/Makefile.PL +++ b/cpan/podlators/Makefile.PL -@@ -18,6 +18,19 @@ use Config; - use ExtUtils::MakeMaker; - use File::Spec; +@@ -39,6 +39,19 @@ sub dist_version { + die "$0: cannot find version in lib/Pod/Man.pm\n"; + } +foreach (glob('scripts/pod*.PL')) { + # The various pod*.PL extractors change directory. Doing that with relative @@ -20,7 +20,7 @@ # Generate full paths for scripts distributed in the bin directory. Appends # the .com extension to scripts on VMS, unless they already have the .PL # extension. -@@ -28,7 +41,7 @@ use File::Spec; +@@ -49,7 +62,7 @@ sub dist_version { # (Scalar) Space-separated relative paths from top of distribution sub scripts { my (@scripts) = @_; @@ -29,7 +29,7 @@ if ($^O eq 'VMS') { @paths = map { m{ [.] PL \z }xms ? $_ : $_ . '.com' } @paths; } -@@ -77,8 +90,8 @@ my %metadata = ( +@@ -101,8 +114,8 @@ my %metadata = ( # Override the files that generate section 1 man pages. MAN1PODS => { diff --git a/lang/perl/patches/900-use-rm-force.patch b/lang/perl/patches/900-use-rm-force.patch index d2197571a..857cd1e9e 100644 --- a/lang/perl/patches/900-use-rm-force.patch +++ b/lang/perl/patches/900-use-rm-force.patch @@ -1,14 +1,14 @@ --- a/Makefile.SH +++ b/Makefile.SH -@@ -275,6 +275,7 @@ LNS = $lns +@@ -289,6 +289,7 @@ LNS = $lns # NOTE: some systems don't grok "cp -f". XXX Configure test needed? CPS = $cp RMS = rm -f +RMS_R = rm -rf ranlib = $ranlib + ECHO = $echo - # The following are mentioned only to make metaconfig include the -@@ -736,7 +737,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX +@@ -786,7 +787,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX ./generate_uudmap$(HOST_EXE_EXT) $(generated_headers) generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT) @@ -17,7 +17,7 @@ $(LNS) $(HOST_GENERATE) generate_uudmap$(HOST_EXE_EXT) !NO!SUBS! -@@ -876,26 +877,26 @@ mydtrace.h: $(DTRACE_H) +@@ -891,26 +892,26 @@ mydtrace.h: $(DTRACE_H) define) $spitshell >>$Makefile <<'!NO!SUBS!' $(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt) @@ -48,7 +48,7 @@ !NO!SUBS! ;; -@@ -906,13 +907,13 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD +@@ -921,13 +922,13 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD case "$useshrplib" in true) $spitshell >>$Makefile <<'!NO!SUBS!' @@ -64,7 +64,7 @@ mv $@ libperl$(OBJ_EXT) $(AR) qv $(LIBPERL) libperl$(OBJ_EXT) !NO!SUBS! -@@ -921,7 +922,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD +@@ -936,7 +937,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOAD ;; *) $spitshell >>$Makefile <<'!NO!SUBS!' @@ -73,7 +73,7 @@ $(AR) rc $(LIBPERL) $(perllib_objs) $(DYNALOADER) @$(ranlib) $(LIBPERL) !NO!SUBS! -@@ -954,7 +955,7 @@ $(MINIPERL_EXE): lib/buildcustomize.pl +@@ -970,7 +971,7 @@ $(MINIPERL_EXE): lib/buildcustomize.pl amigaos*) $spitshell >>$Makefile <<'!NO!SUBS!' lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl @@ -119,9 +119,9 @@ + @$(RMS) miniperl.xok !NO!SUBS! - case $osname in -@@ -1119,8 +1120,8 @@ pod/perl5281delta.pod: pod/perldelta.pod - $(LNS) perldelta.pod pod/perl5281delta.pod + case "$osname" in +@@ -1133,8 +1134,8 @@ pod/perl5380delta.pod: pod/perldelta.pod + $(LNS) perldelta.pod pod/perl5380delta.pod extra.pods: $(MINIPERL_EXE) - -@test ! -f extra.pods || rm -f `cat extra.pods` @@ -131,7 +131,7 @@ -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \ nx=`echo $$x | sed -e "s/README\.//"`; \ $(LNS) ../$$x "pod/perl"$$nx".pod" ; \ -@@ -1340,11 +1341,11 @@ realclean: _realcleaner _mopup +@@ -1334,11 +1335,11 @@ realclean: _realcleaner _mopup @echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh" _clobber: @@ -148,7 +148,7 @@ clobber: _realcleaner _mopup _clobber -@@ -1352,23 +1353,23 @@ distclean: clobber +@@ -1346,24 +1347,24 @@ distclean: clobber # Like distclean but also removes emacs backups and *.orig. veryclean: _verycleaner _mopup _clobber @@ -157,20 +157,22 @@ # Do not 'make _mopup' directly. _mopup: -- rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers) -+ $(RMS) *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers) +- rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c $(mini_only_src) generate_uudmap$(EXE_EXT) $(generated_headers) ++ $(RMS) *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c $(mini_only_src) generate_uudmap$(EXE_EXT) $(generated_headers) -rmdir .depending +- -rm *.depends makedepend_file - -@test -f extra.pods && rm -f `cat extra.pods` - -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod -- -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall +- -rm -f perl.exp ext.libs $(generated_pods) uni.data $(mini_only_objs) pod/roffitall - -rm -f perl.export perl.dll perl.libexp perl.map perl.def - -rm -f *perl.xok - -rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump - -rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl - -rm -f config.arch config.over $(DTRACE_H) ++ $(RMS) *.depends makedepend_file + -@test -f extra.pods && $(RMS) `cat extra.pods` + -@test -f vms/README_vms.pod && $(RMS) vms/README_vms.pod -+ $(RMS) perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall ++ $(RMS) perl.exp ext.libs $(generated_pods) uni.data $(mini_only_objs) pod/roffitall + $(RMS) perl.export perl.dll perl.libexp perl.map perl.def + $(RMS) *perl.xok + $(RMS) cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump @@ -183,7 +185,7 @@ -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN) -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN) -@if test -f $(MINIPERL_EXE) ; then \ -@@ -1378,31 +1379,31 @@ _cleaner1: +@@ -1373,8 +1374,8 @@ _cleaner1: else \ sh $(CLEAN).sh ; \ fi @@ -193,9 +195,10 @@ + $(RMS) `grep -v ^# mkppport.lst | grep . | sed -e 's/$$/\/ppport.h/'` # Dear POSIX, thanks for making the default to xargs to be - # run once if nothhing is passed in. It is such a great help. - - # Some systems do not support "?", so keep these files separate. + # run once if nothing is passed in. It is such a great help. +@@ -1389,24 +1390,24 @@ _cleaner1: + # Add new rules before that line - the next line (rm -f so_locations ...) is + # used as a placeholder by a regen script. _cleaner2: - -rm -f core.*perl.*.? t/core.perl.*.? .?*.c - rm -f core *perl.core t/core t/*perl.core core.* t/core.* @@ -228,12 +231,14 @@ + $(RMS) pod2htmd.tmp + $(RMS_R) pod/perlfunc pod/perlipc -rmdir ext/B/lib -- rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR) -+ $(RMS) so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR) +- -rm -f dist/Time-HiRes/xdefine +- rm -f so_locations $(LIBPERL_NONSHR) ++ $(RMS) dist/Time-HiRes/xdefine ++ $(RMS) so_locations $(LIBPERL_NONSHR) -rmdir lib/version lib/threads lib/inc/ExtUtils lib/inc lib/encoding -rmdir lib/autodie/exception lib/autodie/Scope lib/autodie lib/XS -rmdir lib/Win32API lib/VMS lib/Unicode/Collate/Locale -@@ -1452,11 +1453,11 @@ _realcleaner: +@@ -1457,11 +1458,11 @@ _realcleaner: _verycleaner: @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean @$(LDLIBPTH) $(MAKE) _cleaner2 @@ -247,7 +252,7 @@ lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c) cscopeflags = -Rb # Recursive, build-only. -@@ -1514,7 +1515,7 @@ case "$targethost" in +@@ -1522,7 +1523,7 @@ case "$targethost" in '') $spitshell >>$Makefile <<'!NO!SUBS!' test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \ $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build @@ -256,7 +261,7 @@ !NO!SUBS! ;; -@@ -1564,7 +1565,7 @@ test_prep test-prep: test_prep_pre \$(MI +@@ -1572,7 +1573,7 @@ test_prep test-prep: test_prep_pre \$(MI $to config.sh # --- For lib/diagnostics.t with -Duseshrplib $to \$(PERL_EXE) @@ -265,7 +270,7 @@ $to t/\$(PERL_EXE) !GROK!THIS! -@@ -1574,7 +1575,7 @@ esac +@@ -1582,7 +1583,7 @@ esac $spitshell >>$Makefile <<'!NO!SUBS!' test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL) $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic @@ -274,12 +279,12 @@ !NO!SUBS! case "$targethost" in -@@ -1629,7 +1630,7 @@ minitest_prep: +@@ -1637,7 +1638,7 @@ minitest_prep: $(MINIPERL_EXE) @echo "You may see some irrelevant test failures if you have been unable" @echo "to build lib/Config.pm, or the Unicode data files." @echo " " -- - cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) -+ - cd t && ($(RMS) $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) +- cd t && (rm -f $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) ++ cd t && ($(RMS) $(PERL_EXE); $(LNS) ../$(MINIPERL_EXE) $(PERL_EXE)) MINITEST_TESTS = base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t diff --git a/lang/perl/patches/910-miniperl-needs-inc-dot.patch b/lang/perl/patches/910-miniperl-needs-inc-dot.patch index 347f6f2a3..6589926bc 100644 --- a/lang/perl/patches/910-miniperl-needs-inc-dot.patch +++ b/lang/perl/patches/910-miniperl-needs-inc-dot.patch @@ -1,6 +1,6 @@ --- a/Makefile.SH +++ b/Makefile.SH -@@ -333,7 +333,7 @@ PATH_SEP = $p_ +@@ -346,7 +346,7 @@ OBJ_EXT = $_o # Macros to invoke a copy of miniperl during the build. Targets which # are built using these macros should depend on \$(MINIPERL_EXE) MINIPERL_EXE = miniperl\$(EXE_EXT) diff --git a/lang/perl/patches/920-fix-no-locale.patch b/lang/perl/patches/920-fix-no-locale.patch deleted file mode 100644 index 25ff28517..000000000 --- a/lang/perl/patches/920-fix-no-locale.patch +++ /dev/null @@ -1,383 +0,0 @@ -commit d36adde059ed1c4f7af210b4f9fc3a7bd2d7d343 -Author: Karl Williamson -Date: Wed May 23 15:32:47 2018 -0600 - - Fix to compile under -DNO_LOCALE - - Several problems with this compile option were not caught before 5.28 - was frozen. - ---- a/embed.fnc -+++ b/embed.fnc -@@ -2793,9 +2793,11 @@ s |bool |isa_lookup |NN HV *stash|NN con - #endif - - #if defined(PERL_IN_LOCALE_C) -+# ifdef USE_LOCALE - sn |const char*|category_name |const int category - s |const char*|switch_category_locale_to_template|const int switch_category|const int template_category|NULLOK const char * template_locale - s |void |restore_switched_locale|const int category|NULLOK const char * const original_locale -+# endif - # ifdef HAS_NL_LANGINFO - sn |const char*|my_nl_langinfo|const nl_item item|bool toggle - # else ---- a/embed.h -+++ b/embed.h -@@ -1796,16 +1796,16 @@ - #define unshare_hek_or_pvn(a,b,c,d) S_unshare_hek_or_pvn(aTHX_ a,b,c,d) - # endif - # if defined(PERL_IN_LOCALE_C) --#define category_name S_category_name --#define restore_switched_locale(a,b) S_restore_switched_locale(aTHX_ a,b) - #define save_to_buffer S_save_to_buffer --#define switch_category_locale_to_template(a,b,c) S_switch_category_locale_to_template(aTHX_ a,b,c) - # if defined(USE_LOCALE) -+#define category_name S_category_name - #define new_collate(a) S_new_collate(aTHX_ a) - #define new_ctype(a) S_new_ctype(aTHX_ a) - #define new_numeric(a) S_new_numeric(aTHX_ a) -+#define restore_switched_locale(a,b) S_restore_switched_locale(aTHX_ a,b) - #define set_numeric_radix(a) S_set_numeric_radix(aTHX_ a) - #define stdize_locale(a) S_stdize_locale(aTHX_ a) -+#define switch_category_locale_to_template(a,b,c) S_switch_category_locale_to_template(aTHX_ a,b,c) - # if defined(USE_POSIX_2008_LOCALE) - #define emulate_setlocale S_emulate_setlocale - # endif ---- a/locale.c -+++ b/locale.c -@@ -1264,6 +1264,7 @@ S_locking_setlocale(pTHX_ - } - - #endif -+#ifdef USE_LOCALE - - STATIC void - S_set_numeric_radix(pTHX_ const bool use_locale) -@@ -1299,6 +1300,10 @@ S_set_numeric_radix(pTHX_ const bool use - } - - # endif -+#else -+ -+ PERL_UNUSED_ARG(use_locale); -+ - #endif /* USE_LOCALE_NUMERIC and can find the radix char */ - - } -@@ -1481,7 +1486,6 @@ S_new_ctype(pTHX_ const char *newctype) - - #ifndef USE_LOCALE_CTYPE - -- PERL_ARGS_ASSERT_NEW_CTYPE; - PERL_UNUSED_ARG(newctype); - PERL_UNUSED_CONTEXT; - -@@ -1994,6 +1998,8 @@ S_new_collate(pTHX_ const char *newcoll) - - } - -+#endif -+ - #ifdef WIN32 - - STATIC char * -@@ -2139,11 +2145,20 @@ Perl_setlocale(const int category, const - { - /* This wraps POSIX::setlocale() */ - -+#ifdef NO_LOCALE -+ -+ PERL_UNUSED_ARG(category); -+ PERL_UNUSED_ARG(locale); -+ -+ return "C"; -+ -+#else -+ - const char * retval; - const char * newlocale; - dSAVEDERRNO; -- DECLARATION_FOR_LC_NUMERIC_MANIPULATION; - dTHX; -+ DECLARATION_FOR_LC_NUMERIC_MANIPULATION; - - #ifdef USE_LOCALE_NUMERIC - -@@ -2262,6 +2277,8 @@ Perl_setlocale(const int category, const - - return retval; - -+#endif -+ - } - - PERL_STATIC_INLINE const char * -@@ -2414,13 +2431,16 @@ S_my_nl_langinfo(const int item, bool to - dTHX; - const char * retval; - -+#ifdef USE_LOCALE_NUMERIC -+ - /* We only need to toggle into the underlying LC_NUMERIC locale for these - * two items, and only if not already there */ - if (toggle && (( item != RADIXCHAR && item != THOUSEP) - || PL_numeric_underlying)) -- { -+ -+#endif /* No toggling needed if not using LC_NUMERIC */ -+ - toggle = FALSE; -- } - - #if defined(HAS_NL_LANGINFO) /* nl_langinfo() is available. */ - # if ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L) \ -@@ -2468,6 +2488,8 @@ S_my_nl_langinfo(const int item, bool to - do_free = TRUE; - } - -+# ifdef USE_LOCALE_NUMERIC -+ - if (toggle) { - if (PL_underlying_numeric_obj) { - cur = PL_underlying_numeric_obj; -@@ -2478,6 +2500,8 @@ S_my_nl_langinfo(const int item, bool to - } - } - -+# endif -+ - /* We have to save it to a buffer, because the freelocale() just below - * can invalidate the internal one */ - retval = save_to_buffer(nl_langinfo_l(item, cur), -@@ -5169,9 +5193,7 @@ Perl_my_strerror(pTHX_ const int errnum) - LOCALE_UNLOCK; - - # endif /* End of doesn't have strerror_l */ --#endif /* End of does have locale messages */ -- --#ifdef DEBUGGING -+# ifdef DEBUGGING - - if (DEBUG_Lv_TEST) { - PerlIO_printf(Perl_debug_log, "Strerror returned; saving a copy: '"); -@@ -5179,7 +5201,8 @@ Perl_my_strerror(pTHX_ const int errnum) - PerlIO_printf(Perl_debug_log, "'\n"); - } - --#endif -+# endif -+#endif /* End of does have locale messages */ - - SAVEFREEPV(errstr); - return errstr; -@@ -5301,10 +5324,17 @@ L|perlap - bool - Perl_sync_locale() - { -+ -+#ifndef USE_LOCALE -+ -+ return TRUE; -+ -+#else -+ - const char * newlocale; - dTHX; - --#ifdef USE_POSIX_2008_LOCALE -+# ifdef USE_POSIX_2008_LOCALE - - bool was_in_global_locale = FALSE; - locale_t cur_obj = uselocale((locale_t) 0); -@@ -5316,11 +5346,11 @@ Perl_sync_locale() - * will affect the */ - if (cur_obj == LC_GLOBAL_LOCALE) { - --# ifdef HAS_QUERY_LOCALE -+# ifdef HAS_QUERY_LOCALE - - do_setlocale_c(LC_ALL, setlocale(LC_ALL, NULL)); - --# else -+# else - - unsigned int i; - -@@ -5330,17 +5360,17 @@ Perl_sync_locale() - do_setlocale_r(categories[i], setlocale(categories[i], NULL)); - } - --# endif -+# endif - - was_in_global_locale = TRUE; - } - --#else -+# else - - bool was_in_global_locale = TRUE; - --#endif --#ifdef USE_LOCALE_CTYPE -+# endif -+# ifdef USE_LOCALE_CTYPE - - newlocale = savepv(do_setlocale_c(LC_CTYPE, NULL)); - DEBUG_Lv(PerlIO_printf(Perl_debug_log, -@@ -5349,8 +5379,8 @@ Perl_sync_locale() - new_ctype(newlocale); - Safefree(newlocale); - --#endif /* USE_LOCALE_CTYPE */ --#ifdef USE_LOCALE_COLLATE -+# endif /* USE_LOCALE_CTYPE */ -+# ifdef USE_LOCALE_COLLATE - - newlocale = savepv(do_setlocale_c(LC_COLLATE, NULL)); - DEBUG_Lv(PerlIO_printf(Perl_debug_log, -@@ -5359,8 +5389,8 @@ Perl_sync_locale() - new_collate(newlocale); - Safefree(newlocale); - --#endif --#ifdef USE_LOCALE_NUMERIC -+# endif -+# ifdef USE_LOCALE_NUMERIC - - newlocale = savepv(do_setlocale_c(LC_NUMERIC, NULL)); - DEBUG_Lv(PerlIO_printf(Perl_debug_log, -@@ -5369,9 +5399,12 @@ Perl_sync_locale() - new_numeric(newlocale); - Safefree(newlocale); - --#endif /* USE_LOCALE_NUMERIC */ -+# endif /* USE_LOCALE_NUMERIC */ - - return was_in_global_locale; -+ -+#endif -+ - } - - #if defined(DEBUGGING) && defined(USE_LOCALE) ---- a/makedef.pl -+++ b/makedef.pl -@@ -574,6 +574,9 @@ unless ($define{USE_LOCALE_COLLATE}) { - PL_collxfrm_mult - Perl_sv_collxfrm - Perl_sv_collxfrm_flags -+ PL_strxfrm_NUL_replacement -+ PL_strxfrm_is_behaved -+ PL_strxfrm_max_cp - ); - } - -@@ -583,6 +586,9 @@ unless ($define{USE_LOCALE_NUMERIC}) { - PL_numeric_name - PL_numeric_radix_sv - PL_numeric_standard -+ PL_numeric_underlying -+ PL_numeric_underlying_is_standard -+ PL_underlying_numeric_obj - ); - } - ---- a/perl.h -+++ b/perl.h -@@ -5656,6 +5656,9 @@ typedef struct am_table_short AMTS; - # define IN_LC_COMPILETIME(category) 0 - # define IN_LC_RUNTIME(category) 0 - # define IN_LC(category) 0 -+# define _CHECK_AND_WARN_PROBLEMATIC_LOCALE -+# define _CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG(s, send) -+# define _CHECK_AND_OUTPUT_WIDE_LOCALE_CP_MSG(c) - #endif - - ---- a/proto.h -+++ b/proto.h -@@ -4886,8 +4886,6 @@ PERL_CALLCONV SV* Perl_hfree_next_entry( - assert(hv); assert(indexp) - #endif - #if defined(PERL_IN_LOCALE_C) --STATIC const char* S_category_name(const int category); --STATIC void S_restore_switched_locale(pTHX_ const int category, const char * const original_locale); - #ifndef PERL_NO_INLINE_FUNCTIONS - PERL_STATIC_INLINE const char * S_save_to_buffer(const char * string, char **buf, Size_t *buf_size, const Size_t offset) - __attribute__warn_unused_result__; -@@ -4895,17 +4893,19 @@ PERL_STATIC_INLINE const char * S_save_t - assert(buf_size) - #endif - --STATIC const char* S_switch_category_locale_to_template(pTHX_ const int switch_category, const int template_category, const char * template_locale); - # if defined(USE_LOCALE) -+STATIC const char* S_category_name(const int category); - STATIC void S_new_collate(pTHX_ const char* newcoll); - STATIC void S_new_ctype(pTHX_ const char* newctype); - #define PERL_ARGS_ASSERT_NEW_CTYPE \ - assert(newctype) - STATIC void S_new_numeric(pTHX_ const char* newnum); -+STATIC void S_restore_switched_locale(pTHX_ const int category, const char * const original_locale); - STATIC void S_set_numeric_radix(pTHX_ const bool use_locale); - STATIC char* S_stdize_locale(pTHX_ char* locs); - #define PERL_ARGS_ASSERT_STDIZE_LOCALE \ - assert(locs) -+STATIC const char* S_switch_category_locale_to_template(pTHX_ const int switch_category, const int template_category, const char * template_locale); - # if defined(USE_POSIX_2008_LOCALE) - STATIC const char* S_emulate_setlocale(const int category, const char* locale, unsigned int index, const bool is_index_valid); - # endif ---- a/sv.c -+++ b/sv.c -@@ -13330,10 +13330,15 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const s - - SvTAINT(sv); - -+#ifdef USE_LOCALE_NUMERIC -+ - if (lc_numeric_set) { - RESTORE_LC_NUMERIC(); /* Done outside loop, so don't have to - save/restore each iteration. */ - } -+ -+#endif -+ - } - - /* ========================================================================= ---- a/t/lib/warnings/regexec -+++ b/t/lib/warnings/regexec -@@ -215,6 +215,10 @@ Use of \b{} or \B{} for non-UTF-8 locale - Use of \b{} or \B{} for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 17. - ######## - # NAME (?[ ]) in non-UTF-8 locale -+require '../loc_tools.pl'; -+unless (locales_enabled()) { -+ print("SKIPPED\n# locales not available\n"),exit; -+} - eval { require POSIX; POSIX->import("locale_h") }; - if ($@) { - print("SKIPPED\n# no POSIX\n"),exit; -@@ -229,14 +233,14 @@ setlocale(&POSIX::LC_CTYPE, "C"); - ":" =~ /(?[ \: ])/; - no warnings 'locale'; - EXPECT --Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 9. --Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 9. --Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 10. --Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 10. --Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 11. --Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 11. --Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 12. --Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 12. -+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 13. -+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 13. -+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 14. -+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 14. -+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 15. -+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 15. -+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 16. -+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 16. - ######## - # NAME (?[ ]) in UTF-8 locale - require '../loc_tools.pl'; diff --git a/lang/perl/patches/998-Errno_errno.h_path.patch b/lang/perl/patches/998-Errno_errno.h_path.patch index a098210dd..d0ccec913 100644 --- a/lang/perl/patches/998-Errno_errno.h_path.patch +++ b/lang/perl/patches/998-Errno_errno.h_path.patch @@ -1,11 +1,11 @@ --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL -@@ -133,7 +133,7 @@ sub get_files { +@@ -115,7 +115,7 @@ sub get_files { # Some Linuxes have weird errno.hs which generate # no #file or #line directives - my ($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" } + ($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" } - "$sysroot/usr/include", "$sysroot/usr/local/include", + "$sysroot/usr/include", "$sysroot/usr/local/include", "$sysroot/include", - split / / => $Config{locincpth} or - die "Cannot find errno.h"; - $file{$linux_errno_h} = 1; + split / / => $Config{locincpth}; + } + diff --git a/lang/perl/patches/999-fix-build-failure-against-gcc-10.patch b/lang/perl/patches/999-fix-build-failure-against-gcc-10.patch deleted file mode 100644 index aa43f051b..000000000 --- a/lang/perl/patches/999-fix-build-failure-against-gcc-10.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 6bd6308fcea3541e505651bf8e8127a4a03d22cd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Tue, 12 Nov 2019 09:19:18 +0100 -Subject: [PATCH] Adapt Configure to GCC version 10 - -I got a notice from Jeff Law : - - Your particular package fails its testsuite. This was ultimately - tracked down to a Configure problem. The perl configure script treated - gcc-10 as gcc-1 and turned on -fpcc-struct-return. This is an ABI - changing flag and caused Perl to not be able to interact properly with - the dbm libraries on the system leading to a segfault. - -His proposed patch corrected only this one instance of the version -mismatch. Reading the Configure script revealed more issues. This -patch fixes all of them I found. - ---- - Configure | 14 +++++++------- - cflags.SH | 2 +- - 2 files changed, 8 insertions(+), 8 deletions(-) - ---- a/Configure -+++ b/Configure -@@ -4689,7 +4689,7 @@ else - fi - $rm -f try try.* - case "$gccversion" in --1*) cpp=`./loc gcc-cpp $cpp $pth` ;; -+1.*) cpp=`./loc gcc-cpp $cpp $pth` ;; - esac - case "$gccversion" in - '') gccosandvers='' ;; -@@ -4729,7 +4729,7 @@ esac - # gcc 3.* complain about adding -Idirectories that they already know about, - # so we will take those off from locincpth. - case "$gccversion" in --3*) -+3.*) - echo "main(){}">try.c - for incdir in $locincpth; do - warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \ -@@ -5455,13 +5455,13 @@ fi - case "$hint" in - default|recommended) - case "$gccversion" in -- 1*) dflt="$dflt -fpcc-struct-return" ;; -+ 1.*) dflt="$dflt -fpcc-struct-return" ;; - esac - case "$optimize:$DEBUGGING" in - *-g*:old) dflt="$dflt -DDEBUGGING";; - esac - case "$gccversion" in -- 2*) if $test -d /etc/conf/kconfig.d && -+ 2.*) if $test -d /etc/conf/kconfig.d && - $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 - then - # Interactive Systems (ISC) POSIX mode. -@@ -5470,7 +5470,7 @@ default|recommended) - ;; - esac - case "$gccversion" in -- 1*) ;; -+ 1.*) ;; - 2.[0-8]*) ;; - ?*) set strict-aliasing -fno-strict-aliasing - eval $checkccflag -@@ -5588,7 +5588,7 @@ case "$cppflags" in - ;; - esac - case "$gccversion" in --1*) cppflags="$cppflags -D__GNUC__" -+1.*) cppflags="$cppflags -D__GNUC__" - esac - case "$mips_type" in - '');; -@@ -22957,7 +22957,7 @@ fi - - : add -D_FORTIFY_SOURCE if feasible and not already there - case "$gccversion" in --[4567].*) case "$optimize$ccflags" in -+[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in - *-O*) case "$ccflags$cppsymbols" in - *_FORTIFY_SOURCE=*) # Don't add it again. - echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4 ---- a/cflags.SH -+++ b/cflags.SH -@@ -156,7 +156,7 @@ esac - - case "$gccversion" in - '') ;; --[12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this. -+[12].*) ;; # gcc versions 1 (gasp!) and 2 are not good for this. - Intel*) ;; # # Is that you, Intel C++? - # - # NOTE 1: the -std=c89 without -pedantic is a bit pointless. diff --git a/lang/perl/patches/999-fixup-regex-engine-build-under-Uusedl.patch b/lang/perl/patches/999-fixup-regex-engine-build-under-Uusedl.patch new file mode 100644 index 000000000..99cc13b9a --- /dev/null +++ b/lang/perl/patches/999-fixup-regex-engine-build-under-Uusedl.patch @@ -0,0 +1,541 @@ +From ba6e2c38aafc23cf114f3ba0d0ff3baead34328b Mon Sep 17 00:00:00 2001 +From: Yves Orton +Date: Tue, 1 Aug 2023 23:12:46 +0200 +Subject: [PATCH] regcomp*.c, regexec.c - fixup regex engine build under + -Uusedl + +The regex engine is built a bit different from most of the perl +codebase. It is compiled as part of the main libperl.so and it is +also compiled (with DEBUGGING enabled) as part of the re extension. +When perl itself is compiled with DEBUGGING enabled then the code +in the re.so extension and the code in libperl.so is the same. + +This all works fine and dandy until you have a static build where the +re.so is linked into libperl.so, which results in duplicate symbols +being defined. These symbols come in two flaviours: "auxiliary" and +"debugging" related symbols. + +We have basically three cases: + +1. USE_DYNAMIC_LOADING is defined. In this case we are doing a dynamic + build and re.so will be separate from libperl.so, so it even if this + is a DEBUGGING enabled build debug and auxiliary functions can be + compiled into *both* re.so and libperl.so. This is basically the + "standard build". + +2. USE_DYNAMIC_LOADING is not defined, and DEBUGGING is not defined + either. In this case auxiliary functions should only be compiled in + libperl.so, and the debug functions should only be compiled into + re.so + +3. USE_DYNAMIC_LOADING is not defined, and DEBUGGING *is* defined. In + this case auxiliary functions AND debug functions should only be + compiled into libperl.so + +It is possible to detect the different build options by looking at the +defines 'USE_DYNAMIC_LOADING', 'PERL_EXT_RE_DEBUG' and +'DEBUGGING_RE_ONLY'. 'USE_DYNAMIC_LOADING' is NOT defined when we are +building a static perl. 'PERL_EXT_RE_DEBUG' is defined only when we are +building re.so, and 'DEBUGGING_RE_ONLY' is defined only when we are +building re.so in a perl that is not itself already a DEBUGGING enabled +perl. The file ext/re/re_top.h responsible for setting up +DEBUGGING_RE_ONLY. + +This patch uses 'PERL_EXT_RE_DEBUG', 'DEBUGGING_RE_ONLY' and +'USE_DYNAMIC_LOADING' to define in regcomp.h two further define flags +'PERL_RE_BUILD_DEBUG' and 'PERL_RE_BUILD_AUX'. + +The 'PERL_RE_BUILD_DEBUG' flag determines if the debugging functions +should be compiled into libperl.so or re.so or both. The +'PERL_RE_BUILD_AUX' flag determines if the auxiliary functions should be +compiled into just libperl.so or into it and re.so. We then use these +flags to guard the different types of functions so that we can build in +all three modes without duplicate symbols. +--- + regcomp.c | 13 +- + regcomp.h | 14 ++- + regcomp_debug.c | 308 +++++++++++++++++++++++----------------------- + regcomp_invlist.c | 3 +- + regexec.c | 3 +- + 5 files changed, 181 insertions(+), 160 deletions(-) + +--- a/regcomp.c ++++ b/regcomp.c +@@ -290,6 +290,7 @@ S_edit_distance(const UV* src, + /* END of edit_distance() stuff + * ========================================================= */ + ++#ifdef PERL_RE_BUILD_AUX + /* add a data member to the struct reg_data attached to this regex, it should + * always return a non-zero return. the 's' argument is the type of the items + * being added and the n is the number of items. The length of 's' should match +@@ -340,6 +341,7 @@ Perl_reg_add_data(RExC_state_t* const pR + assert(count>0); + return count; + } ++#endif /* PERL_RE_BUILD_AUX */ + + /*XXX: todo make this not included in a non debugging perl, but appears to be + * used anyway there, in 'use re' */ +@@ -7443,6 +7445,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_stat + } + + ++#ifdef PERL_RE_BUILD_AUX + void + Perl_populate_anyof_bitmap_from_invlist(pTHX_ regnode *node, SV** invlist_ptr) + { +@@ -7502,6 +7505,7 @@ Perl_populate_anyof_bitmap_from_invlist( + } + } + } ++#endif /* PERL_RE_BUILD_AUX */ + + /* Parse POSIX character classes: [[:foo:]], [[=foo=]], [[.foo.]]. + Character classes ([:foo:]) can also be negated ([:^foo:]). +@@ -9095,6 +9099,7 @@ S_dump_regex_sets_structures(pTHX_ RExC_ + #undef IS_OPERATOR + #undef IS_OPERAND + ++#ifdef PERL_RE_BUILD_AUX + void + Perl_add_above_Latin1_folds(pTHX_ RExC_state_t *pRExC_state, const U8 cp, SV** invlist) + { +@@ -9182,6 +9187,8 @@ Perl_add_above_Latin1_folds(pTHX_ RExC_s + } + } + } ++#endif /* PERL_RE_BUILD_AUX */ ++ + + STATIC void + S_output_posix_warnings(pTHX_ RExC_state_t *pRExC_state, AV* posix_warnings) +@@ -12105,6 +12112,7 @@ S_optimize_regclass(pTHX_ + + #undef HAS_NONLOCALE_RUNTIME_PROPERTY_DEFINITION + ++#ifdef PERL_RE_BUILD_AUX + void + Perl_set_ANYOF_arg(pTHX_ RExC_state_t* const pRExC_state, + regnode* const node, +@@ -12261,6 +12269,7 @@ Perl_set_ANYOF_arg(pTHX_ RExC_state_t* c + RExC_rxi->data->data[n] = (void*)rv; + ARG1u_SET(node, n); + } ++#endif /* PERL_RE_BUILD_AUX */ + + SV * + +@@ -12999,6 +13008,8 @@ S_regtail_study(pTHX_ RExC_state_t *pREx + } + #endif + ++ ++#ifdef PERL_RE_BUILD_AUX + SV* + Perl_get_ANYOFM_contents(pTHX_ const regnode * n) { + +@@ -13047,7 +13058,7 @@ Perl_get_ANYOFHbbm_contents(pTHX_ const + UTF_CONTINUATION_MARK | 0)); + return cp_list; + } +- ++#endif /* PERL_RE_BUILD_AUX */ + + + SV * +--- a/regcomp.h ++++ b/regcomp.h +@@ -1554,7 +1554,19 @@ typedef enum { + #define EVAL_OPTIMISTIC_FLAG 128 + #define EVAL_FLAGS_MASK (EVAL_OPTIMISTIC_FLAG-1) + +- ++/* We define PERL_RE_BUILD_DEBUG if we are NOT compiling the re extension and ++ * we are under DEBUGGING, or if we are ARE compiling the re extension ++ * and this is not a DEBUGGING enabled build (identified by ++ * DEBUGGING_RE_ONLY being defined) ++ */ ++#if ( defined(USE_DYNAMIC_LOADING) && defined(DEBUGGING)) || \ ++ ( defined(PERL_EXT_RE_BUILD) && defined(DEBUGGING_RE_ONLY)) || \ ++ (!defined(PERL_EXT_RE_BUILD) && defined(DEBUGGING)) ++#define PERL_RE_BUILD_DEBUG ++#endif ++#if ( defined(USE_DYNAMIC_LOADING) || !defined(PERL_EXT_RE_BUILD) ) ++#define PERL_RE_BUILD_AUX ++#endif + + #endif /* PERL_REGCOMP_H_ */ + +--- a/regcomp_debug.c ++++ b/regcomp_debug.c +@@ -18,8 +18,7 @@ + #include "unicode_constants.h" + #include "regcomp_internal.h" + +-#ifdef DEBUGGING +- ++#ifdef PERL_RE_BUILD_DEBUG + int + Perl_re_printf(pTHX_ const char *fmt, ...) + { +@@ -159,13 +158,160 @@ Perl_debug_peep(pTHX_ const char *str, c + }); + } + +-#endif /* DEBUGGING */ ++const regnode * ++Perl_dumpuntil(pTHX_ const regexp *r, const regnode *start, const regnode *node, ++ const regnode *last, const regnode *plast, ++ SV* sv, I32 indent, U32 depth) ++{ ++ const regnode *next; ++ const regnode *optstart= NULL; ++ ++ RXi_GET_DECL(r, ri); ++ DECLARE_AND_GET_RE_DEBUG_FLAGS; ++ ++ PERL_ARGS_ASSERT_DUMPUNTIL; ++ ++#ifdef DEBUG_DUMPUNTIL ++ Perl_re_printf( aTHX_ "--- %d : %d - %d - %d\n", indent, node-start, ++ last ? last-start : 0, plast ? plast-start : 0); ++#endif ++ ++ if (plast && plast < last) ++ last= plast; ++ ++ while (node && (!last || node < last)) { ++ const U8 op = OP(node); ++ ++ if (op == CLOSE || op == SRCLOSE || op == WHILEM) ++ indent--; ++ next = regnext((regnode *)node); ++ const regnode *after = regnode_after((regnode *)node,0); ++ ++ /* Where, what. */ ++ if (op == OPTIMIZED) { ++ if (!optstart && RE_DEBUG_FLAG(RE_DEBUG_COMPILE_OPTIMISE)) ++ optstart = node; ++ else ++ goto after_print; ++ } else ++ CLEAR_OPTSTART; ++ ++ regprop(r, sv, node, NULL, NULL); ++ Perl_re_printf( aTHX_ "%4" IVdf ":%*s%s", (IV)(node - start), ++ (int)(2*indent + 1), "", SvPVX_const(sv)); ++ ++ if (op != OPTIMIZED) { ++ if (next == NULL) /* Next ptr. */ ++ Perl_re_printf( aTHX_ " (0)"); ++ else if (REGNODE_TYPE(op) == BRANCH ++ && REGNODE_TYPE(OP(next)) != BRANCH ) ++ Perl_re_printf( aTHX_ " (FAIL)"); ++ else ++ Perl_re_printf( aTHX_ " (%" IVdf ")", (IV)(next - start)); ++ Perl_re_printf( aTHX_ "\n"); ++ } ++ ++ after_print: ++ if (REGNODE_TYPE(op) == BRANCHJ) { ++ assert(next); ++ const regnode *nnode = (OP(next) == LONGJMP ++ ? regnext((regnode *)next) ++ : next); ++ if (last && nnode > last) ++ nnode = last; ++ DUMPUNTIL(after, nnode); ++ } ++ else if (REGNODE_TYPE(op) == BRANCH) { ++ assert(next); ++ DUMPUNTIL(after, next); ++ } ++ else if ( REGNODE_TYPE(op) == TRIE ) { ++ const regnode *this_trie = node; ++ const U32 n = ARG1u(node); ++ const reg_ac_data * const ac = op>=AHOCORASICK ? ++ (reg_ac_data *)ri->data->data[n] : ++ NULL; ++ const reg_trie_data * const trie = ++ (reg_trie_data*)ri->data->data[optrie]; ++#ifdef DEBUGGING ++ AV *const trie_words ++ = MUTABLE_AV(ri->data->data[n + TRIE_WORDS_OFFSET]); ++#endif ++ const regnode *nextbranch= NULL; ++ I32 word_idx; ++ SvPVCLEAR(sv); ++ for (word_idx= 0; word_idx < (I32)trie->wordcount; word_idx++) { ++ SV ** const elem_ptr = av_fetch_simple(trie_words, word_idx, 0); ++ ++ Perl_re_indentf( aTHX_ "%s ", ++ indent+3, ++ elem_ptr ++ ? pv_pretty(sv, SvPV_nolen_const(*elem_ptr), ++ SvCUR(*elem_ptr), PL_dump_re_max_len, ++ PL_colors[0], PL_colors[1], ++ (SvUTF8(*elem_ptr) ++ ? PERL_PV_ESCAPE_UNI ++ : 0) ++ | PERL_PV_PRETTY_ELLIPSES ++ | PERL_PV_PRETTY_LTGT ++ ) ++ : "???" ++ ); ++ if (trie->jump) { ++ U16 dist= trie->jump[word_idx+1]; ++ Perl_re_printf( aTHX_ "(%" UVuf ")\n", ++ (UV)((dist ? this_trie + dist : next) - start)); ++ if (dist) { ++ if (!nextbranch) ++ nextbranch= this_trie + trie->jump[0]; ++ DUMPUNTIL(this_trie + dist, nextbranch); ++ } ++ if (nextbranch && REGNODE_TYPE(OP(nextbranch))==BRANCH) ++ nextbranch= regnext((regnode *)nextbranch); ++ } else { ++ Perl_re_printf( aTHX_ "\n"); ++ } ++ } ++ if (last && next > last) ++ node= last; ++ else ++ node= next; ++ } ++ else if ( op == CURLY ) { /* "next" might be very big: optimizer */ ++ DUMPUNTIL(after, after + 1); /* +1 is NOT a REGNODE_AFTER */ ++ } ++ else if (REGNODE_TYPE(op) == CURLY && op != CURLYX) { ++ assert(next); ++ DUMPUNTIL(after, next); ++ } ++ else if ( op == PLUS || op == STAR) { ++ DUMPUNTIL(after, after + 1); /* +1 NOT a REGNODE_AFTER */ ++ } ++ else if (REGNODE_TYPE(op) == EXACT || op == ANYOFHs) { ++ /* Literal string, where present. */ ++ node = (const regnode *)REGNODE_AFTER_varies(node); ++ } ++ else { ++ node = REGNODE_AFTER_opcode(node,op); ++ } ++ if (op == CURLYX || op == OPEN || op == SROPEN) ++ indent++; ++ if (REGNODE_TYPE(op) == END) ++ break; ++ } ++ CLEAR_OPTSTART; ++#ifdef DEBUG_DUMPUNTIL ++ Perl_re_printf( aTHX_ "--- %d\n", (int)indent); ++#endif ++ return node; ++} ++ ++#endif /* PERL_RE_BUILD_DEBUG */ + + /* + - regdump - dump a regexp onto Perl_debug_log in vaguely comprehensible form + */ + #ifdef DEBUGGING +- + static void + S_regdump_intflags(pTHX_ const char *lead, const U32 flags) + { +@@ -907,8 +1053,8 @@ Perl_regprop(pTHX_ const regexp *prog, S + #endif /* DEBUGGING */ + } + +-#ifdef DEBUGGING + ++#ifdef DEBUGGING + STATIC void + S_put_code_point(pTHX_ SV *sv, UV c) + { +@@ -1517,154 +1663,4 @@ S_put_charclass_bitmap_innards(pTHX_ SV + + return did_output_something; + } +- +- +-const regnode * +-Perl_dumpuntil(pTHX_ const regexp *r, const regnode *start, const regnode *node, +- const regnode *last, const regnode *plast, +- SV* sv, I32 indent, U32 depth) +-{ +- const regnode *next; +- const regnode *optstart= NULL; +- +- RXi_GET_DECL(r, ri); +- DECLARE_AND_GET_RE_DEBUG_FLAGS; +- +- PERL_ARGS_ASSERT_DUMPUNTIL; +- +-#ifdef DEBUG_DUMPUNTIL +- Perl_re_printf( aTHX_ "--- %d : %d - %d - %d\n", indent, node-start, +- last ? last-start : 0, plast ? plast-start : 0); +-#endif +- +- if (plast && plast < last) +- last= plast; +- +- while (node && (!last || node < last)) { +- const U8 op = OP(node); +- +- if (op == CLOSE || op == SRCLOSE || op == WHILEM) +- indent--; +- next = regnext((regnode *)node); +- const regnode *after = regnode_after((regnode *)node,0); +- +- /* Where, what. */ +- if (op == OPTIMIZED) { +- if (!optstart && RE_DEBUG_FLAG(RE_DEBUG_COMPILE_OPTIMISE)) +- optstart = node; +- else +- goto after_print; +- } else +- CLEAR_OPTSTART; +- +- regprop(r, sv, node, NULL, NULL); +- Perl_re_printf( aTHX_ "%4" IVdf ":%*s%s", (IV)(node - start), +- (int)(2*indent + 1), "", SvPVX_const(sv)); +- +- if (op != OPTIMIZED) { +- if (next == NULL) /* Next ptr. */ +- Perl_re_printf( aTHX_ " (0)"); +- else if (REGNODE_TYPE(op) == BRANCH +- && REGNODE_TYPE(OP(next)) != BRANCH ) +- Perl_re_printf( aTHX_ " (FAIL)"); +- else +- Perl_re_printf( aTHX_ " (%" IVdf ")", (IV)(next - start)); +- Perl_re_printf( aTHX_ "\n"); +- } +- +- after_print: +- if (REGNODE_TYPE(op) == BRANCHJ) { +- assert(next); +- const regnode *nnode = (OP(next) == LONGJMP +- ? regnext((regnode *)next) +- : next); +- if (last && nnode > last) +- nnode = last; +- DUMPUNTIL(after, nnode); +- } +- else if (REGNODE_TYPE(op) == BRANCH) { +- assert(next); +- DUMPUNTIL(after, next); +- } +- else if ( REGNODE_TYPE(op) == TRIE ) { +- const regnode *this_trie = node; +- const U32 n = ARG1u(node); +- const reg_ac_data * const ac = op>=AHOCORASICK ? +- (reg_ac_data *)ri->data->data[n] : +- NULL; +- const reg_trie_data * const trie = +- (reg_trie_data*)ri->data->data[optrie]; +-#ifdef DEBUGGING +- AV *const trie_words +- = MUTABLE_AV(ri->data->data[n + TRIE_WORDS_OFFSET]); +-#endif +- const regnode *nextbranch= NULL; +- I32 word_idx; +- SvPVCLEAR(sv); +- for (word_idx= 0; word_idx < (I32)trie->wordcount; word_idx++) { +- SV ** const elem_ptr = av_fetch_simple(trie_words, word_idx, 0); +- +- Perl_re_indentf( aTHX_ "%s ", +- indent+3, +- elem_ptr +- ? pv_pretty(sv, SvPV_nolen_const(*elem_ptr), +- SvCUR(*elem_ptr), PL_dump_re_max_len, +- PL_colors[0], PL_colors[1], +- (SvUTF8(*elem_ptr) +- ? PERL_PV_ESCAPE_UNI +- : 0) +- | PERL_PV_PRETTY_ELLIPSES +- | PERL_PV_PRETTY_LTGT +- ) +- : "???" +- ); +- if (trie->jump) { +- U16 dist= trie->jump[word_idx+1]; +- Perl_re_printf( aTHX_ "(%" UVuf ")\n", +- (UV)((dist ? this_trie + dist : next) - start)); +- if (dist) { +- if (!nextbranch) +- nextbranch= this_trie + trie->jump[0]; +- DUMPUNTIL(this_trie + dist, nextbranch); +- } +- if (nextbranch && REGNODE_TYPE(OP(nextbranch))==BRANCH) +- nextbranch= regnext((regnode *)nextbranch); +- } else { +- Perl_re_printf( aTHX_ "\n"); +- } +- } +- if (last && next > last) +- node= last; +- else +- node= next; +- } +- else if ( op == CURLY ) { /* "next" might be very big: optimizer */ +- DUMPUNTIL(after, after + 1); /* +1 is NOT a REGNODE_AFTER */ +- } +- else if (REGNODE_TYPE(op) == CURLY && op != CURLYX) { +- assert(next); +- DUMPUNTIL(after, next); +- } +- else if ( op == PLUS || op == STAR) { +- DUMPUNTIL(after, after + 1); /* +1 NOT a REGNODE_AFTER */ +- } +- else if (REGNODE_TYPE(op) == EXACT || op == ANYOFHs) { +- /* Literal string, where present. */ +- node = (const regnode *)REGNODE_AFTER_varies(node); +- } +- else { +- node = REGNODE_AFTER_opcode(node,op); +- } +- if (op == CURLYX || op == OPEN || op == SROPEN) +- indent++; +- if (REGNODE_TYPE(op) == END) +- break; +- } +- CLEAR_OPTSTART; +-#ifdef DEBUG_DUMPUNTIL +- Perl_re_printf( aTHX_ "--- %d\n", (int)indent); +-#endif +- return node; +-} +- +-#endif /* DEBUGGING */ ++#endif /* DEBUGGING */ +--- a/regcomp_invlist.c ++++ b/regcomp_invlist.c +@@ -18,7 +18,7 @@ + #include "unicode_constants.h" + #include "regcomp_internal.h" + +- ++#ifdef PERL_RE_BUILD_AUX + void + Perl_populate_bitmap_from_invlist(pTHX_ SV * invlist, const UV offset, const U8 * bitmap, const Size_t len) + { +@@ -70,6 +70,7 @@ Perl_populate_invlist_from_bitmap(pTHX_ + } + } + } ++#endif /* PERL_RE_BUILD_AUX */ + + /* This section of code defines the inversion list object and its methods. The + * interfaces are highly subject to change, so as much as possible is static to +--- a/regexec.c ++++ b/regexec.c +@@ -4421,7 +4421,8 @@ S_regtry(pTHX_ regmatch_info *reginfo, c + */ + #define REPORT_CODE_OFF 29 + #define INDENT_CHARS(depth) ((int)(depth) % 20) +-#ifdef DEBUGGING ++ ++#ifdef PERL_RE_BUILD_DEBUG + int + Perl_re_exec_indentf(pTHX_ const char *fmt, U32 depth, ...) + { diff --git a/lang/perl/perlbase.mk b/lang/perl/perlbase.mk index e23bf8ef5..f3d65a517 100644 --- a/lang/perl/perlbase.mk +++ b/lang/perl/perlbase.mk @@ -51,20 +51,6 @@ endef $(eval $(call BuildPackage,perlbase-archive)) -define Package/perlbase-arybase -$(call Package/perlbase-template) -TITLE:=arybase perl module -DEPENDS+=+perlbase-xsloader -endef - -define Package/perlbase-arybase/install -$(call perlmod/Install,$(1),arybase.pm auto/arybase,) -$(call perlmod/InstallBaseTests,$(1),ext/arybase/t) -endef - -$(eval $(call BuildPackage,perlbase-arybase)) - - define Package/perlbase-attribute $(call Package/perlbase-template) TITLE:=Attribute perl module @@ -725,7 +711,7 @@ endef define Package/perlbase-findbin/install $(call perlmod/Install,$(1),FindBin.pm,) -$(call perlmod/InstallBaseTests,$(1),lib/FindBin.t) +$(call perlmod/InstallBaseTests,$(1),dist/FindBin/t) endef $(eval $(call BuildPackage,perlbase-findbin)) @@ -1441,7 +1427,7 @@ DEPENDS+=+perlbase-essential +perlbase-fcntl +perlbase-xsloader endef define Package/perlbase-tie/install -$(call perlmod/Install,$(1),Tie auto/Tie,) +$(call perlmod/Install,$(1),Tie,) $(call perlmod/InstallBaseTests,$(1),cpan/Tie-RefHash/t dist/Tie-File/t ext/Tie-Hash-NamedCapture/t ext/Tie-Memoize/lib/Tie/Memoize.pm ext/Tie-Memoize/t lib/Tie/Array/push.t lib/Tie/Array/splice.t lib/Tie/Array/std.t lib/Tie/Array/stdpush.t lib/Tie/ExtraHash.t lib/Tie/Handle/stdhandle.t lib/Tie/Handle/stdhandle_from_handle.t lib/Tie/Hash.t lib/Tie/Scalar.t lib/Tie/SubstrHash.t) endef @@ -1522,7 +1508,7 @@ DEPENDS+=+perlbase-essential +perlbase-re +perlbase-unicore endef define Package/perlbase-utf8/install -$(call perlmod/Install,$(1),utf8.pm utf8_heavy.pl,) +$(call perlmod/Install,$(1),utf8.pm,) $(call perlmod/InstallBaseTests,$(1),lib/utf8.t) endef diff --git a/lang/perl/perlver.mk b/lang/perl/perlver.mk index dbec8151e..465140bf1 100644 --- a/lang/perl/perlver.mk +++ b/lang/perl/perlver.mk @@ -1,4 +1,4 @@ -PERL_VERSION:=5.28.1 +PERL_VERSION:=5.38.0 PERL_EXPLODE:=$(subst ., ,$(PERL_VERSION)) diff --git a/lang/python/python-argcomplete/Makefile b/lang/python/python-argcomplete/Makefile index d977f01a2..534131ec4 100644 --- a/lang/python/python-argcomplete/Makefile +++ b/lang/python/python-argcomplete/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-argcomplete -PKG_VERSION:=3.1.4 +PKG_VERSION:=3.1.6 PKG_RELEASE:=1 PYPI_NAME:=argcomplete -PKG_HASH:=72558ba729e4c468572609817226fb0a6e7e9a0a7d477b882be168c0b4a62b94 +PKG_HASH:=3b1f07d133332547a53c79437527c00be48cca3807b1d4ca5cab1b26313386a6 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE.rst diff --git a/lang/python/python-fnv-hash-fast/Makefile b/lang/python/python-fnv-hash-fast/Makefile new file mode 100644 index 000000000..b4758598e --- /dev/null +++ b/lang/python/python-fnv-hash-fast/Makefile @@ -0,0 +1,38 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-fnv-hash-fast +PKG_VERSION:=0.5.0 +PKG_RELEASE:=1 + +PYPI_NAME:=fnv-hash-fast +PYPI_SOURCE_NAME:=fnv_hash_fast +PKG_HASH:=a84d658952776a186418f4158fc8e55ff3c576ac32cc9ef7f8077efdf2d0b89f + +PKG_MAINTAINER:=Timothy Ace +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DEPENDS:=python-cython/host python-poetry-core/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-fnv-hash-fast + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=A fast version of fnv1a + URL:=https://github.com/bdraco/fnv-hash-fast + DEPENDS:=+libstdcpp +python3-light +python3-fnvhash +endef + +define Package/python3-fnv-hash-fast/description +A fast version of fnv1a. This library will use a CPP implementation of fnv1a +(32) if cython is available, and will fallback to pure python from the fnvhash +package if it is not. +endef + +$(eval $(call Py3Package,python3-fnv-hash-fast)) +$(eval $(call BuildPackage,python3-fnv-hash-fast)) +$(eval $(call BuildPackage,python3-fnv-hash-fast-src)) diff --git a/lang/python/python-fnvhash/Makefile b/lang/python/python-fnvhash/Makefile new file mode 100644 index 000000000..b0c2316d2 --- /dev/null +++ b/lang/python/python-fnvhash/Makefile @@ -0,0 +1,33 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-fnvhash +PKG_VERSION:=0.1.0 +PKG_RELEASE:=1 + +PYPI_NAME:=fnvhash +PKG_HASH:=3e82d505054f9f3987b2b5b649f7e7b6f48349f6af8a1b8e4d66779699c85a8e + +PKG_MAINTAINER:=Timothy Ace +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-fnvhash + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Pure Python FNV hash implementation + URL:=https://github.com/znerol/py-fnvhash + DEPENDS:=+python3-light +endef + +define Package/python3-fnvhash/description +Pure Python implementation of the FNV hash family with 100% test coverage. +endef + +$(eval $(call Py3Package,python3-fnvhash)) +$(eval $(call BuildPackage,python3-fnvhash)) +$(eval $(call BuildPackage,python3-fnvhash-src)) diff --git a/lang/python/python-lru-dict/Makefile b/lang/python/python-lru-dict/Makefile new file mode 100644 index 000000000..a5171d6e0 --- /dev/null +++ b/lang/python/python-lru-dict/Makefile @@ -0,0 +1,37 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-lru-dict +PKG_VERSION:=1.3.0 +PKG_RELEASE:=1 + +PYPI_NAME:=lru-dict +PKG_HASH:=54fd1966d6bd1fcde781596cb86068214edeebff1db13a2cea11079e3fd07b6b + +PKG_MAINTAINER:=Timothy Ace +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-lru-dict + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=An Dict like LRU container + URL:=https://github.com/amitdev/lru-dict + DEPENDS:=+python3-light +endef + +define Package/python3-lru-dict/description +A fixed size dict like container which evicts Least Recently Used (LRU) items +once size limit is exceeded. There are many python implementations available +which does similar things. This is a fast and efficient C implementation. LRU +maximum capacity can be modified at run-time. If you are looking for pure +python version, look elsewhere. +endef + +$(eval $(call Py3Package,python3-lru-dict)) +$(eval $(call BuildPackage,python3-lru-dict)) +$(eval $(call BuildPackage,python3-lru-dict-src)) diff --git a/lang/python/python-orjson/Makefile b/lang/python/python-orjson/Makefile new file mode 100644 index 000000000..39ef2cf52 --- /dev/null +++ b/lang/python/python-orjson/Makefile @@ -0,0 +1,37 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-orjson +PKG_VERSION:=3.9.10 +PKG_RELEASE:=1 + +PYPI_NAME:=orjson +PKG_HASH:=9ebbdbd6a046c304b1845e96fbcc5559cd296b4dfd3ad2509e33c4d9ce07d6a1 + +PKG_MAINTAINER:=Timothy Ace +PKG_LICENSE:=Apache-2.0 MIT +PKG_LICENSE_FILES:=LICENSE-APACHE LICENSE-MIT + +PKG_BUILD_DEPENDS:=python-maturin/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-orjson + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Fast, correct Python JSON library + URL:=https://github.com/ijl/orjson + DEPENDS:= \ + +python3-light \ + $(RUST_ARCH_DEPENDS) +endef + +define Package/python3-orjson/description +Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy +endef + +$(eval $(call Py3Package,python3-orjson)) +$(eval $(call BuildPackage,python3-orjson)) +$(eval $(call BuildPackage,python3-orjson-src)) diff --git a/lang/python/python-trove-classifiers/Makefile b/lang/python/python-trove-classifiers/Makefile index 67f3e8ff9..27e5e5729 100644 --- a/lang/python/python-trove-classifiers/Makefile +++ b/lang/python/python-trove-classifiers/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-trove-classifiers -PKG_VERSION:=2023.11.9 +PKG_VERSION:=2023.11.14 PKG_RELEASE:=1 PYPI_NAME:=trove-classifiers -PKG_HASH:=0542bc03d151f8af84f0eb0e74aa931b374b6f9c8ed8fbf7ee41989fb9d40f1d +PKG_HASH:=64b5e78305a5de347f2cd7ec8c12d704a3ef0cb85cc10c0ca5f73488d1c201f8 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 78d95d3d9..ba322cf1d 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rust -PKG_VERSION:=1.73.0 -PKG_RELEASE:=2 +PKG_VERSION:=1.74.0 +PKG_RELEASE:=1 PKG_SOURCE:=rustc-$(PKG_VERSION)-src.tar.gz PKG_SOURCE_URL:=https://static.rust-lang.org/dist/ -PKG_HASH:=96d62e6d1f2d21df7ac8acb3b9882411f9e7c7036173f7f2ede9e1f1f6b1bb3a +PKG_HASH:=882b584bc321c5dcfe77cdaa69f277906b936255ef7808fcd5c7492925cf1049 HOST_BUILD_DIR:=$(BUILD_DIR)/host/rustc-$(PKG_VERSION)-src PKG_MAINTAINER:=Luca Barbato diff --git a/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch b/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch index f2a40f76b..a700a007d 100644 --- a/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch +++ b/lang/rust/patches/0001-Update-xz2-and-use-it-static.patch @@ -11,7 +11,7 @@ Subject: [PATCH] Update xz2 and use it static --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock -@@ -434,9 +434,9 @@ dependencies = [ +@@ -424,9 +424,9 @@ dependencies = [ [[package]] name = "lzma-sys" @@ -23,7 +23,7 @@ Subject: [PATCH] Update xz2 and use it static dependencies = [ "cc", "libc", -@@ -903,9 +903,9 @@ dependencies = [ +@@ -871,9 +871,9 @@ dependencies = [ [[package]] name = "xz2" diff --git a/lang/rust/patches/0002-rustc-bootstrap-cache.patch b/lang/rust/patches/0002-rustc-bootstrap-cache.patch index f3e814e8f..d678a6dd8 100644 --- a/lang/rust/patches/0002-rustc-bootstrap-cache.patch +++ b/lang/rust/patches/0002-rustc-bootstrap-cache.patch @@ -1,6 +1,6 @@ --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py -@@ -546,7 +546,7 @@ class RustBuild(object): +@@ -557,7 +557,7 @@ class RustBuild(object): shutil.rmtree(bin_root) key = self.stage0_compiler.date @@ -11,7 +11,7 @@ os.makedirs(rustc_cache) --- a/src/bootstrap/download.rs +++ b/src/bootstrap/download.rs -@@ -202,7 +202,13 @@ impl Config { +@@ -211,7 +211,13 @@ impl Config { Some(other) => panic!("unsupported protocol {other} in {url}"), None => panic!("no protocol in {url}"), } @@ -26,7 +26,7 @@ } fn download_http_with_retries(&self, tempfile: &Path, url: &str, help_on_error: &str) { -@@ -520,7 +526,10 @@ impl Config { +@@ -529,7 +535,10 @@ impl Config { key: &str, destination: &str, ) { @@ -38,7 +38,7 @@ let cache_dir = cache_dst.join(key); if !cache_dir.exists() { t!(fs::create_dir_all(&cache_dir)); -@@ -647,7 +656,10 @@ download-rustc = false +@@ -656,7 +665,10 @@ download-rustc = false let llvm_assertions = self.llvm_assertions; let cache_prefix = format!("llvm-{llvm_sha}-{llvm_assertions}"); diff --git a/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch b/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch index bd1c4b589..7d0291674 100644 --- a/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch +++ b/lang/rust/patches/0003-bump-libc-deps-to-0.2.146.patch @@ -1,19 +1,19 @@ -This patch bumps all libc dependencies and checksums to 0.2.146, which includes the fix for musl 1.2.4. +This patch bumps all libc dependencies and checksums to 0.2.147, which includes the fix for musl 1.2.4. ---- a/vendor/addr2line-0.20.0/Cargo.lock -+++ b/vendor/addr2line-0.20.0/Cargo.lock -@@ -246,9 +246,9 @@ checksum = "e2abad23fbc42b3700f2f279844d +--- a/vendor/addr2line-0.19.0/Cargo.lock ++++ b/vendor/addr2line-0.19.0/Cargo.lock +@@ -235,9 +235,9 @@ checksum = "e2abad23fbc42b3700f2f279844d [[package]] name = "libc" --version = "0.2.141" -+version = "0.2.146" +-version = "0.2.126" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +-checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] - name = "libtest-mimic" + name = "memchr" --- a/vendor/backtrace-0.3.67/Cargo.lock +++ b/vendor/backtrace-0.3.67/Cargo.lock @@ -64,9 +64,9 @@ checksum = "dec7af912d60cdbd3677c1af9352 @@ -21,27 +21,13 @@ This patch bumps all libc dependencies and checksums to 0.2.146, which includes [[package]] name = "libc" -version = "0.2.138" -+version = "0.2.146" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" ---- a/vendor/bstr/Cargo.lock -+++ b/vendor/bstr/Cargo.lock -@@ -34,9 +34,9 @@ dependencies = [ - - [[package]] - name = "libc" --version = "0.2.138" -+version = "0.2.146" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" - - [[package]] - name = "memchr" --- a/vendor/cranelift-jit/Cargo.lock +++ b/vendor/cranelift-jit/Cargo.lock @@ -224,9 +224,9 @@ dependencies = [ @@ -49,10 +35,10 @@ This patch bumps all libc dependencies and checksums to 0.2.146, which includes [[package]] name = "libc" -version = "0.2.141" -+version = "0.2.146" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "log" @@ -63,10 +49,10 @@ This patch bumps all libc dependencies and checksums to 0.2.146, which includes [[package]] name = "libc" -version = "0.2.141" -+version = "0.2.146" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "num_cpus" @@ -77,10 +63,10 @@ This patch bumps all libc dependencies and checksums to 0.2.146, which includes [[package]] name = "libc" -version = "0.2.140" -+version = "0.2.146" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "lindera" @@ -91,10 +77,10 @@ This patch bumps all libc dependencies and checksums to 0.2.146, which includes [[package]] name = "libc" -version = "0.2.140" -+version = "0.2.146" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "lock_api" @@ -105,10 +91,10 @@ This patch bumps all libc dependencies and checksums to 0.2.146, which includes [[package]] name = "libc" -version = "0.2.141" -+version = "0.2.146" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "litemap" @@ -119,38 +105,24 @@ This patch bumps all libc dependencies and checksums to 0.2.146, which includes [[package]] name = "libc" -version = "0.2.140" -+version = "0.2.146" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libffi" ---- a/vendor/terminal_size/Cargo.lock -+++ b/vendor/terminal_size/Cargo.lock -@@ -47,9 +47,9 @@ dependencies = [ - - [[package]] - name = "libc" --version = "0.2.140" -+version = "0.2.146" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" - - [[package]] - name = "linux-raw-sys" --- a/vendor/tracing-tree/Cargo.lock +++ b/vendor/tracing-tree/Cargo.lock -@@ -100,9 +100,9 @@ checksum = "e2abad23fbc42b3700f2f279844d +@@ -296,9 +296,9 @@ checksum = "e2abad23fbc42b3700f2f279844d [[package]] name = "libc" -version = "0.2.141" -+version = "0.2.146" ++version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" -+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] - name = "log" + name = "linux-raw-sys" diff --git a/libs/quasselc/Makefile b/libs/quasselc/Makefile deleted file mode 100644 index 7fd729576..000000000 --- a/libs/quasselc/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# -# Copyright (C) 2016 Ben Rosser -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=quasselc -PKG_SOURCE_DATE:=2017-01-11 -PKG_SOURCE_VERSION:=a0a1e6bd87d3eac68b5369972d1c2035cfe47e94 -PKG_RELEASE:=4 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/phhusson/QuasselC/tar.gz/$(PKG_SOURCE_VERSION)? -PKG_HASH:=fe7b48a13c0e6dad81cdae18069d4f5607af64d73a3201f42d79548170dde510 -PKG_BUILD_DIR:=$(BUILD_DIR)/QuasselC-$(PKG_SOURCE_VERSION) - -PKG_MAINTAINER:=Ben Rosser -PKG_LICENSE:=LGPL-3.0 -PKG_LICENSE_FILES:=COPYING.LESSER - -PKG_BUILD_PARALLEL:=1 -PKG_INSTALL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk - -MAKE_FLAGS += prefix=$(STAGING_DIR)/usr libdir=$(STAGING_DIR)/usr/lib includedir=$(STAGING_DIR)/usr/include -MAKE_INSTALL_FLAGS += prefix=/usr libdir=/usr/lib includedir=/usr/include - -define Package/quasselc - SECTION:=libs - CATEGORY:=Libraries - DEPENDS:=+glib2 - SUBMENU:=Instant Messaging - URL:=https://github.com/phhusson/QuasselC - TITLE:=API to access a Quassel Core in pure C -endef - -define Package/quasselc/description - An implementation of the Quassel protocol in pure C. -endef - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include/quasselc - $(CP) $(PKG_INSTALL_DIR)/usr/include/quasselc/* $(1)/usr/include/quasselc/ - - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libquasselc.so* $(1)/usr/lib/ - $(LN) libquasselc.so.0 $(1)/usr/lib/libquasselc.so - - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/quasselc.pc $(1)/usr/lib/pkgconfig/ -endef - -define Package/quasselc/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libquasselc.so* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,quasselc)) diff --git a/libs/quasselc/patches/001-respect-cflags-ldflags.patch b/libs/quasselc/patches/001-respect-cflags-ldflags.patch deleted file mode 100644 index e5c8f61b7..000000000 --- a/libs/quasselc/patches/001-respect-cflags-ldflags.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -2,11 +2,11 @@ prefix ?= /usr/local - libdir ?= $(prefix)/lib - includedir ?= $(prefix)/include - --CFLAGS:=-Wall -g -Wextra $(shell pkg-config glib-2.0 --cflags) -Wswitch-enum -std=gnu11 -O2 -fPIC -+CFLAGS+=-Wall -g -Wextra $(shell pkg-config glib-2.0 --cflags) -Wswitch-enum -std=gnu11 -fPIC - SO_VERSION = 0 - VERSION = 0 - INSTALL = install --LDLIBS:=$(shell pkg-config glib-2.0 --libs) -lz -+LDFLAGS+=$(shell pkg-config glib-2.0 --libs) -lz - - BOTLIBS := -Wl,-rpath,. - -@@ -15,10 +15,10 @@ lib_objects=setters.o getters.o main.o c - all: bot libquasselc.so.$(VERSION) quasselc.pc - - libquasselc.so.$(VERSION): $(lib_objects) -- $(CC) -shared -o $@ -Wl,-soname,libquasselc.so.$(SO_VERSION) $^ $(LDLIBS) -+ $(CC) -shared -o $@ -Wl,-soname,libquasselc.so.$(SO_VERSION) $^ $(LDFLAGS) - - bot: bot.o display.o libquasselc.so.$(VERSION) -- $(CC) -o $@ $^ $(LDLIBS) $(BOTLIBS) -+ $(CC) -o $@ $^ $(LDFLAGS) $(BOTLIBS) - - clean: - rm -f *.o bot libquasselc.so.$(VERSION) quasselc.pc diff --git a/net/acme-acmesh/Makefile b/net/acme-acmesh/Makefile index a97326f34..efbed1852 100644 --- a/net/acme-acmesh/Makefile +++ b/net/acme-acmesh/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=acme-acmesh -PKG_VERSION:=3.0.6 +PKG_VERSION:=3.0.7 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/acmesh-official/acme.sh/tar.gz/$(PKG_VERSION)? -PKG_HASH:=4a8e44c27e2a8f01a978e8d15add8e9908b83f9b1555670e49a9b769421f5fa6 +PKG_HASH:=abd446d6bd45d0b44dca1dcbd931348797a3f82d1ed6fb171472eaf851a8d849 PKG_BUILD_DIR:=$(BUILD_DIR)/acme.sh-$(PKG_VERSION) PKG_MAINTAINER:=Toke Høiland-Jørgensen diff --git a/net/adblock-fast/Makefile b/net/adblock-fast/Makefile index 35d206acb..51824a331 100644 --- a/net/adblock-fast/Makefile +++ b/net/adblock-fast/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock-fast PKG_VERSION:=1.0.1 -PKG_RELEASE:=2 +PKG_RELEASE:=5 PKG_MAINTAINER:=Stan Grishin PKG_LICENSE:=GPL-3.0-or-later diff --git a/net/adblock-fast/files/etc/config/adblock-fast b/net/adblock-fast/files/etc/config/adblock-fast index e55475dd1..d2e41fb53 100644 --- a/net/adblock-fast/files/etc/config/adblock-fast +++ b/net/adblock-fast/files/etc/config/adblock-fast @@ -31,6 +31,7 @@ config adblock-fast 'config' option parallel_downloads '1' option pause_timeout '20' option procd_trigger_wan6 '0' + option procd_boot_delay '0' option procd_boot_wan_timeout '60' option verbosity '2' diff --git a/net/adblock-fast/files/etc/init.d/adblock-fast b/net/adblock-fast/files/etc/init.d/adblock-fast index cb16cf5bb..ea7b3416c 100755 --- a/net/adblock-fast/files/etc/init.d/adblock-fast +++ b/net/adblock-fast/files/etc/init.d/adblock-fast @@ -103,6 +103,13 @@ dnsmasq_hup() { killall -q -s HUP dnsmasq; } dnsmasq_kill() { killall -q -s KILL dnsmasq; } dnsmasq_restart() { /etc/init.d/dnsmasq restart >/dev/null 2>&1; } is_enabled() { uci -q get "${1}.config.enabled"; } +is_integer() { + case "$1" in + (*[!0123456789]*) return 1;; + ('') return 1;; + (*) return 0;; + esac +} is_greater() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } is_greater_or_equal() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$2"; } # shellcheck disable=SC3057 @@ -307,6 +314,7 @@ uci_changes() { if type extra_command 1>/dev/null 2>&1; then extra_command 'allow' 'Allows domain in current block-list and config' extra_command 'check' 'Checks if specified domain is found in current block-list' + extra_command 'check_lists' 'Checks if specified domain is found in enabled block-lists' extra_command 'dl' 'Force-downloads all enabled block-list' extra_command 'killcache' 'Delete all cached files' extra_command 'pause' 'Pauses AdBlocking for specified number of seconds (default: 60)' @@ -428,7 +436,7 @@ load_network() { append_url() { local cfg="$1" var="$2" local en action url - config_get en "$cfg" enabled '1' + config_get_bool en "$cfg" enabled '1' config_get action "$cfg" action 'block' config_get url "$cfg" url if [ "$en" = '1' ]; then @@ -1005,7 +1013,7 @@ download_lists() { _config_calculate_sizes() { local cfg="$1" local en size url - config_get en "$cfg" enabled '1' + config_get_bool en "$cfg" enabled '1' config_get size "$cfg" size config_get url "$cfg" url [ "$en" = '0' ] && return 0 @@ -1368,6 +1376,54 @@ adb_check() { done } +adb_check_lists() { + _check_list() { + local cfg="$1" + local en size url R_TMP string c + config_get_bool en "$cfg" enabled '1' + config_get action "$cfg" action 'block' + config_get url "$cfg" url + [ "$en" = '0' ] && return 0 + [ "$action" != 'block' ] && return 0 + if is_https_url "$url" && [ -z "$isSSLSupported" ]; then + output "[DL] $url $__FAIL__\\n" + fi + while [ -z "$R_TMP" ] || [ -e "$R_TMP" ]; do + R_TMP="$(mktemp -u -q -t ${packageName}_tmp.XXXXXXXX)" + done + if [ -z "$url" ] || ! $dl_command "$url" "$dl_flag" "$R_TMP" 2>/dev/null || \ + [ ! -s "$R_TMP" ]; then + output "[DL] $url $__FAIL__\\n" + else + append_newline "$R_TMP" + for string in ${param}; do + c="$(grep -c "$string" "$R_TMP")" + if [ "$c" -gt 0 ]; then + if [ "$c" -eq 1 ]; then + output "Found 1 match for '$string' in '$url'.\\n" + else + output "Found $c matches for '$string' in '$url'.\\n" + fi + grep "$string" "$R_TMP" + else + output "The '$string' is not found in '$url'.\\n" + fi + done + rm -f "$R_TMP" + fi + } + local param="$1" + local validation_result="$3" + load_environment "$validation_result" 'quiet' || return 1 + if [ -z "$param" ]; then + output "Usage: /etc/init.d/${packageName} check_lists 'domain' ...\\n" + return 0 + fi + config_load "$packageName" + config_foreach _check_list 'file_url' + return 0 +} + adb_config_update() { local R_TMP label local param validation_result="$3" @@ -1708,7 +1764,7 @@ adb_pause() { local validation_result="$3" adb_stop 'on_pause' '' "$validation_result" output "Sleeping for $timeout seconds... " - if sleep "$timeout"; then + if is_number "$timeout" && sleep "$timeout"; then output_okn else output_failn @@ -1718,10 +1774,16 @@ adb_pause() { allow() { load_validate_config 'config' adb_allow "'$*'"; } boot() { + local procd_boot_delay ubus -t 30 wait_for network.interface 2>/dev/null - rc_procd start_service 'on_boot' + config_load "$packageName" + config_get procd_boot_delay 'config' 'procd_boot_delay' '0' +# shellcheck disable=SC2154 + { is_integer "$procd_boot_delay" && sleep "$procd_boot_delay" || true; } && \ + rc_procd start_service 'on_boot' && service_started 'on_boot' & } check() { load_validate_config 'config' adb_check "'$*'"; } +check_lists() { load_validate_config 'config' adb_check_lists "'$*'"; } dl() { rc_procd start_service 'download'; } killcache() { local compressed_cache_dir diff --git a/net/banip/Makefile b/net/banip/Makefile index 7c559458f..28b76bc86 100644 --- a/net/banip/Makefile +++ b/net/banip/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=banip PKG_VERSION:=0.9.2 -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Dirk Brenken diff --git a/net/banip/files/banip-functions.sh b/net/banip/files/banip-functions.sh index db2c15f6b..1a1266d03 100644 --- a/net/banip/files/banip-functions.sh +++ b/net/banip/files/banip-functions.sh @@ -194,10 +194,10 @@ f_rmpid() { for pid in ${pids}; do pids="${pids} $(pgrep -P "${pid}" 2>/dev/null)" done + for pid in ${pids}; do + kill -INT "${pid}" >/dev/null 2>&1 + done fi - for pid in ${pids}; do - kill -INT "${pid}" >/dev/null 2>&1 - done : >"${ban_rdapfile}" : >"${ban_pidfile}" } diff --git a/net/banip/files/banip.feeds b/net/banip/files/banip.feeds index cfe1a70cc..1adb11eb5 100644 --- a/net/banip/files/banip.feeds +++ b/net/banip/files/banip.feeds @@ -256,7 +256,7 @@ }, "urlhaus":{ "url_4": "https://urlhaus.abuse.ch/downloads/ids/", - "rule_4": "match($0,/(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5]))/){printf \"%s,\\n\",substr($0,RSTART,RLENGTH)}", + "rule_4": "match($0,/(content:\"([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5]))/){printf \"%s,\\n\",substr($0,RSTART+9,RLENGTH-9)}", "descr": "urlhaus IDS IPs" }, "urlvir":{ diff --git a/net/banip/files/banip.init b/net/banip/files/banip.init index a934b4a91..4ef70e3d0 100755 --- a/net/banip/files/banip.init +++ b/net/banip/files/banip.init @@ -22,6 +22,7 @@ ban_lock="/var/run/banip.lock" [ "${action}" = "boot" ] && "${ban_init}" running && exit 0 { [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ]; } && ! "${ban_init}" running && exit 0 +[ ! -r "${ban_funlib}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "lookup" ] || [ "${action}" = "status" ]; } && exit 1 [ -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ]; } && exit 1 [ ! -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ]; } && mkdir -p "${ban_lock}" @@ -31,8 +32,8 @@ boot() { } start_service() { + [ -z "$(command -v "f_system")" ] && . "${ban_funlib}" if "${ban_init}" enabled; then - [ -z "$(command -v "f_system")" ] && . "${ban_funlib}" f_rmpid procd_open_instance "banip-service" procd_set_param command "${ban_service}" "${@:-"${action}"}" @@ -43,7 +44,6 @@ start_service() { procd_set_param stderr 1 procd_close_instance else - [ -z "$(command -v "f_system")" ] && . "${ban_funlib}" f_log "err" "banIP service autostart is disabled" rm -rf "${ban_lock}" fi diff --git a/net/dhtd/Makefile b/net/dhtd/Makefile index bb09f8b4a..8cc8b22d5 100644 --- a/net/dhtd/Makefile +++ b/net/dhtd/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dhtd -PKG_VERSION:=0.2.1 +PKG_VERSION:=0.2.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/mwarning/dhtd/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=65d2e0d6a3648fe3619d9fa4bef34a76c22577b7fe3fe460f96ac10510c3f06a +PKG_HASH:=0f35cd0016689682b277f9769ec1e95c3c1321479cedc9727abc0bc91a0427d5 PKG_MAINTAINER:=Moritz Warning PKG_LICENSE:=MIT diff --git a/net/dhtd/files/dhtd.config b/net/dhtd/files/dhtd.config index 60b15b8a6..e933e65b5 100644 --- a/net/dhtd/files/dhtd.config +++ b/net/dhtd/files/dhtd.config @@ -15,6 +15,9 @@ config dhtd list peer 'bttracker.debian.org:6881' list peer 'router.bittorrent.com:6881' +## Execute a script for each result +# option execute '/root/on_result.sh' + ## Bind the DHT to this port. # option port '6881' diff --git a/net/dhtd/files/dhtd.init b/net/dhtd/files/dhtd.init index 3cd797057..a3b155298 100755 --- a/net/dhtd/files/dhtd.init +++ b/net/dhtd/files/dhtd.init @@ -54,7 +54,7 @@ start_instance() { OPTS="" - append_opts "$cfg" verbosity peerfile port + append_opts "$cfg" verbosity peerfile port execute config_get ifname "$cfg" "ifname" if network_get_device IFNAME "$ifname";then diff --git a/net/gensio/Makefile b/net/gensio/Makefile index b53d6821d..98b429d0d 100644 --- a/net/gensio/Makefile +++ b/net/gensio/Makefile @@ -77,6 +77,9 @@ CONFIGURE_VARS += \ PYTHON_LIBS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --ldflags) -l${PYTHON3}" \ PYTHON_CPPFLAGS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --includes)" \ PYTHON="$(STAGING_DIR_HOSTPKG)/bin/$(PYTHON3)" + +MAKE_VARS += \ + PYTHON_LIBS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --ldflags) -l${PYTHON3}" else CONFIGURE_ARGS += \ --without-python \ diff --git a/net/gensio/patches/0001-Ensure-that-ax_python_devel_found-is-defined.patch b/net/gensio/patches/0001-Ensure-that-ax_python_devel_found-is-defined.patch index b3654ce02..a21d5164c 100644 --- a/net/gensio/patches/0001-Ensure-that-ax_python_devel_found-is-defined.patch +++ b/net/gensio/patches/0001-Ensure-that-ax_python_devel_found-is-defined.patch @@ -13,15 +13,16 @@ checking consistency of all components of python development environment... yes Signed-off-by: Michael Heimpold --- - configure.ac | 2 ++ - 1 file changed, 2 insertions(+) + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) --- a/configure.ac +++ b/configure.ac -@@ -1997,6 +1997,8 @@ if test "x$trypython" = "xyes"; then +@@ -1997,6 +1997,9 @@ if test "x$trypython" = "xyes"; then PYTHON_CPPFLAGS="$pythoncflags" fi AX_PYTHON_DEVEL([], [true]) ++ ax_python_devel_found=yes +else + ax_python_devel_found=no fi diff --git a/net/gensio/patches/0002_ax_python_devel-fix-serial.patch b/net/gensio/patches/0002_ax_python_devel-fix-serial.patch new file mode 100644 index 000000000..211f692a5 --- /dev/null +++ b/net/gensio/patches/0002_ax_python_devel-fix-serial.patch @@ -0,0 +1,11 @@ +--- a/m4/ax_python_devel.m4 ++++ b/m4/ax_python_devel.m4 +@@ -72,7 +72,7 @@ + # modified version of the Autoconf Macro, you may extend this special + # exception to the GPL to apply to your modified version as well. + +-#serial 34 ++#serial 35 + + AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) + AC_DEFUN([AX_PYTHON_DEVEL],[ diff --git a/net/gensio/patches/0003-Revert-ax_pkg_swig.m4-to-latest-vanilla-version.patch b/net/gensio/patches/0003-Revert-ax_pkg_swig.m4-to-latest-vanilla-version.patch new file mode 100644 index 000000000..fb13df9c8 --- /dev/null +++ b/net/gensio/patches/0003-Revert-ax_pkg_swig.m4-to-latest-vanilla-version.patch @@ -0,0 +1,144 @@ +From f53fc85ee9734dd21447ea3438b7ba1edcd1bcf8 Mon Sep 17 00:00:00 2001 +From: Michael Heimpold +Date: Tue, 21 Nov 2023 23:27:45 +0100 +Subject: [PATCH] Revert ax_pkg_swig.m4 to latest vanilla version + +And instead of extending the macro, we can use the already +create variable 'available_swig_vernum' to compare the +required version number. + +Signed-off-by: Michael Heimpold +--- + configure.ac | 26 ++++++++++++-------------- + m4/ax_pkg_swig.m4 | 20 +++++++++----------- + 2 files changed, 21 insertions(+), 25 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -1956,21 +1956,19 @@ AC_CHECK_LIB(nsl, main, [HAVE_LIBNSL=1; + SWIG_DIR= + SWIG_CPP_DIR= + SWIG= +-SWIG_NUMVERSION=0 ++available_swig_vernum=0 + if test "x$tryswig" = "xyes"; then + if test "x$swigprog" != "x"; then + SWIG="$swigprog" + fi +- AX_PKG_SWIG([1.3.21]) +- if test "x$SWIG" != "x"; then +- AC_DEFINE([HAVE_SWIG], [], [Have swig installed]) +- SWIG_DIR=swig +- if test $SWIG_NUMVERSION -ge 40100; then +- SWIG_CPP_DIR=swig +- else +- AC_MSG_WARN([SWIG version >= 4.1.0 is required for C++ swig.]) +- fi +- fi ++ AX_PKG_SWIG(4.1.0, ++ [ ++ AC_DEFINE([HAVE_SWIG], [], [Have swig installed]) ++ SWIG_DIR=swig ++ SWIG_CPP_DIR=swig ++ ], [ ++ AC_MSG_WARN([SWIG version >= 4.1.0 is required for C++ swig.]) ++ ]) + fi + AC_SUBST(SWIG_DIR) + AC_SUBST(SWIG_CPP_DIR) +@@ -2055,7 +2053,7 @@ AC_SUBST(PYTHON_UNDEF_LIBS) + PYTHON_EXECUTABLE="${PYTHON}" + AC_SUBST(PYTHON_EXECUTABLE) + +-if test $SWIG_NUMVERSION -ge 40100 -a "${enable_shared}" = yes; then ++if test $available_swig_vernum -ge 40100 -a "${enable_shared}" = yes; then + trygo=yes + else + trygo=no +@@ -2076,7 +2074,7 @@ AC_ARG_WITH(go, + fi, + ) + +-if test $trygo = yes -a $SWIG_NUMVERSION -lt 40100; then ++if test $trygo = yes -a $available_swig_vernum -lt 40100; then + AC_MSG_ERROR([Go enabled, but swig version must be >= 4.1.0 for that]) + fi + GODIR= +@@ -2363,7 +2361,7 @@ pr_op " shared libraries: " $enable_sh + pr_op " sctp sendv: " $ac_cv_lib_sctp_sctp_sendv + pr_vop " python: " "$ax_python_version" + if test "$SWIG_CPP_DIR" = "swig"; then +- prrw " swig: " "$SWIG_NUMVERSION" ++ prrw " swig: " "$available_swig_vernum" + else + prrw " swig: " "no" + fi +--- a/m4/ax_pkg_swig.m4 ++++ b/m4/ax_pkg_swig.m4 +@@ -19,11 +19,6 @@ + # 1.3.17), AX_PKG_SWIG checks that the swig package is this version number + # or higher. + # +-# If successful, SWIG_NUMVERSION is set to a numeric value for the +-# version found in the format NNnnpp where NN is the major version, +-# nn is the minor version, and pp is the patch version. This is +-# easy to directly compare with a number. +-# + # As usual, action-if-found is executed if SWIG is found, otherwise + # action-if-not-found is executed. + # +@@ -41,6 +36,8 @@ + # Copyright (c) 2008 Rafael Laboissiere + # Copyright (c) 2008 Andrew Collier + # Copyright (c) 2011 Murray Cumming ++# Copyright (c) 2018 Reini Urban ++# Copyright (c) 2021 Vincent Danjean + # + # This program is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by the +@@ -68,14 +65,16 @@ + # modified version of the Autoconf Macro, you may extend this special + # exception to the GPL to apply to your modified version as well. + +-#serial 13 ++#serial 15 + + AC_DEFUN([AX_PKG_SWIG],[ + # Find path to the "swig" executable. + AC_PATH_PROGS([SWIG],[swig swig3.0 swig2.0]) + if test -z "$SWIG" ; then + m4_ifval([$3],[$3],[:]) +- elif test -n "$1" ; then ++ elif test -z "$1" ; then ++ m4_ifval([$2],[$2],[:]) ++ else + AC_MSG_CHECKING([SWIG version]) + [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] + AC_MSG_RESULT([$swig_version]) +@@ -86,12 +85,12 @@ AC_DEFUN([AX_PKG_SWIG],[ + if test -z "$required_major" ; then + [required_major=0] + fi +- [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] ++ [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`] + [required_minor=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_minor" ; then + [required_minor=0] + fi +- [required=`echo $required | sed 's/[0-9]*[^0-9]//'`] ++ [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`] + [required_patch=`echo $required | sed 's/[^0-9].*//'`] + if test -z "$required_patch" ; then + [required_patch=0] +@@ -126,10 +125,9 @@ AC_DEFUN([AX_PKG_SWIG],[ + m4_ifval([$3],[$3],[]) + else + AC_MSG_CHECKING([for SWIG library]) +- SWIG_LIB=`$SWIG -swiglib | tail -1` ++ SWIG_LIB=`$SWIG -swiglib | tr '\r\n' ' '` + AC_MSG_RESULT([$SWIG_LIB]) + m4_ifval([$2],[$2],[]) +- SWIG_NUMVERSION=$available_swig_vernum + fi + else + AC_MSG_WARN([cannot determine SWIG version]) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 182f51718..4cc22bd92 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -10,12 +10,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=haproxy -PKG_VERSION:=2.8.3 -PKG_RELEASE:=2 +PKG_VERSION:=2.8.4 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.haproxy.org/download/2.8/src -PKG_HASH:=9ecc6ffe67a977d1ed279107bbdab790d73ae2a626bc38eee23fa1f6786a759e +PKG_HASH:=81bacbf50ec6d0f7ecaaad7c03e59978b00322fbdad6ed4a989dd31754b6f25d PKG_MAINTAINER:=Thomas Heil , \ Christian Lachner diff --git a/net/haproxy/get-latest-patches.sh b/net/haproxy/get-latest-patches.sh index 8f4d9e0af..97665fc03 100755 --- a/net/haproxy/get-latest-patches.sh +++ b/net/haproxy/get-latest-patches.sh @@ -1,7 +1,7 @@ #!/bin/sh CLONEURL=https://git.haproxy.org/git/haproxy-2.8.git -BASE_TAG=v2.8.3 +BASE_TAG=v2.8.4 TMP_REPODIR=tmprepo PATCHESDIR=patches diff --git a/net/https-dns-proxy/Makefile b/net/https-dns-proxy/Makefile index e66f8e5bd..3037bd5a2 100644 --- a/net/https-dns-proxy/Makefile +++ b/net/https-dns-proxy/Makefile @@ -2,13 +2,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=https-dns-proxy PKG_VERSION:=2023-10-25 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/ PKG_SOURCE_DATE:=$(PKG_VERSION) PKG_SOURCE_VERSION:=977341a4e35a37ee454e97e82caf4276b1b4961a PKG_MIRROR_HASH:=8622846f1038ac05436a48d9b36a07c516cbb6504ce68e7ee8c5529788fac39b + PKG_MAINTAINER:=Stan Grishin PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/net/https-dns-proxy/files/etc/init.d/https-dns-proxy b/net/https-dns-proxy/files/etc/init.d/https-dns-proxy index 5679f6349..672e837c7 100755 --- a/net/https-dns-proxy/files/etc/init.d/https-dns-proxy +++ b/net/https-dns-proxy/files/etc/init.d/https-dns-proxy @@ -30,10 +30,11 @@ readonly canaryDomainsiCloud='mask.icloud.com mask-h2.icloud.com' on_boot_trigger= -str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; } +dnsmasq_restart() { [ -x /etc/init.d/dnsmasq ] || return 1; /etc/init.d/dnsmasq restart >/dev/null 2>&1; } is_mac_address() { expr "$1" : '[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]$' >/dev/null; } is_ipv4() { expr "$1" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; } is_ipv6() { ! is_mac_address "$1" && str_contains "$1" ":"; } +is_resolver_working() { resolveip -t 3 one.one.one.one >/dev/null 2>&1; } output() { local msg memmsg logmsg local sharedMemoryOutput="/dev/shm/$packageName-output" @@ -52,6 +53,7 @@ output_ok() { output "$_OK_"; } output_okn() { output "${_OK_}\\n"; } output_fail() { output "$_FAIL_"; } output_failn() { output "${_FAIL_}\\n"; } +str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; } uci_add_list_if_new() { local PACKAGE="$1" local CONFIG="$2" @@ -70,9 +72,6 @@ uci_changes() { local OPTION="$3" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} changes "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}" } - -dnsmasq_restart() { [ -x /etc/init.d/dnsmasq ] || return 1; /etc/init.d/dnsmasq restart >/dev/null 2>&1; } - version() { echo "$PKG_VERSION"; } xappend() { PROG_param="$PROG_param $1"; } @@ -131,13 +130,11 @@ append_bootstrap() { [ "$ipv6_resolvers_only" -eq 0 ] && xappend '-4' } -resolver_health_check() { resolveip -t 3 one.one.one.one >/dev/null 2>&1; } - boot() { ubus -t 30 wait_for network.interface 2>/dev/null on_boot_trigger=1 - rc_procd start_service 'on_boot' && rc_procd service_started 'on_boot' - resolver_health_check || rc_procd stop_service 'on_boot' + rc_procd start_service 'on_boot' && service_started 'on_boot' + is_resolver_working || rc_procd stop_service 'on_boot' && service_stopped 'on_boot' } start_instance() { @@ -203,7 +200,8 @@ start_instance() { procd_close_data procd_close_instance - if [ "$?" ]; then +# shellcheck disable=SC2181 + if [ "$?" -eq 0 ]; then config_get listen_addr "$cfg" 'listen_addr' '127.0.0.1' config_get listen_port "$cfg" 'listen_port' "$port" if [ "$dnsmasq_config_update" = '*' ]; then diff --git a/net/https-dns-proxy/patches/020-src-options.c-add-version.patch b/net/https-dns-proxy/patches/020-src-options.c-add-version.patch index d34621793..72d3dc5df 100644 --- a/net/https-dns-proxy/patches/020-src-options.c-add-version.patch +++ b/net/https-dns-proxy/patches/020-src-options.c-add-version.patch @@ -5,7 +5,7 @@ return SW_VERSION; #else - return "2023.10.10-atLeast"; // update date sometimes, like 1-2 times a year -+ return "2023-10-25-1"; // update date sometimes, like 1-2 times a year ++ return "2023-10-25-3"; // update date sometimes, like 1-2 times a year #endif } diff --git a/net/openvpn/Makefile b/net/openvpn/Makefile index 8f79f2b10..903af60d2 100644 --- a/net/openvpn/Makefile +++ b/net/openvpn/Makefile @@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn -PKG_VERSION:=2.6.6 +PKG_VERSION:=2.6.8 PKG_RELEASE:=1 PKG_SOURCE_URL:=\ https://build.openvpn.net/downloads/releases/ \ https://swupdate.openvpn.net/community/releases/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=3b074f392818b31aa529b84f76e8b5e4ad03fca764924f46d906bceaaf421034 +PKG_HASH:=5ede1565c8a6d880100f7f235317a7ee9eea83d5052db5547f13a9e76af7805d PKG_MAINTAINER:=Magnus Kroken diff --git a/net/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch b/net/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch index c54277006..6ac30df59 100644 --- a/net/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch +++ b/net/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch @@ -1,6 +1,6 @@ --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c -@@ -1535,7 +1535,7 @@ const char * +@@ -1533,7 +1533,7 @@ const char * get_ssl_library_version(void) { static char mbedtls_version[30]; diff --git a/net/openvpn/patches/101-Fix-EVP_PKEY_CTX_-compilation-with-wolfSSL.patch b/net/openvpn/patches/101-Fix-EVP_PKEY_CTX_-compilation-with-wolfSSL.patch index 0a45ea49e..e5b103bc5 100644 --- a/net/openvpn/patches/101-Fix-EVP_PKEY_CTX_-compilation-with-wolfSSL.patch +++ b/net/openvpn/patches/101-Fix-EVP_PKEY_CTX_-compilation-with-wolfSSL.patch @@ -1,6 +1,6 @@ --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c -@@ -51,7 +51,7 @@ +@@ -49,7 +49,7 @@ #include #include @@ -9,8 +9,8 @@ #include #endif #if OPENSSL_VERSION_NUMBER >= 0x30000000L -@@ -1436,7 +1436,7 @@ engine_load_key(const char *file, SSL_CT - #endif /* if HAVE_OPENSSL_ENGINE */ +@@ -1374,7 +1374,7 @@ memcmp_constant_time(const void *a, cons + return CRYPTO_memcmp(a, b, size); } -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) diff --git a/net/openvpn/patches/102-Disable-external-ec-key-support-when-building-with-wolfSSL.patch b/net/openvpn/patches/102-Disable-external-ec-key-support-when-building-with-wolfSSL.patch index f0e7361f2..50834b3bb 100644 --- a/net/openvpn/patches/102-Disable-external-ec-key-support-when-building-with-wolfSSL.patch +++ b/net/openvpn/patches/102-Disable-external-ec-key-support-when-building-with-wolfSSL.patch @@ -1,6 +1,6 @@ --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c -@@ -1351,7 +1351,7 @@ err: +@@ -1347,7 +1347,7 @@ err: return 0; } @@ -9,7 +9,7 @@ /* called when EC_KEY is destroyed */ static void -@@ -1512,7 +1512,7 @@ tls_ctx_use_management_external_key(stru +@@ -1508,7 +1508,7 @@ tls_ctx_use_management_external_key(stru goto cleanup; } } diff --git a/net/openvpn/patches/103-define-LN_serialNumber-for-wolfSSL.patch b/net/openvpn/patches/103-define-LN_serialNumber-for-wolfSSL.patch index 30e1822a1..690521ee6 100644 --- a/net/openvpn/patches/103-define-LN_serialNumber-for-wolfSSL.patch +++ b/net/openvpn/patches/103-define-LN_serialNumber-for-wolfSSL.patch @@ -1,6 +1,6 @@ --- a/src/openvpn/ssl_verify_openssl.c +++ b/src/openvpn/ssl_verify_openssl.c -@@ -269,6 +269,9 @@ backend_x509_get_username(char *common_n +@@ -267,6 +267,9 @@ backend_x509_get_username(char *common_n return FAILURE; } } diff --git a/net/quassel-irssi/Makefile b/net/quassel-irssi/Makefile deleted file mode 100644 index 7374f6910..000000000 --- a/net/quassel-irssi/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (C) 2016 Ben Rosser -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=quassel-irssi -PKG_SOURCE_DATE:=2017-11-30 -PKG_SOURCE_VERSION:=079be662dde374a383646256108a4974c2bc7796 -PKG_RELEASE:=4 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/phhusson/quassel-irssi/tar.gz/$(PKG_SOURCE_VERSION)? -PKG_HASH:=c276a92a47f8edf5ae1d9db0e72a69d078f2f3f80e055853fc6d06099d898966 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION) - -PKG_MAINTAINER:=Ben Rosser -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=core/COPYING - -PKG_BUILD_PARALLEL:=1 -PKG_INSTALL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk - -MAKE_PATH := core -MAKE_VARS += SYSTEM_QUASSELC=1 IRSSI_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" IRSSI_INCLUDE=$(STAGING_DIR)/usr/include/irssi - -define Package/quassel-irssi - SECTION:=net - CATEGORY:=Network - DEPENDS:=+irssi +quasselc - SUBMENU:=Instant Messaging - URL:=https://github.com/phhusson/quassel-irssi - TITLE:=An irssi plugin to connect to quassel core -endef - -define Package/quassel-irssi/description - An irssi plugin that supports connecting to a quassel core. -endef - -define Package/quassel-irssi/install - $(INSTALL_DIR) $(1)/usr/lib/irssi/modules/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/irssi/modules/libquassel_core.so* $(1)/usr/lib/irssi/modules/ -endef - -$(eval $(call BuildPackage,quassel-irssi)) diff --git a/net/quassel-irssi/patches/001-respect-cflags.patch b/net/quassel-irssi/patches/001-respect-cflags.patch deleted file mode 100644 index 291bed499..000000000 --- a/net/quassel-irssi/patches/001-respect-cflags.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/core/Makefile -+++ b/core/Makefile -@@ -3,7 +3,7 @@ DESTDIR ?= - LIBDIR ?= /usr/lib - - #IRSSI_INCLUDE:=/home/phh/irssi-0.8.16-rc1.phh/ --IRSSI_INCLUDE:=/usr/include/irssi/ -+IRSSI_INCLUDE?=/usr/include/irssi/ - IRSSI_LIB?=$(DESTDIR)/$(LIBDIR)/irssi - IRSSI_CFLAGS+=-I$(IRSSI_INCLUDE)/src/ - IRSSI_CFLAGS+=-I$(IRSSI_INCLUDE)/src/core/ -@@ -28,7 +28,7 @@ else - LDFLAGS += -lquasselc - endif - --CFLAGS=-std=gnu11 -Wall -Wextra -Werror -g -O2 $(IRSSI_CFLAGS) $(QUASSELC_FLAGS) -Wmissing-prototypes -Wmissing-declarations -+CFLAGS+=-std=gnu11 -Wall -Wextra -g $(IRSSI_CFLAGS) $(QUASSELC_FLAGS) -Wmissing-prototypes -Wmissing-declarations - - CFLAGS += $(SSL_CFLAGS) - LDFLAGS+= $(SSL_LDLAGS) diff --git a/net/quassel-irssi/patches/002-use-cc-var.patch b/net/quassel-irssi/patches/002-use-cc-var.patch deleted file mode 100644 index aa7385081..000000000 --- a/net/quassel-irssi/patches/002-use-cc-var.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/core/Makefile -+++ b/core/Makefile -@@ -49,7 +49,7 @@ irssi/network-openssl.o: CFLAGS:=$(IRSSI - quasselc-connector.o: CFLAGS:=$(CFLAGS) - - $(TARGET): $(OBJECTS) -- gcc -shared $^ -o $@ -lz $(LDFLAGS) -+ $(CC) -shared $^ -o $@ -lz $(LDFLAGS) - - install: $(TARGET) - $(INSTALL) -d $(IRSSI_LIB)/modules diff --git a/net/quassel-irssi/patches/003-use-pkgconfig-ldflags-quasselc.patch b/net/quassel-irssi/patches/003-use-pkgconfig-ldflags-quasselc.patch deleted file mode 100644 index ddf313a9f..000000000 --- a/net/quassel-irssi/patches/003-use-pkgconfig-ldflags-quasselc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/core/Makefile -+++ b/core/Makefile -@@ -25,7 +25,7 @@ ifndef SYSTEM_QUASSELC - QUASSELC_FLAGS:=-Ilib - else - QUASSELC_FLAGS:=$(shell pkg-config --cflags quasselc) -- LDFLAGS += -lquasselc -+ LDFLAGS += $(shell pkg-config --libs quasselc) - endif - - CFLAGS+=-std=gnu11 -Wall -Wextra -g $(IRSSI_CFLAGS) $(QUASSELC_FLAGS) -Wmissing-prototypes -Wmissing-declarations diff --git a/net/quassel-irssi/patches/010-Get-compatible-with-potential-irssi-abi-8-and-drop-p.patch b/net/quassel-irssi/patches/010-Get-compatible-with-potential-irssi-abi-8-and-drop-p.patch deleted file mode 100644 index 5c84128b5..000000000 --- a/net/quassel-irssi/patches/010-Get-compatible-with-potential-irssi-abi-8-and-drop-p.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 19e810405789a35b92026b56ea49d01a3f544b07 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Tue, 17 Jan 2017 23:09:24 +0100 -Subject: [PATCH] Get compatible with potential irssi abi 8, and drop polling - ---- - core/Makefile | 1 - - core/quassel-net.c | 64 ++++++++++++++++++++++++++++++++++++++-------- - 2 files changed, 53 insertions(+), 10 deletions(-) - ---- a/core/Makefile -+++ b/core/Makefile -@@ -16,7 +16,6 @@ SSL_CFLAGS=$(shell pkg-config --cflags o - SSL_LDLAGS=$(shell pkg-config --libs openssl) - OBJECTS:=quasselc-connector.o quassel-core.o - OBJECTS+=quassel-net.o quassel-msgs.o quassel-cmds.o --OBJECTS+=irssi/network-openssl.o - OBJECTS+=quassel-fe-window.o quassel-fe-level.o quassel-cfg.o - - LDFLAGS ?= ---- a/core/quassel-net.c -+++ b/core/quassel-net.c -@@ -132,10 +132,10 @@ static SERVER_REC* quassel_server_init_c - ret->got = 0; - server_connect_ref(SERVER_CONNECT(conn)); - -- if(conn->use_ssl) { -+ if(conn->use_tls) { - ret->ssl = 1; - } -- ret->connrec->use_ssl = 0; -+ ret->connrec->use_tls = 0; - - ret->channels_join = quassel_irssi_channels_join; - ret->send_message = quassel_irssi_send_message; -@@ -161,12 +161,59 @@ void quassel_net_init(CHAT_PROTOCOL_REC* - signal_add_first("server connected", (SIGNAL_FUNC) sig_connected); - } - --GIOChannel *irssi_ssl_get_iochannel(GIOChannel *handle, int port, SERVER_REC *server); -+static void quassel_net_final_setup(SERVER_REC* server, GIOChannel *handle) { -+ quassel_login(handle, server->connrec->nick, server->connrec->password); -+ server->handle->handle = handle; -+ -+ server->readtag = -+ g_input_add(handle, -+ G_INPUT_READ, -+ (GInputFunction) quassel_parse_incoming, server); -+} -+ -+static void quassel_net_ssl_callback(SERVER_REC *server, GIOChannel *handle) { -+ int error; -+ -+ g_return_if_fail(IS_SERVER(server)); -+ -+ error = irssi_ssl_handshake(handle); -+ if (error == -1) { -+ server->connection_lost = TRUE; -+ server_connect_failed(server, NULL); -+ return; -+ } -+ if (error & 1) { -+ if (server->connect_tag != -1) -+ g_source_remove(server->connect_tag); -+ server->connect_tag = g_input_add(handle, error == 1 ? G_INPUT_READ : G_INPUT_WRITE, -+ (GInputFunction) -+ quassel_net_ssl_callback, -+ server); -+ return; -+ } -+ -+ if (server->connect_tag != -1) { -+ g_source_remove(server->connect_tag); -+ server->connect_tag = -1; -+ } -+ -+ quassel_net_final_setup(server, handle); -+} -+ - void quassel_irssi_init_ack(void *arg) { - Quassel_SERVER_REC *server = (Quassel_SERVER_REC*)arg; -- if(!server->ssl) -- goto login; -- GIOChannel* ssl_handle = irssi_ssl_get_iochannel(server->handle->handle, 1337, SERVER(server)); -+ GIOChannel* ssl_handle = net_start_ssl((SERVER_REC*)server); -+ -+ if(server->readtag != -1) { -+ g_source_remove(server->readtag); -+ server->readtag = -1; -+ } -+ -+ if(!server->ssl) { -+ quassel_net_final_setup((SERVER_REC*)server, server->handle->handle); -+ return; -+ } -+ - int error; - //That's polling, and that's really bad... - while( (error=irssi_ssl_handshake(ssl_handle)) & 1) { -@@ -175,10 +222,7 @@ void quassel_irssi_init_ack(void *arg) { - return; - } - } -- server->handle->handle = ssl_handle; -- --login: -- quassel_login(server->handle->handle, server->connrec->nick, server->connrec->password); -+ quassel_net_ssl_callback((SERVER_REC*)server, ssl_handle); - } - - void quassel_irssi_init_nack(void *arg) { diff --git a/net/quassel-irssi/patches/100-Fix-compilation-error-with-new-version-of-irssi.patch b/net/quassel-irssi/patches/100-Fix-compilation-error-with-new-version-of-irssi.patch deleted file mode 100644 index bd1216292..000000000 --- a/net/quassel-irssi/patches/100-Fix-compilation-error-with-new-version-of-irssi.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 61aaa345d3924905aa26023b351fb9502a74de63 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Sun, 5 Nov 2023 20:50:31 +0100 -Subject: [PATCH 2/2] Fix compilation error with new version of irssi - -Fix compilation error with new version of irssi that changed some -functions names. - -Caused by https://github.com/irssi/irssi/pull/1246 - -Signed-off-by: Christian Marangi ---- - core/quassel-net.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/core/quassel-net.c -+++ b/core/quassel-net.c -@@ -105,8 +105,8 @@ static void sig_connected(Quassel_SERVER - } - - r->readtag = -- g_input_add(net_sendbuffer_handle(r->handle), -- G_INPUT_READ, -+ i_input_add(net_sendbuffer_handle(r->handle), -+ I_INPUT_READ, - (GInputFunction) quassel_parse_incoming, r); - - quassel_init_packet(net_sendbuffer_handle(r->handle), r->ssl); -@@ -166,8 +166,8 @@ static void quassel_net_final_setup(SERV - server->handle->handle = handle; - - server->readtag = -- g_input_add(handle, -- G_INPUT_READ, -+ i_input_add(handle, -+ I_INPUT_READ, - (GInputFunction) quassel_parse_incoming, server); - } - -@@ -185,7 +185,7 @@ static void quassel_net_ssl_callback(SER - if (error & 1) { - if (server->connect_tag != -1) - g_source_remove(server->connect_tag); -- server->connect_tag = g_input_add(handle, error == 1 ? G_INPUT_READ : G_INPUT_WRITE, -+ server->connect_tag = i_input_add(handle, error == 1 ? I_INPUT_READ : I_INPUT_WRITE, - (GInputFunction) - quassel_net_ssl_callback, - server); diff --git a/net/sing-box/Makefile b/net/sing-box/Makefile index 7f4b9ac4e..5d491c322 100644 --- a/net/sing-box/Makefile +++ b/net/sing-box/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sing-box -PKG_VERSION:=1.6.4 +PKG_VERSION:=1.6.6 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=3b1008d8a4d0cb0c41841531b1845b9b859a5d8f73af2c9a137fec4c7ad1f18f +PKG_HASH:=88c8825f6e8af2e46a16e8a85ceb5e1c7c0795b59cad93c8327288ec7b8249e0 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE diff --git a/net/unbound/Makefile b/net/unbound/Makefile index a2bf99535..3a7a27cbf 100644 --- a/net/unbound/Makefile +++ b/net/unbound/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=unbound PKG_VERSION:=1.19.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound diff --git a/net/unbound/files/dnsmasq.sh b/net/unbound/files/dnsmasq.sh index b507535f3..28f3c86dc 100644 --- a/net/unbound/files/dnsmasq.sh +++ b/net/unbound/files/dnsmasq.sh @@ -107,7 +107,7 @@ create_host_record_from_host() { local dns ip name # basefiles dhcp "host" clause which means host A and PTR records - config_get dns "$cfg" dns + config_get dns "$cfg" dns 0 config_get ip "$cfg" ip config_get name "$cfg" name diff --git a/utils/docker-compose/Makefile b/utils/docker-compose/Makefile index b92fcc1c6..5a09ef79c 100644 --- a/utils/docker-compose/Makefile +++ b/utils/docker-compose/Makefile @@ -1,14 +1,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=compose -PKG_VERSION:=2.23.1 +PKG_VERSION:=2.23.3 PKG_RELEASE:=1 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE PKG_SOURCE:=v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/docker/compose/tar.gz/v${PKG_VERSION}? -PKG_HASH:=9b4fba785b09d6745c35fff440cf5e2ce80bf7216dcb048535a7761dec492d11 +PKG_HASH:=29ba96c8d398fbc6f7c791c65e70b97e7df116223f2996062441093258d914fe PKG_MAINTAINER:=Javier Marcet diff --git a/utils/gl-puli-mcu/Config.in b/utils/gl-puli-mcu/Config.in new file mode 100644 index 000000000..315526c08 --- /dev/null +++ b/utils/gl-puli-mcu/Config.in @@ -0,0 +1,12 @@ +choice + depends on PACKAGE_gl-puli-mcu + + prompt "GL.iNet target" + default GL_PULI_MCU_XE300 + + config GL_PULI_MCU_XE300 + bool "GL.iNet XE300 (Puli)" + + config GL_PULI_MCU_XE3000 + bool "GL.iNet XE3000 (Puli AX)" +endchoice diff --git a/utils/gl-puli-mcu/Makefile b/utils/gl-puli-mcu/Makefile index d33e9288f..b1da42c77 100644 --- a/utils/gl-puli-mcu/Makefile +++ b/utils/gl-puli-mcu/Makefile @@ -1,24 +1,40 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gl-puli-mcu -PKG_VERSION:=1 +PKG_VERSION:=2 PKG_RELEASE:=1 PKG_MAINTAINER:=Nuno Goncalves PKG_LICENSE:=GPL-3.0-or-later +PKG_CONFIG_DEPENDS:= \ + CONFIG_GL_PULI_MCU_XE300 \ + CONFIG_GL_PULI_MCU_XE3000 + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk +define Package/gl-puli-mcu/config + source "$(SOURCE)/Config.in" +endef + define Package/gl-puli-mcu SECTION:=utils CATEGORY:=Utilities - TITLE:=GL.iNet GL-XE300 (Puli) power monitoring support - DEPENDS:=+kmod-usb-serial-ch341 +libubus +libubox + TITLE:=GL.iNet power monitoring support + DEPENDS:=+CONFIG_GL_PULI_MCU_XE300:kmod-usb-serial-ch341 +libubus +libubox + MENU:=1 endef +ifeq ($(CONFIG_GL_PULI_MCU_XE300),y) + TARGET_CFLAGS+=-DGL_TARGET=1 +endif +ifeq ($(CONFIG_GL_PULI_MCU_XE3000),y) + TARGET_CFLAGS+=-DGL_TARGET=2 +endif + define Package/gl-puli-mcu/description - Interfaces with GL-XE300 (Puli) power monitoring MCU over + Interfaces with GL.iNet Puli family power monitoring MCU over a USB to UART adapter present on the device and provides battery SOC, temperature, charging state and cycle count at ubus battery/info. diff --git a/utils/gl-puli-mcu/src/gl-puli-mcu.c b/utils/gl-puli-mcu/src/gl-puli-mcu.c index fe55cc42d..da7d7db83 100644 --- a/utils/gl-puli-mcu/src/gl-puli-mcu.c +++ b/utils/gl-puli-mcu/src/gl-puli-mcu.c @@ -26,6 +26,17 @@ #include #include +#define GL_TARGET_XE300 1 +#define GL_TARGET_XE3000 2 + +#if GL_TARGET == GL_TARGET_XE300 +#define MCU_PORT "/dev/ttyUSB0" +#elif GL_TARGET == GL_TARGET_XE3000 +#define MCU_PORT "/dev/ttyS1" +#else +#error Please define GL_TARGET! +#endif /* GL_TARGET */ + static struct ustream_fd stream; static struct ubus_auto_conn conn; static struct blob_buf b; @@ -39,6 +50,9 @@ struct Battery bool set; } battery; +#if GL_TARGET == GL_TARGET_XE300 +// MCU status returns something like: +// {OK},100,275,1,0 static bool process(char *read) { @@ -66,6 +80,65 @@ process(char *read) return false; return true; } +#elif GL_TARGET == GL_TARGET_XE3000 +static bool +get_int_value(const char *read, const char *key, int *int_value, char **new_end) +{ + char *from = NULL; + + from = strstr(read, key); + if ((!from) || (from != read)) + { + return false; + } + from = (char *)read + strlen(key); + *int_value = strtol(from, new_end, 10); + if (from == *new_end) + { + return false; + } + + return true; +} + +// MCU status returns something like: +// {"code":0,"capacity":100,"temp":28,"chg_state":1,"charge_cycle":0} +static bool +process(char *read) +{ + int int_value = 0; + char *to = NULL; + + if ((read[0] != '{') || + (!get_int_value(&read[1], "\"code\":", &int_value, &to)) || + (int_value != 0)) + { + return false; + } + if (!get_int_value(to + 1, "\"capacity\":", &int_value, &to)) + { + return false; + } + battery.soc = int_value; + if (!get_int_value(to + 1, "\"temp\":", &int_value, &to)) + { + return false; + } + battery.temperature = (float) int_value; + if (!get_int_value(to + 1, "\"chg_state\":", &int_value, &to)) + { + return false; + } + battery.charging = (bool) int_value; + if (!get_int_value(to + 1, "\"charge_cycle\":", &int_value, &to)) + { + return false; + } + battery.cycles = (uint16_t) int_value; + + return true; +} +#endif /* GL_TARGET */ static int consume(struct ustream *s, char **a) @@ -79,7 +152,7 @@ consume(struct ustream *s, char **a) battery.set = process(*a); if (!battery.set) - ULOG_ERR("failed to parse message from serial: %s", a); + ULOG_ERR("failed to parse message from serial: %s", *a); ustream_consume(s, eol - *a); *a = eol; @@ -202,7 +275,7 @@ main(int argc, char **argv) conn.cb = ubus_connect_handler; ubus_auto_connect(&conn); - if (serial_open("/dev/ttyUSB0") < 0) + if (serial_open(MCU_PORT) < 0) return -1; serial_query_timer.cb = serial_query_handler; diff --git a/utils/sockread/Makefile b/utils/sockread/Makefile index 52daf82b1..305c56d78 100644 --- a/utils/sockread/Makefile +++ b/utils/sockread/Makefile @@ -4,8 +4,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sockread -PKG_VERSION:=1.0 -PKG_RELEASE:=2 +PKG_VERSION:=1.1 +PKG_RELEASE:=1 PKG_LICENSE:=CC0-1.0 include $(INCLUDE_DIR)/package.mk @@ -13,13 +13,12 @@ include $(INCLUDE_DIR)/package.mk define Package/sockread SECTION:=utils CATEGORY:=Utilities - TITLE:=sockread + TITLE:=Unix domain sockets utility MAINTAINER:=Moritz Warning endef define Package/sockread/description - sockread writes and reads data from a Unix domain socket - represented as a special file on the file system. + Command line utility to read and write to Unix domain sockets. endef define Build/Prepare diff --git a/utils/sockread/src/main.c b/utils/sockread/src/main.c index c685bce71..b6d0713a9 100644 --- a/utils/sockread/src/main.c +++ b/utils/sockread/src/main.c @@ -7,57 +7,65 @@ #include #include -int main(int argc, char *argv[]) { - char buf[1024]; - ssize_t r; +const char *usage = + "Write to and read from a Unix domain socket.\n" + "Add commands to send as arguments or pass by pipe.\n" + "\n" + "Usage: sockread []\n"; - if (argc != 2) { - fprintf(stderr, "Write to and read from a Unix domain socket.\n\nUsage: %s \n", argv[0]); - return 1; - } +int main(int argc, char *argv[]) +{ + char buffer[1024]; + ssize_t r; - size_t addrlen = strlen(argv[1]); + if (argc < 2) { + fprintf(stderr, "%s", usage); + return EXIT_FAILURE; + } - /* Allocate enough space for arbitrary-length paths */ - char addrbuf[offsetof(struct sockaddr_un, sun_path) + addrlen + 1]; - memset(addrbuf, 0, sizeof(addrbuf)); + struct sockaddr_un address = {0}; + address.sun_family = AF_UNIX; + strcpy((char*) &address.sun_path, argv[1]); - struct sockaddr_un *addr = (struct sockaddr_un *)addrbuf; - addr->sun_family = AF_UNIX; - memcpy(addr->sun_path, argv[1], addrlen+1); + int sock = socket(AF_UNIX, SOCK_STREAM, 0); + if (sock < 0) { + fprintf(stderr, "socket() %s\n", strerror(errno)); + return EXIT_FAILURE; + } - int fd = socket(AF_UNIX, SOCK_STREAM, 0); - if (fd < 0) { - fprintf(stderr, "Failed to create socket: %s\n", strerror(errno)); - return 1; - } + if (connect(sock, (struct sockaddr*)&address, sizeof(address)) < 0) { + fprintf(stderr, "connect() %s\n", strerror(errno)); + return EXIT_FAILURE; + } - if (connect(fd, (struct sockaddr*)addr, sizeof(addrbuf)) < 0) { - fprintf(stderr, "Can't connect to `%s': %s\n", argv[1], strerror(errno)); - return 1; - } + /* Check if stdin refers to a terminal */ + if (!isatty(fileno(stdin))) { + /* Read from stdin and write to socket */ + while (0 < (r = fread(buffer, 1, sizeof(buffer), stdin))) { + send(sock, buffer, r, 0); + } + } else { + for (size_t i = 2; i < argc; i++) { + if (i > 2) { + send(sock, " ", 1, 0); + } + send(sock, argv[i], strlen(argv[i]), 0); + } + } - /* Check if stdin refers to a terminal */ - if (!isatty(fileno(stdin))) { - /* Read from stdin and write to socket */ - while (0 < (r = fread(buf, 1, sizeof(buf), stdin))) { - send(fd, buf, r, 0); - } - } + /* Read from socket and write to stdout */ + while (1) { + r = recv(sock, buffer, sizeof(buffer), 0); + if (r < 0) { + fprintf(stderr, "recv() %s\n", strerror(errno)); + return EXIT_FAILURE; + } - /* Read from socket and write to stdout */ - while (1) { - r = recv(fd, buf, sizeof(buf), 0); - if (r < 0) { - fprintf(stderr, "read: %s\n", strerror(errno)); - return 1; - } + if (r == 0) + break; - if (r == 0) - return 0; + fwrite(buffer, r, 1, stdout); + } - fwrite(buf, r, 1, stdout); - } - - return 0; + return EXIT_SUCCESS; }