public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager 1/2] pvereport: dir2text: ignore special . and .. files
@ 2023-10-03 11:36 Aaron Lauterer
  2023-10-03 11:36 ` [pve-devel] [PATCH manager 2/2] pvereport: add interfaces.d directory Aaron Lauterer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Aaron Lauterer @ 2023-10-03 11:36 UTC (permalink / raw)
  To: pve-devel

So far this hasn't been an issue as each user of dir2text wanted files
with a specific pattern. But if we want every file in the directory, we
need to skip the special files '.' and '..'.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 PVE/Report.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/Report.pm b/PVE/Report.pm
index c9109dca..435458b9 100644
--- a/PVE/Report.pm
+++ b/PVE/Report.pm
@@ -13,6 +13,7 @@ my sub dir2text {
     my $text = '';
     PVE::Tools::dir_glob_foreach($target_dir, $regexp, sub {
 	my ($file) = @_;
+	return if $file eq '.' || $file eq '..';
 	$text .=  "\n# cat $target_dir$file\n";
 	$text .= PVE::Tools::file_get_contents($target_dir.$file)."\n";
     });
-- 
2.39.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-02 20:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-03 11:36 [pve-devel] [PATCH manager 1/2] pvereport: dir2text: ignore special . and .. files Aaron Lauterer
2023-10-03 11:36 ` [pve-devel] [PATCH manager 2/2] pvereport: add interfaces.d directory Aaron Lauterer
2023-10-31 11:27 ` [pve-devel] [PATCH manager 3/3] pvereport: add sdn config directory Aaron Lauterer
2023-11-02 20:02 ` [pve-devel] applied: [PATCH manager 1/2] pvereport: dir2text: ignore special . and .. files Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal