Open M0ses opened 1 month ago
I was also thinking that the (osc )vc
call could be optional, and cpanspe would just write the new changes into a file in the osc checkout, and then one would be able to call the preferred vc command after that.
We also need to remember to add the dependency sccs to the spec file: https://build.opensuse.org/package/show/devel:languages:perl/cpanspec
Could it maybe fallback to osc vc
if vc
is not found?
Hm, actually /usr/lib/build/vc (a shell script) seems to be a different script than /usr/bin/vc (binary).
Also, when calling /usr/lib/build/vc
I get:
/usr/lib/build/vc: line 26: dnsdomainname: command not found
It needs the hostname
or hostname-busybox
package.
And the header is: Mon Jul 15 14:50:43 UTC 2024 - tina <tina@localhost>
Calling vc
from sccs
just hangs. I guess this is something completely different.
DESCRIPTION
The vc command copies lines from the standard input to the standard output under control of its arguments and of ‘‘control statements’’ encountered in the standard input. In the process of per‐
forming the copy operation, user‐declared keyword may be replaced by their string value when they appear in plain text and/or control statements.
Could it maybe fallback to
osc vc
ifvc
is not found?
Possible but useless. (IMHO)
osc uses /usr/lib/{,obs-}build/vc, so osc vc
as fallback would fail for the same reason as cpanspec
.
Here some experiments with pythons shutil.which
kanku@moosex-app:~> python3 -c 'import shutil;print("%s" % shutil.which("my_cmd"));'
None
kanku@moosex-app:~> alias perldoc=/bin/true
kanku@moosex-app:~> python3 -c 'import shutil;print("%s" % shutil.which("perldoc"));'
/usr/bin/perldoc
kanku@moosex-app:~> alias my_cmd=/bin/true
kanku@moosex-app:~> python3 -c 'import shutil;print("%s" % shutil.which("my_cmd"));'
None
kanku@moosex-app:~>
Hm, actually /usr/lib/build/vc (a shell script) seems to be a different script than /usr/bin/vc (binary).
Also, when calling
/usr/lib/build/vc
I get:/usr/lib/build/vc: line 26: dnsdomainname: command not found
Just another (non-critical) try to guess email
.
It needs the
hostname
orhostname-busybox
package. And the header is:Mon Jul 15 14:50:43 UTC 2024 - tina <tina@localhost>
I see - osc vc
does some more guessing for realname/email address.
AFAICS osc vc
is checking ~/.config/osc/oscrc
for realname
/email
and if not found, it does osc api /person/<user>
to gather the missing information.
Calling
vc
fromsccs
just hangs. I guess this is something completely different.
Sorry for confusion - I fixed my PR so it does not search vc
in $PATH
any longer.
Seems like osc vc
was used because it already does all the realname/email guessing.
This might be completly fine for the average users usecases,
but in case of a fresh initialised environment it looks quite strange.
Even if the ENV variables VC_REALNAME/VC_MAILADDR are already set osc vc
asks for apiurl/credentials to login at OBS.
kanku@moosex-app:/tmp/kanku> export VC_MAILADDR=fschreiner@suse.com
kanku@moosex-app:/tmp/kanku> export VC_REALNAME="Frank Schreiner"
kanku@moosex-app:/tmp/kanku> cpanspec -f MooseX-App-1.43.tar.gz
Your user account / password are not configured yet.
You will be asked for them below, and they will be stored in
/home/kanku/.config/osc/oscrc for future use.
I now have a better understanding why osc vc
was used in the past.
Anyway, I think, currrently its quite confusing for users and breaks the good old KISS principle.
Even cpanspec -p "My Name <my.address@example.com>" ...
doesn't prevent osc
from asking for credentials.
So far I found the following places where osc vc
tries to find realname/mailaddr:
-p
or --packager
option$HOME/.rpmmacros
macro named %packager
$HOME/.config/osc/oscrc
(realname/email in sections)osc api /person/<username>
Please feel free to enhance the list
Calling
vc
directly instead of usingosc vc
as wrapper.cpanspec should not require a configured
osc
.osc
is showing a cli wizard to configure login into a OBS instance at first call. This is not required bycpanspec
except for thevc
command.