From patchwork Sat Mar 30 11:35:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7695 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZq36hHz3wfw for ; Sat, 30 Mar 2024 11:35:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4V6FZm6Jw0z1Yf; Sat, 30 Mar 2024 11:35:44 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4V6FZm4tbBz30Hg; Sat, 30 Mar 2024 11:35:44 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZk4KWKz30BH for ; Sat, 30 Mar 2024 11:35:42 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4V6FZj0ZdRz12p; Sat, 30 Mar 2024 11:35:40 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1711798541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DY8NpcyWc6Gazu0hHDo5pMsgrCytXfwbSr6ZQZCe1I0=; b=+fWmvL/LUmc4PoqP7WeqIOcCu2UuXQkfSAC1Y6j8wvxTZuZ+HYW7dI5zb//kQiK3ybXi5f e2ktw+aTIdFkFiAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1711798541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DY8NpcyWc6Gazu0hHDo5pMsgrCytXfwbSr6ZQZCe1I0=; b=YAwen32Itqh9MmTbrcJNHVtMqfv8W2JiKCOCTOa/Sa8a2+0tsmY5NH1rKElGr2yMk1cO4M H20mPufLSKSwPlY2K8FLFUHT+eC1x9Z6U5U7xKv1OoKLFTMdVGLBj1R1QsQqORgdEwfkqH 5mZOL7bnF7QvV/70V3EzvFNYq/gboNkti6UW4Te4+hEVfetxnEZklyPW0ZdCQDA8Il7qZb klvvAwjdtcy4HVhvWJvuN6v1eEOz7SsBGHLYUWDpV/zTRp4IKGBxkmAT6BbByzbgY2MCmL NX5yNyXX1O2jHb4m7HVoAKu4612OvlU2ZMF8R3YkTNsKT/MKsB5gIDGO3jo1CQ== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 1/5] perl-Capture-Tiny: New package Date: Sat, 30 Mar 2024 12:35:26 +0100 Message-Id: <20240330113530.1710702-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: G34EGSAPK3OF7RTW2ZC5XFHRA6NDNURI X-Message-ID-Hash: G34EGSAPK3OF7RTW2ZC5XFHRA6NDNURI X-MailFrom: stefan.schantl@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: <> List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This is only a build dependency for perl-Config-AutoConf and will not be installed on a system Signed-off-by: Stefan Schantl --- config/rootfiles/common/perl-Capture-Tiny | 6 ++ lfs/perl-Capture-Tiny | 77 +++++++++++++++++++++++ make.sh | 1 + 3 files changed, 84 insertions(+) create mode 100644 config/rootfiles/common/perl-Capture-Tiny create mode 100644 lfs/perl-Capture-Tiny diff --git a/config/rootfiles/common/perl-Capture-Tiny b/config/rootfiles/common/perl-Capture-Tiny new file mode 100644 index 000000000..4fb874d29 --- /dev/null +++ b/config/rootfiles/common/perl-Capture-Tiny @@ -0,0 +1,6 @@ +#usr/lib/perl5/site_perl/5.36.0/Capture +#usr/lib/perl5/site_perl/5.36.0/Capture/Tiny.pm +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Capture +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Capture/Tiny +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Capture/Tiny/.packlist +#usr/share/man/man3/Capture::Tiny.3 diff --git a/lfs/perl-Capture-Tiny b/lfs/perl-Capture-Tiny new file mode 100644 index 000000000..bb6b45e82 --- /dev/null +++ b/lfs/perl-Capture-Tiny @@ -0,0 +1,77 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2018 IPFire Team # +# # +# 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 Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 0.48 + +THISAPP = Capture-Tiny-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_BLAKE2 = e6de05459478131c5129dd5ffc84744e2d3440c2e31545ed101c2986b2bc970106f126286dea50350f4b5ea330ffac423693d755e29850883bdc215437bf7488 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +b2 : $(subst %,%_BLAKE2,$(objects)) + +############################################################################### +# Downloading, checking, b2sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_BLAKE2,$(objects)) : + @$(B2SUM) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && perl Makefile.PL + cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index e025f260f..ea0185e15 100755 --- a/make.sh +++ b/make.sh @@ -1377,6 +1377,7 @@ buildipfire() { lfsmake2 perl-Crypt-PasswdMD5 lfsmake2 perl-Net-Telnet lfsmake2 perl-JSON + lfsmake2 perl-Capture-Tiny lfsmake2 python3-inotify lfsmake2 python3-docutils lfsmake2 python3-daemon From patchwork Sat Mar 30 11:35:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7696 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZs1nh3z3wfw for ; Sat, 30 Mar 2024 11:35:49 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4V6FZn25L1z12p; Sat, 30 Mar 2024 11:35:45 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4V6FZm67dVz30H1; Sat, 30 Mar 2024 11:35:44 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZl2wnXz30BH for ; Sat, 30 Mar 2024 11:35:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4V6FZk5Y0Kz13k; Sat, 30 Mar 2024 11:35:42 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1711798543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7cDZjhfaKCRlkma8k7RkaeAqegwbNfhj+N20OG+7nW0=; b=z6CWDs+4b0hswZCIuhbpVfqnfkw1OJtObD9L4bGXQTbK9BX5gFN84YB7sg7G81PEP4Cgf6 IfEsVUQzyYFki4BQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1711798543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7cDZjhfaKCRlkma8k7RkaeAqegwbNfhj+N20OG+7nW0=; b=dBaORjgnBi1qUscYrWCpQwFpH+1hnOPVdHzh52AVkJtN8csJP29OyAHVzB+Dwbv40sHPdX OoO2NUCm4Hl44RQuABk4gzLoSlU1GZRdvkHll8Z5F3X2R653Ac1eixpcMco9W1+Pn+duAf QPhI1V6W3CFpFqjazl1f1pHrQZzqdGCZ3jKAEY/UQClQmkPk7AjaZo+1ZoNz9ZrUzv5m23 WmmGLUncQUXYvv+L8UF0MwlmFCLHO2OH01US4ybHWVnkFste2294qzt/z7BHmJY3q9OtKh zyqrMln7V6QUfsAXoe9NsUFtFeAYUH7ErzZaWY902iXGvE7cmX0cTU0UWxhPwA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/5] perl-Config-AutoConf: New package Date: Sat, 30 Mar 2024 12:35:27 +0100 Message-Id: <20240330113530.1710702-2-stefan.schantl@ipfire.org> In-Reply-To: <20240330113530.1710702-1-stefan.schantl@ipfire.org> References: <20240330113530.1710702-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: DLXHS32ZX33EFWYRFUTUIWNT2TLNXUWF X-Message-ID-Hash: DLXHS32ZX33EFWYRFUTUIWNT2TLNXUWF X-MailFrom: stefan.schantl@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: <> List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This is only a build dependency for perl-Arhive-Peek-Libarchive and will not be installed on a system Signed-off-by: Stefan Schantl --- config/rootfiles/common/perl-Config-AutoConf | 6 ++ lfs/perl-Config-AutoConf | 77 ++++++++++++++++++++ make.sh | 1 + 3 files changed, 84 insertions(+) create mode 100644 config/rootfiles/common/perl-Config-AutoConf create mode 100644 lfs/perl-Config-AutoConf diff --git a/config/rootfiles/common/perl-Config-AutoConf b/config/rootfiles/common/perl-Config-AutoConf new file mode 100644 index 000000000..e46d506cc --- /dev/null +++ b/config/rootfiles/common/perl-Config-AutoConf @@ -0,0 +1,6 @@ +#usr/lib/perl5/site_perl/5.36.0/Config +#usr/lib/perl5/site_perl/5.36.0/Config/AutoConf.pm +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Config +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Config/AutoConf +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Config/AutoConf/.packlist +#usr/share/man/man3/Config::AutoConf.3 diff --git a/lfs/perl-Config-AutoConf b/lfs/perl-Config-AutoConf new file mode 100644 index 000000000..ce12c295b --- /dev/null +++ b/lfs/perl-Config-AutoConf @@ -0,0 +1,77 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2018 IPFire Team # +# # +# 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 Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 0.320 + +THISAPP = Config-AutoConf-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_BLAKE2 = 649ef56196a5984437f299f96b156f63560a247a35f0547145e3519648ba5fc86c057957570b45b696c2092a56deaf0595d9191b4fe389e0a0f183b79d6c500a + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +b2 : $(subst %,%_BLAKE2,$(objects)) + +############################################################################### +# Downloading, checking, b2sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_BLAKE2,$(objects)) : + @$(B2SUM) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && perl Makefile.PL + cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index ea0185e15..1e31e203d 100755 --- a/make.sh +++ b/make.sh @@ -1378,6 +1378,7 @@ buildipfire() { lfsmake2 perl-Net-Telnet lfsmake2 perl-JSON lfsmake2 perl-Capture-Tiny + lfsmake2 perl-Config-AutoConf lfsmake2 python3-inotify lfsmake2 python3-docutils lfsmake2 python3-daemon From patchwork Sat Mar 30 11:35:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7697 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZt5hbCz3wfw for ; Sat, 30 Mar 2024 11:35:50 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4V6FZq0l2Dz2GQ; Sat, 30 Mar 2024 11:35:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4V6FZq08qKz32hH; Sat, 30 Mar 2024 11:35:47 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZm6rhvz30Bk for ; Sat, 30 Mar 2024 11:35:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4V6FZl5D56z12p; Sat, 30 Mar 2024 11:35:43 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1711798544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mi8KqmTFDAD+aVPsa1hQngzS9lbqXSO2AAv+N+mhLFg=; b=QrRV9Gz0kiXPYRqWbxLbu5n49RXC0OnbJFUV2BPoDjN7lseNARLhsm+nUc/wVEAO0DWWDC 8ncu4aFXbInpWwBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1711798544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mi8KqmTFDAD+aVPsa1hQngzS9lbqXSO2AAv+N+mhLFg=; b=T0J54isAsSVhiIwUMdvjaB5kYMvF7FxDYAWnTglumoPniOhsSUxPeN12Dz7kKqSjyATlSJ qulEDT6SHmfUCxmwwCiit3EiJeX8U3GMLgEvXXuhh2R327U4T9n6+ifaHMlC7+C9FypYT5 0Trdhu5flM5pPoE02OnHXqFtqvqrGrcVgjAxMgA/6e/Bvta2cu4wR/4wY2gm37nSvHdKoS ePLdK9GzjeX+u3iL8yPz9Gl2aFrZL9/GFyKKhck6g2CyuL2/wxqzRk5y1Hu+KEtnMPi7rm /PwD+OW+Li9p3aj7Tc5q+Yv2QoBphRbQcuDPlJm/6PvHFGKISLtxD+MKO5Xcpg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 3/5] perl-Object-Tiny: New package Date: Sat, 30 Mar 2024 12:35:28 +0100 Message-Id: <20240330113530.1710702-3-stefan.schantl@ipfire.org> In-Reply-To: <20240330113530.1710702-1-stefan.schantl@ipfire.org> References: <20240330113530.1710702-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: VNOPNZYYIXGDXVBWQXWTDBNKZ57TNDXQ X-Message-ID-Hash: VNOPNZYYIXGDXVBWQXWTDBNKZ57TNDXQ X-MailFrom: stefan.schantl@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: <> List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This is a runtime dependency of perl-Archive-Peek-Libarchive Signed-off-by: Stefan Schantl --- config/rootfiles/common/perl-Object-Tiny | 6 ++ lfs/perl-Object-Tiny | 77 ++++++++++++++++++++++++ make.sh | 1 + 3 files changed, 84 insertions(+) create mode 100644 config/rootfiles/common/perl-Object-Tiny create mode 100644 lfs/perl-Object-Tiny diff --git a/config/rootfiles/common/perl-Object-Tiny b/config/rootfiles/common/perl-Object-Tiny new file mode 100644 index 000000000..3ec9488d8 --- /dev/null +++ b/config/rootfiles/common/perl-Object-Tiny @@ -0,0 +1,6 @@ +#usr/lib/perl5/site_perl/5.36.0/Object +usr/lib/perl5/site_perl/5.36.0/Object/Tiny.pm +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Object +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Object/Tiny +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Object/Tiny/.packlist +#usr/share/man/man3/Object::Tiny.3 diff --git a/lfs/perl-Object-Tiny b/lfs/perl-Object-Tiny new file mode 100644 index 000000000..db19a6a25 --- /dev/null +++ b/lfs/perl-Object-Tiny @@ -0,0 +1,77 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2018 IPFire Team # +# # +# 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 Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.09 + +THISAPP = Object-Tiny-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_BLAKE2 = 0383d8af24d8c0d76dfc3cb6a65c6422f631d5ca4f9e083cf1077cc220b7aa27852c23ad5535bbcab74c7f5e9d1cba8f0f5c4d8da48c07a300d3b9e995b69d5c + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +b2 : $(subst %,%_BLAKE2,$(objects)) + +############################################################################### +# Downloading, checking, b2sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_BLAKE2,$(objects)) : + @$(B2SUM) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && perl Makefile.PL + cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index 1e31e203d..380d481db 100755 --- a/make.sh +++ b/make.sh @@ -1379,6 +1379,7 @@ buildipfire() { lfsmake2 perl-JSON lfsmake2 perl-Capture-Tiny lfsmake2 perl-Config-AutoConf + lfsmake2 perl-Object-Tiny lfsmake2 python3-inotify lfsmake2 python3-docutils lfsmake2 python3-daemon From patchwork Sat Mar 30 11:35:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7698 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZw6lHsz3wfw for ; Sat, 30 Mar 2024 11:35:52 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4V6FZs20GPz2WJ; Sat, 30 Mar 2024 11:35:49 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4V6FZs1W6Sz32hH; Sat, 30 Mar 2024 11:35:49 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZp3n9Rz30Hg for ; Sat, 30 Mar 2024 11:35:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4V6FZn2cjyz2jy; Sat, 30 Mar 2024 11:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1711798546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sfjs8avroLkZf5gVaBBpmOZ5VlHbk6RlVj1HzlxNRYM=; b=sjb0qpAiWIVMrlo1vFkgt+4opcywuxccfY6+HCiFU7CPsQJ5bsHYo1DSkb0NkAAT9jA3nT mCjxFmOAsm6DtF530U6PeU+6gG+nCPHfl1Ae4PBL3/QZDtRU5H+BxxfyblxxiCGIyOM6li 4jzUcPTQngR7weMjWyc3RD4l1LZ6pXKRAbGvlkBjwW7GOjHGnpMPGgF3JkQoH2c6fr9phJ P4gcQIkpk4C3FmDopLkCxjLZBpe5PF24zhovSiI6TlA5jdE4ZTeLqFnWmUy2FiO7UmMRCK YrF276nk9kKKs28L8bsYDobMQ4CTiYC46+ksAMianJ09PGC9r0xyLpE99KUyZA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1711798546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sfjs8avroLkZf5gVaBBpmOZ5VlHbk6RlVj1HzlxNRYM=; b=wl54BrDDnFYjy4ehJQ/bAY6UqLe/TCdStOkR+Cx1M2b2O0B6h9bvTcgN+Y5bp7EtFA0RyI /X8YiE4bQrL3t2Dg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 4/5] perl-Archive-Peek-Libarchive: New package Date: Sat, 30 Mar 2024 12:35:29 +0100 Message-Id: <20240330113530.1710702-4-stefan.schantl@ipfire.org> In-Reply-To: <20240330113530.1710702-1-stefan.schantl@ipfire.org> References: <20240330113530.1710702-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: 2DIY6M2RJ4TMPWP74VDOTRWSWTQAI4SG X-Message-ID-Hash: 2DIY6M2RJ4TMPWP74VDOTRWSWTQAI4SG X-MailFrom: stefan.schantl@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: <> List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: As very simple XS based perl binding for libarchive to get header data and extract files. Signed-off-by: Stefan Schantl --- .../common/perl-Archive-Peek-Libarchive | 8 ++ lfs/perl-Archive-Peek-Libarchive | 77 +++++++++++++++++++ make.sh | 1 + 3 files changed, 86 insertions(+) create mode 100644 config/rootfiles/common/perl-Archive-Peek-Libarchive create mode 100644 lfs/perl-Archive-Peek-Libarchive diff --git a/config/rootfiles/common/perl-Archive-Peek-Libarchive b/config/rootfiles/common/perl-Archive-Peek-Libarchive new file mode 100644 index 000000000..95e204562 --- /dev/null +++ b/config/rootfiles/common/perl-Archive-Peek-Libarchive @@ -0,0 +1,8 @@ +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/Archive +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/Archive/Peek +usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/Archive/Peek/Libarchive.pm +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Archive/Peek +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Archive/Peek/Libarchive +#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Archive/Peek/Libarchive/.packlist +usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Archive/Peek/Libarchive/Libarchive.so +#usr/share/man/man3/Archive::Peek::Libarchive.3 diff --git a/lfs/perl-Archive-Peek-Libarchive b/lfs/perl-Archive-Peek-Libarchive new file mode 100644 index 000000000..fd1ae85d6 --- /dev/null +++ b/lfs/perl-Archive-Peek-Libarchive @@ -0,0 +1,77 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2018 IPFire Team # +# # +# 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 Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + + +############################################################################### +# Definitions +############################################################################### + +include Config +VER = 0.38 + +THISAPP = Archive-Peek-Libarchive-$(VER) +DL_FILE = ${THISAPP}.tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_BLAKE2 = 142d54a6fe6b948129307ef7b0106905b2ddf858682d07a4f0815e6674f7fd425f462a800487949e18442884d6c743aeed049ebef7138fe0bfbbabac588dc3b3 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +b2 : $(subst %,%_BLAKE2,$(objects)) + +############################################################################### +# Downloading, checking, b2sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_BLAKE2,$(objects)) : + @$(B2SUM) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && perl Makefile.PL + cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index 380d481db..f15e93acb 100755 --- a/make.sh +++ b/make.sh @@ -1380,6 +1380,7 @@ buildipfire() { lfsmake2 perl-Capture-Tiny lfsmake2 perl-Config-AutoConf lfsmake2 perl-Object-Tiny + lfsmake2 perl-Archive-Peek-Libarchive lfsmake2 python3-inotify lfsmake2 python3-docutils lfsmake2 python3-daemon From patchwork Sat Mar 30 11:35:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7699 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZx6h29z3wwl for ; Sat, 30 Mar 2024 11:35:53 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4V6FZw4L0Rz2jq; Sat, 30 Mar 2024 11:35:52 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4V6FZv2vQRz32gp; Sat, 30 Mar 2024 11:35:51 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4V6FZq0vXqz30CD for ; Sat, 30 Mar 2024 11:35:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4V6FZp4FXWz1Zn; Sat, 30 Mar 2024 11:35:46 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1711798546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=drJTB1RR+hfUhwMBNvG0OGWHOuPPck4NqDqBd9qSfm4=; b=/X8wvsV4iAyGIeZAreB5PNWsR8hkksqY4m6rEkA465X+s18ZDSpUcypg9lmtgtpvS8CS2y Gb+pevLSVzO1RZCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1711798546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=drJTB1RR+hfUhwMBNvG0OGWHOuPPck4NqDqBd9qSfm4=; b=Fp+FO2obHUcdfLfe9NXm7rxiPQdn12SFYi45R/TKxdDK4y3szL6aNy/MiXUs1IITNG5R1c +5975H5mJMZk//zhQULgAFRv6e87r5RD0KaXnPe5jrI22mXXAMyQUvKR6BHKoi73bJk/5i +FBSkGWrtQ+RUBv2Qg1logGWLG3rLB+nyAzQ6ZHeGvwRDo660ZzAz7AXutVYpyYU4KEBIp 6c1oEfzA8RepU26cJMDArtovHdyNkDfi/MHvSCcc2Sa78tRb/OpTro+f2SjGdOSSIk0y7b EpMFCDvtS1RJ1RAiebXy2xPqosMvPJmFnuLwjABtEEgsWYAlKgvd535g/+mNFw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 5/5] ids-functions.pl: Use libarchive to extract archives Date: Sat, 30 Mar 2024 12:35:30 +0100 Message-Id: <20240330113530.1710702-5-stefan.schantl@ipfire.org> In-Reply-To: <20240330113530.1710702-1-stefan.schantl@ipfire.org> References: <20240330113530.1710702-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: 5IWNXABDDUIENGFNOYICC5SJZZLPKOQS X-Message-ID-Hash: 5IWNXABDDUIENGFNOYICC5SJZZLPKOQS X-MailFrom: stefan.schantl@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: <> List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This gives us a lot of benefits: * Speed up the extraction process * More supported archive types due the power of libarchive * Support of passphrase protected archives It also fixes a problem with non extracted files next to a zero sized file inside an archive. Fixes #13632. Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 56 +++++++++++---------------------- 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index c29a5151f..3eb883aa9 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -30,7 +30,7 @@ require "${General::swroot}/network-functions.pl"; require "${General::swroot}/suricata/ruleset-sources"; # Load perl module to deal with Archives. -use Archive::Tar; +use Archive::Peek::Libarchive; # Load perl module to deal with files and path. use File::Basename; @@ -515,9 +515,6 @@ sub downloadruleset ($) { sub extractruleset ($) { my ($provider) = @_; - # Disable chown functionality when uncompressing files. - $Archive::Tar::CHOWN = "0"; - # Get full path and downloaded rulesfile for the given provider. my $tarball = &_get_dl_rulesfile($provider); @@ -547,13 +544,11 @@ sub extractruleset ($) { } elsif ( $type eq "archive") { # Initialize the tar module. - my $tar = Archive::Tar->new($tarball); - - # Get the filelist inside the tarball. - my @packed_files = $tar->list_files; + my $tar = Archive::Peek::Libarchive->new(filename => $tarball); - # Loop through the filelist. - foreach my $packed_file (@packed_files) { + # Loop through the archive + $tar->iterate( sub { + my ($packed_file, $content) = @_; my $destination; # Splitt the packed file into chunks. @@ -572,13 +567,13 @@ sub extractruleset ($) { # Handle rules files. } elsif ($file =~ m/\.rules$/) { # Skip rule files which are not located in the rules directory or archive root. - next unless(($packed_file =~ /^rules\//) || ($packed_file =~ /^$provider-rules\//) || ($packed_file !~ /\//)); + return unless(($packed_file =~ /^rules\//) || ($packed_file =~ /^$provider-rules\//) || ($packed_file !~ /\//)); # Skip deleted.rules. # # Mostly they have been taken out for correctness or performance reasons and therfore # it is not a great idea to enable any of them. - next if($file =~ m/deleted.rules$/); + return if($file =~ m/deleted.rules$/); my $rulesfilename; @@ -615,39 +610,24 @@ sub extractruleset ($) { $destination = "$tmp_rules_directory/$rulesfilename"; } else { # Skip all other files. - next; + return; } # Check if the destination file exists. unless(-e "$destination") { - # Extract the file to the temporary directory. - $tar->extract_file("$packed_file", "$destination"); + # Open filehandle to write the content to a new file. + open(FILE, ">", "$destination") or die "Could not open $destination. $!\n"; } else { - # Generate temporary file name, located in the temporary rules directory and a suffix of ".tmp". - my $tmp = File::Temp->new( SUFFIX => ".tmp", DIR => "$tmp_rules_directory", UNLINK => 0 ); - my $tmpfile = $tmp->filename(); - - # Extract the file to the new temporary file name. - $tar->extract_file("$packed_file", "$tmpfile"); - - # Open the the existing file. - open(DESTFILE, ">>", "$destination") or die "Could not open $destination. $!\n"; - open(TMPFILE, "<", "$tmpfile") or die "Could not open $tmpfile. $!\n"; - - # Loop through the content of the temporary file. - while () { - # Append the content line by line to the destination file. - print DESTFILE "$_"; - } + # Open filehandle to append the content to the existing file. + open(FILE, ">>", "$destination") or die "Could not open $destination. $!\n"; + } - # Close the file handles. - close(TMPFILE); - close(DESTFILE); + # Write the extracted file content to the filehandle. + print FILE "$content" if ($content); - # Remove the temporary file. - unlink("$tmpfile"); - } - } + # Close the file handle. + close(FILE); + }); } }