[sbopkg-users] Fwd: sqg not respects sbopkg.conf REPOs (warning: very long e-mail)

Diniz Bortolotto diniz.bortolotto at gmail.com
Sat Feb 27 02:02:53 UTC 2021


Resending because size constraingt
Removed PNG trying jpg attachment

Best Regards,

Diniz Bortolotto



---------- Forwarded message ---------
De: Diniz Bortolotto <diniz.bortolotto at gmail.com>
Date: sex., 26 de fev. de 2021 às 22:43
Subject: sqg not respects sbopkg.conf REPOs (warning: very long e-mail)
To: <sbopkg-users at sbopkg.org>


Hi buddies!

My name is Diniz Bortolotto and I'm a Slackware64-current user.
Some days ago I changed my SBo default repository on sbopkg to Ponce's
repository to get current compliant packages.

After that, I noticed that some *SBo Queues* should be updated to keep
track of correct dependencies of the new repository.
I started a full update and after that noticed that it didn't work.
Studying the *sqg* script and BASH rules maybe I identified a
misunderstanding of source command and substitutions.

I think that error occurs because when we use a command substitution (like
*${...}* construct), we are creating a subshell that could inherit
variables from their parent shells, but this only works in one way and the
subshell cannot modify the environment of its parent shell (*sqg* in this
case).

I've made some changes to *sqg script* to test cases and after those tests
my suggestion is to *REMOVE REPOs variables* of sqg. (patch attached) I
also created two sbopkg.confs to test and added an option to show what I
wanna explain. (patch of test if someone want also try it)

Below I tried to make a graphical explanation of what I got on tests. :-)
Note that the third case is the default sqg and it should use REPOs in
sbopkg.conf not the sqg's defined.
*Sent a JPG attached.*

Below some test cases output:

First I created some test dirs to pass ok on sanity checks

root at darkstar:/usr/sbin# tree -fi /var/lib/sbopkg/sbo*

/var/lib/sbopkg/sbo_root_str

/var/lib/sbopkg/sbo_root_str/queue_str

/var/lib/sbopkg/sbo_root_str/repo_str

/var/lib/sbopkg/sbo_root_str/repo_str/branch_str

/var/lib/sbopkg/sbo_root_var

/var/lib/sbopkg/sbo_root_var/queue_var

/var/lib/sbopkg/sbo_root_var/repo_var

/var/lib/sbopkg/sbo_root_var/repo_var/branch_var


Test Cases:
1 - SBOPKG_CONF "BLANK" (commented out with '#') and REPOs also commented
on sqg: *(fail)*

root at darkstar:~# sqg -s
>
> SQG's vars before sanity checks:
>      SQG's SBOPKG_CONF..:
>      SQG's REPO_ROOT....:
>      SQG's REPO_NAME....:
>      SQG's REPO_BRANCH..:
>
> Doing sanity checks ...
> not found.
> Check the configurable variables at the top of the script.

2 - SBOPKG_CONF "BLANK" (commented out with '#') and REPOs defined on sqg:
*(fail)*

root at darkstar:~# sqg -s
>
> SQG's vars before sanity checks:
>      SQG's SBOPKG_CONF..:
>      SQG's REPO_ROOT....: /var/lib/sbopkg
>      SQG's REPO_NAME....: SBo
>      SQG's REPO_BRANCH..: 14.2
>
> Doing sanity checks ...
> not found.
> Check the configurable variables at the top of the script.
>
*3 - SBOPKG_CONF defined on sqg using substitution variables and REPOs
defined on sqg (default)*
*>>>> this is the behaviour that I first detected:  (wrong)*

root at darkstar:~# sqg -s
>
> SQG's vars before sanity checks:
>      SQG's SBOPKG_CONF..: /etc/sbopkg/sbopkg.conf_var
>      SQG's REPO_ROOT....: /var/lib/sbopkg
>      SQG's REPO_NAME....: SBo
>      SQG's REPO_BRANCH..: 14.2
>
> Doing sanity checks ...
>
> SQG's vars after sanity checks':
> (that includes a 'source /etc/sbopkg/sbopkg.conf_var')
>      SQG's REPO_ROOT....: /var/lib/sbopkg
>      SQG's REPO_NAME....: SBo
>      SQG's REPO_BRANCH..: 14.2
>
> SBo's vars (using grep to /etc/sbopkg/sbopkg.conf_var):
> getting all that came after '=' sign
>
>      SBo's REPO_ROOT....: ${REPO_ROOT:-/var/lib/sbopkg/sbo_root_var}
>      SBo's REPO_NAME....: ${REPO_NAME:-repo_var}
>      SBo's REPO_BRANCH..: ${REPO_BRANCH:-branch_var}
> Done.
>
4 - SBOPKG_CONF defined on sqg using substitution variables and REPOs
commented on sqg: (OK)

root at darkstar:~# sqg -s
>
> SQG's vars before sanity checks:
>      SQG's SBOPKG_CONF..: /etc/sbopkg/sbopkg.conf_var
>      SQG's REPO_ROOT....:
>      SQG's REPO_NAME....:
>      SQG's REPO_BRANCH..:
>
> Doing sanity checks ...
>
> SQG's vars after sanity checks':
> (that includes a 'source /etc/sbopkg/sbopkg.conf_var')
>      SQG's REPO_ROOT....: /var/lib/sbopkg/sbo_root_var
>      SQG's REPO_NAME....: repo_var
>      SQG's REPO_BRANCH..: branch_var
>
> SBo's vars (using grep to /etc/sbopkg/sbopkg.conf_var):
> getting all that came after '=' sign
>
>      SBo's REPO_ROOT....: ${REPO_ROOT:-/var/lib/sbopkg/sbo_root_var}
>      SBo's REPO_NAME....: ${REPO_NAME:-repo_var}
>      SBo's REPO_BRANCH..: ${REPO_BRANCH:-branch_var}
> Done.
>
5 - SBOPKG_CONF defined on sqg with fixed variables and REPOs commented on
sqg: (OK)

root at darkstar:~# sqg -s
>
> SQG's vars before sanity checks:
>      SQG's SBOPKG_CONF..: /etc/sbopkg/sbopkg.conf_str
>      SQG's REPO_ROOT....:
>      SQG's REPO_NAME....:
>      SQG's REPO_BRANCH..:
>
> Doing sanity checks ...
>
> SQG's vars after sanity checks':
> (that includes a 'source /etc/sbopkg/sbopkg.conf_str')
>      SQG's REPO_ROOT....: /var/lib/sbopkg/sbo_root_str
>      SQG's REPO_NAME....: repo_str
>      SQG's REPO_BRANCH..: branch_str
>
> SBo's vars (using grep to /etc/sbopkg/sbopkg.conf_str):
> getting all that came after '=' sign
>
>      SBo's REPO_ROOT....: /var/lib/sbopkg/sbo_root_str
>      SBo's REPO_NAME....: repo_str
>      SBo's REPO_BRANCH..: branch_str
> Done.
>
6 - SBOPKG_CONF defined on sqg with fixed variables and REPOs defined on
sqg: (OK)

root at darkstar:~# sqg -s
>
> SQG's vars before sanity checks:
>      SQG's SBOPKG_CONF..: /etc/sbopkg/sbopkg.conf_str
>      SQG's REPO_ROOT....: /var/lib/sbopkg
>      SQG's REPO_NAME....: SBo
>      SQG's REPO_BRANCH..: 14.2
>
> Doing sanity checks ...
>
> SQG's vars after sanity checks':
> (that includes a 'source /etc/sbopkg/sbopkg.conf_str')
>      SQG's REPO_ROOT....: /var/lib/sbopkg/sbo_root_str
>      SQG's REPO_NAME....: repo_str
>      SQG's REPO_BRANCH..: branch_str
>
> SBo's vars (using grep to /etc/sbopkg/sbopkg.conf_str):
> getting all that came after '=' sign
>
>      SBo's REPO_ROOT....: /var/lib/sbopkg/sbo_root_str
>      SBo's REPO_NAME....: repo_str
>      SBo's REPO_BRANCH..: branch_str
> Done.
>

Best Regards,
Diniz Bortolotto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sbopkg.org/pipermail/sbopkg-users/attachments/20210226/69d054d1/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqg.patch
Type: application/x-patch
Size: 882 bytes
Desc: not available
URL: <http://sbopkg.org/pipermail/sbopkg-users/attachments/20210226/69d054d1/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqg.test.patch
Type: application/x-patch
Size: 1853 bytes
Desc: not available
URL: <http://sbopkg.org/pipermail/sbopkg-users/attachments/20210226/69d054d1/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqg parms graph.jpg
Type: image/jpeg
Size: 82111 bytes
Desc: not available
URL: <http://sbopkg.org/pipermail/sbopkg-users/attachments/20210226/69d054d1/attachment-0001.jpg>


More information about the sbopkg-users mailing list