Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  rpm.rte installation fails to create AIX-rpm package (updtvpkg error)

    Posted Thu September 19, 2024 04:01 PM

    Hello,

    This must have already been reported before and fixed, but I could not find any mention of this issue.

    Basically, the rpm.rte post-install scripts fails to create the AIX-rpm package (but reports an overall sucess) when the locale is not set to English or C.

    # env | grep LANG
    LANG=fr_FR
    # rpm -qa
    # /usr/sbin/updtvpkg
    /usr/sbin/updtvpkg: line 113:  release = le paquet AIX-rpm n'est pas installé + 1 : arithmetic syntax error
    # rpm -qa
    # LANG=C /usr/sbin/updtvpkg
    Please wait...
    # rpm -qa
    AIX-rpm-7.3.2.2-1.ppc
    #

    The problem here being a string comparison between error messages in different languages.

    #If for some reason AIX-rpm installation failed then current_release
    #will be set to the error message. This will avoid displaying the error message
    #if updtvpkg is run manually later.
    if [[ "$current_release" ==  "package AIX-rpm is not installed" ]]
    then
       current_release=0
    fi
    
    (( release = $current_release + 1 ))
    

    I have seen this with rpm.rte 4.15.1.1011 (on AIX 7.2.5.8) and 4.18.1.2002 (on AIX 7.3.2.2).

    No such problem when rpm.rte is installed from the "install dnf" script as it sets LANG=C.

    Kind Regards,

    Vincent



    ------------------------------
    Vincent Febvre
    ------------------------------

    #AIXOpenSource


  • 2.  RE: rpm.rte installation fails to create AIX-rpm package (updtvpkg error)

    Posted Mon September 23, 2024 04:31 AM

    seems more related  setting aix language to francais, which is weird in itself...unix systems should speak english.



    ------------------------------
    I regret starting this entire conversation
    ------------------------------



  • 3.  RE: rpm.rte installation fails to create AIX-rpm package (updtvpkg error)

    Posted Mon September 23, 2024 08:46 AM

    This is a respectable opinion, but AIX is still a multilingual OS.

    Besides, this is a case of the rpm.rte post-install script failing to handle the output of the rpm executable that has just been installed !

    This is definitely a bug.



    ------------------------------
    Vincent Febvre
    ------------------------------



  • 4.  RE: rpm.rte installation fails to create AIX-rpm package (updtvpkg error)

    Posted Mon September 23, 2024 01:27 PM

    Hi Vincent,

    /usr/sbin/updtvpkg does have export LANG=C but only when en_US is set.

    [[ "$LANG" = "en_US" ]] && export LANG=C

    I think it can simply export LANG=C irrespective of users LANG set.

    We will check and see if there was any reason to verify only en_US and modify the script accordingly.



    ------------------------------
    SANGAMESH
    ------------------------------



  • 5.  RE: rpm.rte installation fails to create AIX-rpm package (updtvpkg error)

    Posted Tue September 24, 2024 04:30 AM

    rpm is sending out the fr_FR message for "not installed", but updtvpkg is comparing it with the C/en_US message.

    I'm betting that "[ $LANG == en_US ] && export LANG=C" was intended to be "If the language isn't english, set the lang to C", which would be "||" instead of "&&".

    There's a couple of better options:

    • If $current_release isn't a number, then current_release=0
    • Change "current_release=$(rpm -q --queryformat '%{RELEASE}' AIX-rpm)" to "current_release=$(rpm -q --queryformat '%{RELEASE}' AIX-rpm) || current_release=0", and get rid of the if/then around line 113.

    Generally speaking, it's better to rely on return codes and what things are than on what they look like, particularly when NLS is around.

    Until a script is properly NLS-enabled, the second line should always be "LANG=C".

    PS: When I saw fr_FR, I was fully expecting this one to be about the thousands/decimal separators that fr_FR shares with pt_PT.

     



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------