public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] pxar: avoid including archive root's exclude patterns in .pxarexclude-cli
@ 2020-11-12 11:38 Fabian Ebner
  2020-11-12 12:05 ` [pbs-devel] applied: " Wolfgang Bumiller
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2020-11-12 11:38 UTC (permalink / raw)
  To: pbs-devel; +Cc: Wolfgang Bumiller

The patterns from the archive root's .pxarexclude file are already present in
self.patterns when encode_pxarexclude_cli is called. Pass along the number of
CLI patterns and slice accordingly.

Suggested-By: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Follow-up for:
https://lists.proxmox.com/pipermail/pbs-devel/2020-November/001509.html

 src/pxar/create.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/pxar/create.rs b/src/pxar/create.rs
index c907a8e0..cc28a79d 100644
--- a/src/pxar/create.rs
+++ b/src/pxar/create.rs
@@ -255,7 +255,7 @@ impl<'a, 'b> Archiver<'a, 'b> {
             let file_name = file_entry.name.to_bytes();
 
             if is_root && file_name == b".pxarexclude-cli" {
-                self.encode_pxarexclude_cli(encoder, &file_entry.name)?;
+                self.encode_pxarexclude_cli(encoder, &file_entry.name, old_patterns_count)?;
                 continue;
             }
 
@@ -387,8 +387,9 @@ impl<'a, 'b> Archiver<'a, 'b> {
         &mut self,
         encoder: &mut Encoder,
         file_name: &CStr,
+        patterns_count: usize,
     ) -> Result<(), Error> {
-        let content = generate_pxar_excludes_cli(&self.patterns);
+        let content = generate_pxar_excludes_cli(&self.patterns[..patterns_count]);
 
         if let Some(ref mut catalog) = self.catalog {
             catalog.add_file(file_name, content.len() as u64, 0)?;
-- 
2.20.1





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

* [pbs-devel] applied: [PATCH proxmox-backup] pxar: avoid including archive root's exclude patterns in .pxarexclude-cli
  2020-11-12 11:38 [pbs-devel] [PATCH proxmox-backup] pxar: avoid including archive root's exclude patterns in .pxarexclude-cli Fabian Ebner
@ 2020-11-12 12:05 ` Wolfgang Bumiller
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2020-11-12 12:05 UTC (permalink / raw)
  To: Fabian Ebner; +Cc: pbs-devel

applied

On Thu, Nov 12, 2020 at 12:38:06PM +0100, Fabian Ebner wrote:
> The patterns from the archive root's .pxarexclude file are already present in
> self.patterns when encode_pxarexclude_cli is called. Pass along the number of
> CLI patterns and slice accordingly.
> 
> Suggested-By: Wolfgang Bumiller <w.bumiller@proxmox.com>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> 
> Follow-up for:
> https://lists.proxmox.com/pipermail/pbs-devel/2020-November/001509.html
> 
>  src/pxar/create.rs | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/pxar/create.rs b/src/pxar/create.rs
> index c907a8e0..cc28a79d 100644
> --- a/src/pxar/create.rs
> +++ b/src/pxar/create.rs
> @@ -255,7 +255,7 @@ impl<'a, 'b> Archiver<'a, 'b> {
>              let file_name = file_entry.name.to_bytes();
>  
>              if is_root && file_name == b".pxarexclude-cli" {
> -                self.encode_pxarexclude_cli(encoder, &file_entry.name)?;
> +                self.encode_pxarexclude_cli(encoder, &file_entry.name, old_patterns_count)?;
>                  continue;
>              }
>  
> @@ -387,8 +387,9 @@ impl<'a, 'b> Archiver<'a, 'b> {
>          &mut self,
>          encoder: &mut Encoder,
>          file_name: &CStr,
> +        patterns_count: usize,
>      ) -> Result<(), Error> {
> -        let content = generate_pxar_excludes_cli(&self.patterns);
> +        let content = generate_pxar_excludes_cli(&self.patterns[..patterns_count]);
>  
>          if let Some(ref mut catalog) = self.catalog {
>              catalog.add_file(file_name, content.len() as u64, 0)?;
> -- 
> 2.20.1




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

end of thread, other threads:[~2020-11-12 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 11:38 [pbs-devel] [PATCH proxmox-backup] pxar: avoid including archive root's exclude patterns in .pxarexclude-cli Fabian Ebner
2020-11-12 12:05 ` [pbs-devel] applied: " Wolfgang Bumiller

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