Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2021-02-16 Thread Panu Matilainen
Oh and @vt-alt , thanks for the patch!

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436#issuecomment-779636550___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2021-02-16 Thread Panu Matilainen
Merged #1436 into master.

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436#event-4334661437___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2021-02-16 Thread Panu Matilainen
Ack, thanks for confirming.

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436#issuecomment-779636318___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2021-02-15 Thread Mark Wielaard
Hi,

Sorry for the late reply. Somehow the notification emails ended up in a
spam folder. sigh.

On Thu, 2020-12-10 at 04:29 -0800, Panu Matilainen wrote:
> Mark, any objections to this change? I like the idea of having
> directories explicitly marked with trailing slash, it goes with the
> spirit of what we're doing elsewhere already for a long time

I agree. The last commit 161c89 on pr/1436 looks good to me.

Cheers,

Mark
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-12-10 Thread Panu Matilainen
Mark, any objections to this change? I like the idea of having directories 
explicitly marked with trailing slash, it goes with the spirit of what we're 
doing elsewhere already for a long time (eg commit 
65e88045ba80b175418b865fe4c4a88d48c00189 and 
23167c3ea459405c98d8e759993efb6d9b1ea7f3)

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436#issuecomment-742491390___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-11-17 Thread Vitalio
@vt-alt pushed 1 commit.

161c89795fae9826ae63609a9a5f9f2360cb9ccd  debugedit: Distinguish files from 
directories in src list file


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436/files/bd3ba770a0794b280576fc5c34eea9f95d7f18d1..161c89795fae9826ae63609a9a5f9f2360cb9ccd
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-11-17 Thread Vitalio
@vt-alt pushed 1 commit.

bd3ba770a0794b280576fc5c34eea9f95d7f18d1  debugedit: Distinguish files from 
directories in src list file


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436/files/8ab1e3646607711c81860998bdf49cc2ffe81fdd..bd3ba770a0794b280576fc5c34eea9f95d7f18d1
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-11-17 Thread Vitalio
> Might it be an idea to split find-debuginfo.sh upstream and adopt/merge your 
> scripts?

I split `process-debuginfo` to run them via `xargs -P` in parallel to speed up
debuginfo processing. In general, modular approach might be more maintainable
than monolithic script. So, this might me a good idea.

> BTW. I gave you bad advice, p[0] is after the last character written

Ouch, I didn't notice that too. 

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436#issuecomment-729049023___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-11-17 Thread Mark Wielaard
Hi Vitalio,

On Sun, 2020-11-15 at 12:35 -0800, Vitalio wrote:
> BTW. How does this help you speed things up?
> 
> We do just `grep -v '/$' to filter directories from source list[1], instead 
> of loop similar to `while read f; do test -d $f || echo $f; done` which takes 
> more than 15 seconds on kernel package.
> 
>  [1] 
> http://git.altlinux.org/people/vt/packages/?p=rpm-build.git;a=commitdiff;h=623707e72815

aha, you have a separate process-debuginfo and find-debuginfo-files
script that I assume replaces the upstream find-debuginfo.sh script.
Yours seem much simpler than what we have in find-debuginfo.sh, which
has grown support for dwz, mini-symtab, etc. Might it be an idea to
split find-debuginfo.sh upstream and adopt/merge your scripts?

BTW. I gave you bad advice, p[0] is after the last character written,
so will always be the zero string terminator because we now use
strlen() - 1. It should have been *(p-1) != '/'. Which should always
work because we filter out zero length strings in the if statement
before the block, so there is always  at least one (last) character.
Sorry about that.

Cheers,

Mark
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-11-16 Thread Vitalio
@vt-alt pushed 1 commit.

8ab1e3646607711c81860998bdf49cc2ffe81fdd  debugedit: Distinguish files from 
directories in src list file


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436/files/01dee60d8dd1f8f705fd9087bc297eb0eed3acaa..8ab1e3646607711c81860998bdf49cc2ffe81fdd
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-11-15 Thread Vitalio
Mark,

> BTW. How does this help you speed things up?

We do just `grep -v '/$' to filter directories from source list[1], instead of 
loop similar to `while read f; do test -d $f || echo $f; done` which takes more 
than 15 seconds on kernel package.

Thanks,

 [1] 
http://git.altlinux.org/people/vt/packages/?p=rpm-build.git;a=commitdiff;h=623707e72815

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436#issuecomment-727632437___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-11-15 Thread Mark Wielaard
Hi,

On Sun, 2020-11-15 at 07:20 -0800, Vitalio wrote:
> Append / to directories in source file list (for `-l
> option) to allow
> quickly distinguish them from regular files (to avoid adding them raw
> into %files section). This is needed for ALT for our debuginfo
> processing to speed things up.

I understand you would like to make sure all comp_dirs end with a
trailing '/' character. But I don't think unconditionally adding a '/'
is the right thing to do:

> diff --git a/tools/debugedit.c b/tools/debugedit.c
> index c2884933c..2eb912c72 100644
> --- a/tools/debugedit.c
> +++ b/tools/debugedit.c
> @@ -1923,7 +1923,7 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct 
> abbrev_tag *t, int phase)
>const char *p = skip_dir_prefix (comp_dir, base_dir);
>if (p != NULL && p[0] != '\0')
>  {
> -   size_t size = strlen (p) + 1;
> +   size_t size = strlen (p);
> while (size > 0)
>   {
> ssize_t ret = write (list_file_fd, p, size);
> @@ -1932,6 +1932,10 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct 
> abbrev_tag *t, int phase)
> size -= ret;
> p += ret;
>   }
> +   /* Output trailing dir separator to distinguish them quickly from
> +  regular files. */
> +   if (size == 0)
> + write (list_file_fd, "/", 2);
>   }
>  }

Note for others, the list_file contains zero terminated file names.
That is why we want to write size = strlen (p) + 1 characters, so that
it includes the '\0' terminator.

After the while loop size is always zero, unless an error occurred and
not all characters were written. So this code would add a "/"
(including a termination '\0') always, even if there was already one.
So I think you actually want to test that p[0] != '/' before adding the
string "/", but just write (list_file_fd, "", 1) otherwise.

BTW. How does this help you speed things up?

Cheers,

Mark
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] debugedit: Distinguish files from directories in src list file (#1436)

2020-11-15 Thread Vitalio
Append / to directories in source file list (for `-l option) to 
allow
quickly distinguish them from regular files (to avoid adding them raw
into %files section). This is needed for ALT for our debuginfo
processing to speed things up.

Co-authored-by: Dmitry V. Levin l...@altlinux.org

@ldv-alt

You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1436

-- Commit Summary --

  * debugedit: Distinguish files from directories in src list file

-- File Changes --

M tools/debugedit.c (6)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1436.patch
https://github.com/rpm-software-management/rpm/pull/1436.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1436
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint