Re: pbuilder-satisfydepends-classic profile parsing problem: slashes and spaces

2020-10-22 Thread Alexei Fedotov
Mattia, thanks for the answer, I will file a bug
--
Carry a towel
http://dataved.ru/
+7 916 562 8095

[1] Join Alexei Fedotov @linkedin, http://ru.linkedin.com/in/dataved/
[2] Join Alexei Fedotov @facebook, http://www.facebook.com/openmeetings
[3] Start using Apache Openmeetings today, http://openmeetings.apache.org/

On Thu, Oct 22, 2020 at 4:39 PM Mattia Rizzolo  wrote:
>
> Hi!
>
> On Wed, Oct 21, 2020 at 10:06:02PM +0300, Alexei Fedotov wrote:
> > I'm running pbuilder-0.230.4~bpo9+1/pbuilder-satisfydepends-classic
> > for the debian/control which contains
> >
> > Build-Depends: live-build (<= 1:20170213), ...
> >
> > I get the following log
> >
> > +++ output='live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
> > coreutils, findutils, '
> > +++ output='live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
> > coreutils, findutils'
> > +++ echo 'live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
> > coreutils, findutils'
> > ++ for INSTALLPKGMULTI in $(get_build_deps | split_deps)
> > +++ echo 'live-build/(<=/1:20170213)'
> > +++ tr / ' '
> > ++ echo ' -> Considering build-dep live-build (<= 1:20170213)'
> >  -> Considering build-dep live-build (<= 1:20170213)
> > ++ SATISFIED=no
> > +++ split_alternates 'live-build/(<=/1:20170213)'
> > +++ echo 'live-build/(<=/1:20170213)'
> > +++ sed 's/ *| */\n/g'
> > ++ for INSTALLPKG in $(split_alternates "$INSTALLPKGMULTI")
> > +++ get_pkg_name 'live-build/(<=/1:20170213)'
> > +++ echo 'live-build/(<=/1:20170213)'
> > +++ sed 's#^/*##; s#[[/(<].*##'
> > ++ CURRENTREALPKGNAME=live-build
> > ++ echo 'live-build/(<=/1:20170213)'
> > ++ grep -q '\['
> > ++ echo 'live-build/(<=/1:20170213)'
> > ++ grep -q '<'
>
> I reckon here is the problem ↑
> The code thinks that anything that contains a '<' is a build profile.
> That's probably because it's considered rare for a Build-Depends to have
> a << or a <= relation.
> From that assumption on it probably just fails over itself.
>
> > What is the proper list to discuss the issue? How should it be addressed?
>
> Please file a bug against pbuilder, but don't expect it to be solved
> quickly.
>
> In fact, nowadays I generally recommend people use the -apt resolver,
> which tends to work better in most cases, besides being faster.
>
> --
> regards,
> Mattia Rizzolo
>
> GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
> More about me:  https://mapreri.org : :'  :
> Launchpad user: https://launchpad.net/~mapreri  `. `'`
> Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-



Re: pbuilder-satisfydepends-classic profile parsing problem: slashes and spaces

2020-10-22 Thread Mattia Rizzolo
Hi!

On Wed, Oct 21, 2020 at 10:06:02PM +0300, Alexei Fedotov wrote:
> I'm running pbuilder-0.230.4~bpo9+1/pbuilder-satisfydepends-classic
> for the debian/control which contains
> 
> Build-Depends: live-build (<= 1:20170213), ...
> 
> I get the following log
> 
> +++ output='live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
> coreutils, findutils, '
> +++ output='live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
> coreutils, findutils'
> +++ echo 'live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
> coreutils, findutils'
> ++ for INSTALLPKGMULTI in $(get_build_deps | split_deps)
> +++ echo 'live-build/(<=/1:20170213)'
> +++ tr / ' '
> ++ echo ' -> Considering build-dep live-build (<= 1:20170213)'
>  -> Considering build-dep live-build (<= 1:20170213)
> ++ SATISFIED=no
> +++ split_alternates 'live-build/(<=/1:20170213)'
> +++ echo 'live-build/(<=/1:20170213)'
> +++ sed 's/ *| */\n/g'
> ++ for INSTALLPKG in $(split_alternates "$INSTALLPKGMULTI")
> +++ get_pkg_name 'live-build/(<=/1:20170213)'
> +++ echo 'live-build/(<=/1:20170213)'
> +++ sed 's#^/*##; s#[[/(<].*##'
> ++ CURRENTREALPKGNAME=live-build
> ++ echo 'live-build/(<=/1:20170213)'
> ++ grep -q '\['
> ++ echo 'live-build/(<=/1:20170213)'
> ++ grep -q '<'

I reckon here is the problem ↑
The code thinks that anything that contains a '<' is a build profile.
That's probably because it's considered rare for a Build-Depends to have
a << or a <= relation.
From that assumption on it probably just fails over itself.

> What is the proper list to discuss the issue? How should it be addressed?

Please file a bug against pbuilder, but don't expect it to be solved
quickly.

In fact, nowadays I generally recommend people use the -apt resolver,
which tends to work better in most cases, besides being faster.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
More about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


pbuilder-satisfydepends-classic profile parsing problem: slashes and spaces

2020-10-21 Thread Alexei Fedotov
Hello, Mattia, folks,

I'm running pbuilder-0.230.4~bpo9+1/pbuilder-satisfydepends-classic
for the debian/control which contains

Build-Depends: live-build (<= 1:20170213), ...

I get the following log

+++ output='live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
coreutils, findutils, '
+++ output='live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
coreutils, findutils'
+++ echo 'live-build (<= 1:20170213), sed, gawk, rsync, wget, patch,
coreutils, findutils'
++ for INSTALLPKGMULTI in $(get_build_deps | split_deps)
+++ echo 'live-build/(<=/1:20170213)'
+++ tr / ' '
++ echo ' -> Considering build-dep live-build (<= 1:20170213)'
 -> Considering build-dep live-build (<= 1:20170213)
++ SATISFIED=no
+++ split_alternates 'live-build/(<=/1:20170213)'
+++ echo 'live-build/(<=/1:20170213)'
+++ sed 's/ *| */\n/g'
++ for INSTALLPKG in $(split_alternates "$INSTALLPKGMULTI")
+++ get_pkg_name 'live-build/(<=/1:20170213)'
+++ echo 'live-build/(<=/1:20170213)'
+++ sed 's#^/*##; s#[[/(<].*##'
++ CURRENTREALPKGNAME=live-build
++ echo 'live-build/(<=/1:20170213)'
++ grep -q '\['
++ echo 'live-build/(<=/1:20170213)'
++ grep -q '<'
++ checkbuilddep_restrictiondeps 'live-build/(<=/1:20170213)' 'nocheck astrace'
++ local 'INSTALLPKG=live-build/(<=/1:20170213)'
++ local 'PROFILES=nocheck astrace'
+++ echo 'echo "$INSTALLPKG" | sed -e 's/[^<]*<\(.*\)>.*/\1/' -e 'y|/|
|' -e 's/>\s\+.*/\1/' -e 'y|/| |' -e 's/>\s\+http://dataved.ru/
+7 916 562 8095

[1] Join Alexei Fedotov @linkedin, http://ru.linkedin.com/in/dataved/
[2] Join Alexei Fedotov @facebook, http://www.facebook.com/openmeetings
[3] Start using Apache Openmeetings today, http://openmeetings.apache.org/



parsing problem

2010-12-09 Thread Bernard Fay
Hi,

I have long strings to parse which have permanent and variable information.
 Somewhere in the strings we have something like   Handle: 0x12a7
.  Handle is permanent and 0x12a7 is variable.  I wish to be able to
extract the variable part (0x12a7) and assign it to a variable.

Does anyone have an idea how to extract this information?

I think awk might be the tool to use but I not too good at it yet.

Thanks,
Bernard


Re: parsing problem

2010-12-09 Thread Joao Ferreira gmail
On Thu, 2010-12-09 at 11:33 -0500, Bernard Fay wrote:
 Hi,
 
 
 I have long strings to parse which have permanent and variable
 information.  Somewhere in the strings we have something like  
 Handle: 0x12a7 .  Handle is permanent and 0x12a7 is variable.  I
 wish to be able to extract the variable part (0x12a7) and assign it to
 a variable.  
 

I'dd use Perl I love Perl and I don't know any other language
appropriate for this :)

j...@squeeje:~$ cat string.txt
foo bar abc 123 Handle: 0x12a7 some more things
zoo zar Handle: 0x12a7 and more stuff

j...@squeeje:~$ cat string.txt  | perl -e 'while () {if (/Handle:\s+(\S
+)/){$line++; $your_variable = $1; print $line $your_variable\n; }};'

1 0x12a7
2 0x12a7


 
 Does anyone have an idea how to extract this information?
 
 
 I think awk might be the tool to use but I not too good at it yet. 
 
 
 Thanks,
 Bernard
 
 



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1291914022.2387.31.ca...@squeeje.critical.pt



Re: parsing problem

2010-12-09 Thread ghe

On 12/9/10 9:33 AM, Bernard Fay wrote:


I think awk might be the tool to use but I not too good at it yet.


How's your Perl?

--
Glenn English
g...@slsware.com


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4d010956.5070...@slsware.com



Re: parsing problem

2010-12-09 Thread Axel Freyn
Hi
On Thu, Dec 09, 2010 at 11:33:13AM -0500, Bernard Fay wrote:
 Hi,
 
 I have long strings to parse which have permanent and variable information.
  Somewhere in the strings we have something like   Handle: 0x12a7
 .  Handle is permanent and 0x12a7 is variable.  I wish to be able to
 extract the variable part (0x12a7) and assign it to a variable.
 
 Does anyone have an idea how to extract this information?
Beside the perl-proposal: it depends what you want to do then with the
data... You can already do it with sed: The sed-script 
s/.*Handle: \(0x[0-9a-f]*\) .*/\1/
does exactly this. I tell sed:
 - s//.../: replace the expression between the first two slashes by
   the one between the second two
 - the .* means: arbitrary characters --- so the first and the last
   part are ignored
 - then i NEED the exact expression Handle: 
 - after that, 0x followed by an arbitrary long sequence of digits
   and letters a to f. This part ist combined (this is done by
   \(...\) and referenced as first variable.
 - then this expression is replaces by this first variable:

Now, if you send your strings to the standard input of sed, it will
write the variable into its output:

echo bla bla bla Handle: 0x12a7 bla bla bla | sed -e 's/.*Handle: 
\(0x[0-9a-f]*\) .*/\1/'

gives: 

0x12a7


HTH,

Axel


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101209175829.ga...@axel



Re: parsing problem

2010-12-09 Thread Bernard Fay
Wonderful  Works like a charm.

A few year ago I used Perl a lot but I lost my hand at it.
Your idea of Perl helped me to fix another problem with the same file:
non-breaking space.
Perl and \xA0 fixed it for me.

Thanks a lot Joao,
Bernard


On Thu, Dec 9, 2010 at 12:00 PM, Joao Ferreira gmail 
joao.miguel.c.ferre...@gmail.com wrote:

 On Thu, 2010-12-09 at 11:33 -0500, Bernard Fay wrote:
  Hi,
 
 
  I have long strings to parse which have permanent and variable
  information.  Somewhere in the strings we have something like  
  Handle: 0x12a7 .  Handle is permanent and 0x12a7 is variable.  I
  wish to be able to extract the variable part (0x12a7) and assign it to
  a variable.
 

 I'dd use Perl I love Perl and I don't know any other language
 appropriate for this :)

 j...@squeeje:~$ cat string.txt
 foo bar abc 123 Handle: 0x12a7 some more things
 zoo zar Handle: 0x12a7 and more stuff

 j...@squeeje:~$ cat string.txt  | perl -e 'while () {if (/Handle:\s+(\S
 +)/){$line++; $your_variable = $1; print $line $your_variable\n; }};'

 1 0x12a7
 2 0x12a7


 
  Does anyone have an idea how to extract this information?
 
 
  I think awk might be the tool to use but I not too good at it yet.
 
 
  Thanks,
  Bernard
 
 





Re: parsing problem

2010-12-09 Thread Joao Ferreira gmail
cool :)

u'r wellcome glad to help...

I'm much more an asker on this list, rather than a responder...

glad to be of some help for a change :)

cheers
j

BTW: Perl rules ! Most incredible language in the World. !



On Thu, 2010-12-09 at 12:47 -0500, Bernard Fay wrote:
 Wonderful  Works like a charm.
 
 
 A few year ago I used Perl a lot but I lost my hand at it.
 Your idea of Perl helped me to fix another problem with the same file:
 non-breaking space.
 Perl and \xA0 fixed it for me.
 
 
 Thanks a lot Joao,
 Bernard
 
 
 On Thu, Dec 9, 2010 at 12:00 PM, Joao Ferreira gmail
 joao.miguel.c.ferre...@gmail.com wrote:
 On Thu, 2010-12-09 at 11:33 -0500, Bernard Fay wrote:
  Hi,
 
 
  I have long strings to parse which have permanent and
 variable
  information.  Somewhere in the strings we have something
 like  
  Handle: 0x12a7 .  Handle is permanent and 0x12a7 is
 variable.  I
  wish to be able to extract the variable part (0x12a7) and
 assign it to
  a variable.
 
 
 
 I'dd use Perl I love Perl and I don't know any other
 language
 appropriate for this :)
 
 j...@squeeje:~$ cat string.txt
 foo bar abc 123 Handle: 0x12a7 some more things
 zoo zar Handle: 0x12a7 and more stuff
 
 j...@squeeje:~$ cat string.txt  | perl -e 'while () {if
 (/Handle:\s+(\S
 +)/){$line++; $your_variable = $1; print $line $your_variable
 \n; }};'
 
 1 0x12a7
 2 0x12a7
 
 
 
 
  Does anyone have an idea how to extract this information?
 
 
  I think awk might be the tool to use but I not too good at
 it yet.
 
 
  Thanks,
  Bernard
 
 
 
 
 
 
 



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1291918413.2387.33.ca...@squeeje.critical.pt