[devel] menu DURING_INSTALL

Stanislav Ievlev =?iso-8859-1?q?inger_=CE=C1_altlinux=2Eorg?=
Пн Сен 22 12:25:11 MSD 2008


Лучше бы конечно делать при первом старте.

On Mon, Sep 22, 2008 at 07:19:58AM +0000, Alexey Tourbin wrote:
> В каких случаях при установке пакетов выставляется DURING_INSTALL?
> 
> Также прошу прокомментировать последнее изменение в пакете menu.
> Почему инициализировать меню надо не в %post-скрипте, а при первой
> загрузке?
> 
> commit e5c0c5f30d097ef18c3c619a51c3cc962742a58c
> Author: Anton Farygin <rider на altlinux>
> Date:   Wed Jun 25 13:07:15 2008 +0400
> 
>     2.1.35-alt5.1
>     
>     - create /etc/menu-methods/lang.h in firsttime script, also don't run post
>       script on system preparing stage (check DURING_INSTALL)
> 
> diff --git a/menu-firsttime b/menu-firsttime
> index 1e8dac3..a677d90 100755
> --- a/menu-firsttime
> +++ b/menu-firsttime
> @@ -5,4 +5,23 @@ WITHOUT_RC_COMPAT=1
>  # Source function library.
>  . /etc/init.d/functions
>  
> +# create languages list
> +if [ -r /etc/sysconfig/i18n ]; then
> +    . /etc/sysconfig/i18n
> +fi
> +PREFERRED_LOCALE=$LANG
> +[ -n "$PREFERRED_LOCALE" ] || PREFERRED_LOCALE=C
> +
> +LANGUAGES_LIST=$SUPPORTED
> +[ -n "$LANGUAGES_LIST" ] || LANGUAGES_LIST=$PREFERRED_LOCALE
> +[ -n "$LANGUAGES_LIST" ] || LANGUAGES_LIST=C
> +
> +if [ "$LANGUAGE" == "all" ]
> +then
> +    LANGUAGES_LIST=`echo /usr/share/locale/*/LC_MESSAGES/menu-messages.mo | sed -e 's@/usr/share/locale/@@g' -e 's@/LC_MESSAGES/menu-messages.mo@@g' -e 's@ @:@g'`
> +fi
> +echo "function lang()=\"$PREFERRED_LOCALE\"" > /etc//menu-methods/lang.h
> +echo "function languages()=\"$LANGUAGES_LIST\"" >> /etc/menu-methods/lang.h
> +
> +
>  action "Updating application menus:" /usr/bin/update-menus
> diff --git a/menu.spec b/menu.spec
> index c74e1c4..fc4c777 100644
> --- a/menu.spec
> +++ b/menu.spec
> @@ -3,7 +3,7 @@
>  
>  Name: menu
>  Version: 2.1.35
> -Release: alt5
> +Release: alt5.1
>  
>  Group: System/Base
>  Summary: Menu system
> @@ -153,6 +153,8 @@ mkdir -p %buildroot/%_sysconfdir/xdg/menus/
>  
>  %post
>  # create languages list
> +[ -z "$DURING_INSTALL" ] || exit 0
> +
>  if [ -r %_sysconfdir/sysconfig/i18n ]; then
>      . %_sysconfdir/sysconfig/i18n
>  fi
> @@ -204,6 +206,10 @@ fi
>  %doc doc/{*html,README*,BUGS,menu.txt*} AUTHORS debian/changelog debian/copyright examples
>  
>  %changelog
> +* Wed Jun 25 2008 Anton Farygin <rider на altlinux> 2.1.35-alt5.1
> +- create /etc/menu-methods/lang.h in firsttime script, also don't run post 
> +  script on system preparing stage (check DURING_INSTALL)
> +
>  * Tue Oct 23 2007 Sergey V Turchin <zerg at altlinux dot org> 2.1.35-alt5
>  - improve desktop categories translation file
>  



> _______________________________________________
> Devel mailing list
> Devel на lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/devel




Подробная информация о списке рассылки Devel