Re: perl question

Scott Hannahs via Fink-devel <[email protected]> Mon, 17 May 2021 10:20:49 -0400
Newsgroups gmane.os.apple.fink.devel
Message-ID <[email protected]>
--===============4964139799901026503==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_8DF7911D-8C19-4CEA-B719-7BB2EE7CF627"


--Apple-Mail=_8DF7911D-8C19-4CEA-B719-7BB2EE7CF627
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Last annoying question for the day=E2=80=A6  I actually have emacs26-nox =
building on B.S.

I have fixes for the xinitrc (missing directory and the emacsen-common =
installs.  I can build emacs26-nox (which requires xinitrc for some =
reason).

But the fink install phase for emacs26-nox fails with the following:
Ignoring install-info called from maintainer script
The package emacs26-nox should be rebuilt with new debhelper to get =
trigger support
chown: games: illegal user name
dpkg: error processing package emacs26-nox (--install):
 subprocess installed post-installation script returned error exit =
status 1

And it is true.  I can not set a file to owner games.  However I did =
install passwd-games just today without error.  And the games user =
exists as the command:
dscl . read /Users/games
returns the contents of the games user profile.  However it seems to =
require a reboot for those users created by fink to actually own files.  =
Should there be some sort of info/indicator to the users that a reboot =
is necessary after installing passed-games (or probably any passwd type =
install) or is there a way to force the system to rebuild the user and =
groups database?

-Scott



> On May 13, 2021, at 14:56, Scott Hannahs via Fink-devel =
<[email protected]> wrote:
>=20
> Dan,
>=20
> Thanks for pointer.  IIR my perl, the loose typing means that the =
array is defined by being used.  The code seems to be then asking if =
there are any elements in an array.
>=20
> sub installed_add_on_packages_list {
>   # Caches value for future use...
>=20
>   if(! defined(@$installed_add_on_pkgs)) {
>     my $oldir =3D cwd();   =20
>     chdir($lib_dir . "/packages/install/") or die "couldn't chdir";
>     @$installed_add_on_pkgs =3D glob("*");
>     chdir($oldir);
>   }
>   return $installed_add_on_pkgs;
> }
>=20
> If there are elements then it just returns the array of add-on =
packages.  If not it then looks in the packages/install directory for a =
list. So
> if(! defined(@$installed_add_on_pkgs)) {
> could be rewritten as=20
> if(@$installed_add_on_pkgs <=3D0) {
>=20
> I will see if this works.
> -Scott
>=20
>> On May 13, 2021, at 14:43, Daniel Macks <[email protected] =
<mailto:[email protected]>> wrote:
>>=20
>> The idea "is an array defined" doesn't make sense due to how perl =
handles variables. One could ask "are there any elements in the array" =
or "is a variable a pointer to an array". IIRC this has been an =
ignoreable warning up until recent perl, so nobody's bothered figuring =
out which meaning is intended here to write a patch for emacsen-common =
(or see if there's a newer upstream version that solves it for us).
>>=20
>> dan
>>=20
>> =EF=BB=BFOn 5/13/21, 2:17 PM, "Scott Hannahs via Fink-devel" =
<[email protected] =
<mailto:[email protected]>> wrote:
>>=20
>>    Hopefully quick question to those more perl savvy!
>>    I am trying to get emacs to build under Mac OS 11.X Big Sur.  And =
it is being surly=E2=80=A6..
>>    When building emacsen now with Perl 5.30.2 the error is thrown at =
this point:
>>=20
>>    perl -wc generate-install-list
>>    Can't use 'defined(@array)' (Maybe you should just omit the =
defined()?) at generate-install-list line 24.
>>=20
>>=20
>>=20
>>=20
>>    That line is:
>>=20
>>    if(! defined(@$installed_add_on_pkgs)) {
>>=20
>>=20
>>=20
>>    I have tried removing =E2=80=9Cdefined", but it doesn=E2=80=99t =
like that operating on an array reference.  I tried substituting the =
=E2=80=9Cexists=E2=80=9D function but that isn=E2=80=99t well received =
either.  How does one detect that the installed_add_on_pkgs is not =
defined as an array?
>>=20
>>    -Scott
>>=20
>>    _______________________________________________
>>    Fink-devel mailing list
>>    [email protected] =
<mailto:[email protected]>
>>    List archive:
>>    https://sourceforge.net/p/fink/mailman/fink-devel =
<https://sourceforge.net/p/fink/mailman/fink-devel>
>>    Subscription management:
>>    https://lists.sourceforge.net/lists/listinfo/fink-devel =
<https://lists.sourceforge.net/lists/listinfo/fink-devel>
>>=20
>>=20
>>=20
>>=20
>> _______________________________________________
>> Fink-devel mailing list
>> [email protected] =
<mailto:[email protected]>
>> List archive:
>> https://sourceforge.net/p/fink/mailman/fink-devel
>> Subscription management:
>> https://lists.sourceforge.net/lists/listinfo/fink-devel
>=20
> _______________________________________________
> Fink-devel mailing list
> [email protected]
> List archive:
> https://sourceforge.net/p/fink/mailman/fink-devel
> Subscription management:
> https://lists.sourceforge.net/lists/listinfo/fink-devel


--Apple-Mail=_8DF7911D-8C19-4CEA-B719-7BB2EE7CF627
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">Last =
annoying question for the day=E2=80=A6 &nbsp;I actually have emacs26-nox =
building on B.S.<div class=3D""><br class=3D""></div><div class=3D"">I =
have fixes for the xinitrc (missing directory and the emacsen-common =
installs. &nbsp;I can build emacs26-nox (which requires xinitrc for some =
reason).</div><div class=3D""><br class=3D""></div><div class=3D"">But =
the fink install phase for emacs26-nox fails with the =
following:</div><blockquote style=3D"margin: 0 0 0 40px; border: none; =
padding: 0px;" class=3D""><div class=3D"">Ignoring install-info called =
from maintainer script</div><div class=3D"">The package emacs26-nox =
should be rebuilt with new debhelper to get trigger support</div><div =
class=3D"">chown: games: illegal user name</div><div class=3D"">dpkg: =
error processing package emacs26-nox (--install):</div><div =
class=3D"">&nbsp;subprocess installed post-installation script returned =
error exit status 1</div></blockquote><div class=3D""><br =
class=3D""></div><div class=3D"">And it is true. &nbsp;I can not set a =
file to owner games. &nbsp;However I did install passwd-games just today =
without error. &nbsp;And the games user exists as the =
command:</div><blockquote style=3D"margin: 0 0 0 40px; border: none; =
padding: 0px;" class=3D""><div class=3D"">dscl . read =
/Users/games</div></blockquote><div class=3D"">returns the contents of =
the games user profile. <b class=3D"">&nbsp;However it seems to require =
a reboot for those users created by fink to actually own files</b>. =
&nbsp;Should there be some sort of info/indicator to the users that a =
reboot is necessary after installing passed-games (or probably any =
passwd type install) or is there a way to force the system to rebuild =
the user and groups database?</div><div class=3D""><br =
class=3D""></div><div class=3D"">-Scott</div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D""><div><blockquote type=3D"cite" =
class=3D""><div class=3D"">On May 13, 2021, at 14:56, Scott Hannahs via =
Fink-devel &lt;<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><meta =
http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" =
class=3D""><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: =
space; line-break: after-white-space;" class=3D"">Dan,<div class=3D""><br =
class=3D""></div><div class=3D"">Thanks for pointer. &nbsp;IIR my perl, =
the loose typing means that the array is defined by being used. =
&nbsp;The code seems to be then asking if there are any elements in an =
array.<div class=3D""><br class=3D""></div><blockquote style=3D"margin: =
0 0 0 40px; border: none; padding: 0px;" class=3D""><div class=3D"">sub =
installed_add_on_packages_list {<br class=3D"">&nbsp;&nbsp;# Caches =
value for future use...<br class=3D""><br class=3D"">&nbsp;&nbsp;if(! =
defined(@$installed_add_on_pkgs)) {<br class=3D"">&nbsp; &nbsp;&nbsp;my =
$oldir =3D cwd();&nbsp;&nbsp; &nbsp;<br class=3D"">&nbsp; =
&nbsp;&nbsp;chdir($lib_dir . "/packages/install/") or die "couldn't =
chdir";<br class=3D"">&nbsp; &nbsp;&nbsp;@$installed_add_on_pkgs =3D =
glob("*");<br class=3D"">&nbsp; &nbsp;&nbsp;chdir($oldir);<br =
class=3D"">&nbsp;&nbsp;}<br class=3D"">&nbsp;&nbsp;return =
$installed_add_on_pkgs;<br class=3D"">}<br =
class=3D""></div></blockquote><div class=3D""><div class=3D""><br =
class=3D""></div><div class=3D"">If there are elements then it just =
returns the array of add-on packages. &nbsp;If not it then looks in the =
packages/install directory for a list. So</div></div><blockquote =
style=3D"margin: 0 0 0 40px; border: none; padding: 0px;" class=3D""><div =
class=3D""><div class=3D"">if(! defined(@$installed_add_on_pkgs)) =
{</div></div></blockquote><div class=3D""><div class=3D"">could be =
rewritten as&nbsp;</div></div><blockquote style=3D"margin: 0 0 0 40px; =
border: none; padding: 0px;" class=3D""><div class=3D""><div =
class=3D"">if(@$installed_add_on_pkgs &lt;=3D0) =
{</div></div></blockquote><div class=3D""><div class=3D""><br =
class=3D""></div><div class=3D"">I will see if this works.</div><div =
class=3D"">-Scott</div><div class=3D""><br class=3D""><blockquote =
type=3D"cite" class=3D""><div class=3D"">On May 13, 2021, at 14:43, =
Daniel Macks &lt;<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div class=3D"">The =
idea "is an array defined" doesn't make sense due to how perl handles =
variables. One could ask "are there any elements in the array" or "is a =
variable a pointer to an array". IIRC this has been an ignoreable =
warning up until recent perl, so nobody's bothered figuring out which =
meaning is intended here to write a patch for emacsen-common (or see if =
there's a newer upstream version that solves it for us).<br class=3D""><br=
 class=3D"">dan<br class=3D""><br class=3D"">=EF=BB=BFOn 5/13/21, 2:17 =
PM, "Scott Hannahs via Fink-devel" &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:<br =
class=3D""><br class=3D""> &nbsp;&nbsp;&nbsp;Hopefully quick question to =
those more perl savvy!<br class=3D""> &nbsp;&nbsp;&nbsp;I am trying to =
get emacs to build under Mac OS 11.X Big Sur. &nbsp;And it is being =
surly=E2=80=A6..<br class=3D""> &nbsp;&nbsp;&nbsp;When building emacsen =
now with Perl 5.30.2 the error is thrown at this point:<br class=3D""><br =
class=3D""> &nbsp;&nbsp;&nbsp;perl -wc generate-install-list<br =
class=3D""> &nbsp;&nbsp;&nbsp;Can't use 'defined(@array)' (Maybe you =
should just omit the defined()?) at generate-install-list line 24.<br =
class=3D""><br class=3D""><br class=3D""><br class=3D""><br class=3D""> =
&nbsp;&nbsp;&nbsp;That line is:<br class=3D""><br class=3D""> =
&nbsp;&nbsp;&nbsp;if(! defined(@$installed_add_on_pkgs)) {<br =
class=3D""><br class=3D""><br class=3D""><br class=3D""> =
&nbsp;&nbsp;&nbsp;I have tried removing =E2=80=9Cdefined", but it =
doesn=E2=80=99t like that operating on an array reference. &nbsp;I tried =
substituting the =E2=80=9Cexists=E2=80=9D function but that isn=E2=80=99t =
well received either. &nbsp;How does one detect that the =
installed_add_on_pkgs is not defined as an array?<br class=3D""><br =
class=3D""> &nbsp;&nbsp;&nbsp;-Scott<br class=3D""><br class=3D""> =
&nbsp;&nbsp;&nbsp;_______________________________________________<br =
class=3D""> &nbsp;&nbsp;&nbsp;Fink-devel mailing list<br class=3D""> =
&nbsp;&nbsp;&nbsp;<a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a><br class=3D""> =
&nbsp;&nbsp;&nbsp;List archive:<br class=3D""> &nbsp;&nbsp;&nbsp;<a =
href=3D"https://sourceforge.net/p/fink/mailman/fink-devel" =
class=3D"">https://sourceforge.net/p/fink/mailman/fink-devel</a><br =
class=3D""> &nbsp;&nbsp;&nbsp;Subscription management:<br class=3D""> =
&nbsp;&nbsp;&nbsp;<a =
href=3D"https://lists.sourceforge.net/lists/listinfo/fink-devel" =
class=3D"">https://lists.sourceforge.net/lists/listinfo/fink-devel</a><br =
class=3D""><br class=3D""><br class=3D""><br class=3D""><br =
class=3D"">_______________________________________________<br =
class=3D"">Fink-devel mailing list<br class=3D""><a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a><br class=3D"">List =
archive:<br class=3D""><a =
href=3D"https://sourceforge.net/p/fink/mailman/fink-devel" =
class=3D"">https://sourceforge.net/p/fink/mailman/fink-devel</a><br =
class=3D"">Subscription management:<br =
class=3D"">https://lists.sourceforge.net/lists/listinfo/fink-devel</div></=
div></blockquote></div><br =
class=3D""></div></div></div>_____________________________________________=
__<br class=3D"">Fink-devel mailing list<br class=3D""><a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a><br class=3D"">List =
archive:<br =
class=3D"">https://sourceforge.net/p/fink/mailman/fink-devel<br =
class=3D"">Subscription management:<br =
class=3D"">https://lists.sourceforge.net/lists/listinfo/fink-devel</div></=
blockquote></div><br class=3D""></div></body></html>=

--Apple-Mail=_8DF7911D-8C19-4CEA-B719-7BB2EE7CF627--


--===============4964139799901026503==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============4964139799901026503==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Fink-devel mailing list
[email protected]
List archive:
https://sourceforge.net/p/fink/mailman/fink-devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel
--===============4964139799901026503==--