From: Sergey Vlasov <vsu@altlinux.ru> To: ALT Devel discussion list <devel@lists.altlinux.org> Subject: Re: [devel] XFS - кому он нужен? или продожение шрифтовой темы Date: Fri, 24 Mar 2006 12:58:29 +0300 Message-ID: <20060324095829.GI32278@master.mivlgu.local> (raw) In-Reply-To: <200603241120.22896.shrek@freesource.info> [-- Attachment #1: Type: text/plain, Size: 4331 bytes --] On Fri, Mar 24, 2006 at 11:20:12AM +0300, Valery V. Inozemtsev wrote: > В сообщении от 22 марта 2006 22:35 Dmitry V. Levin написал(a): > > On Wed, Mar 22, 2006 at 09:38:13PM +0300, Valery V. Inozemtsev wrote: > > > > > > *term вроде пока актуальны, а у нас не все столько за собой > > > > > > таскают, как xterm. aterm полегче будет. Надо, в общем. > > > > > > > > > > во-первых, мне не хотелось бы в %post делать такой скрипт, > > > > > > > > Ну так он вообще напоминает макрос (или helper для него). > > > > > > скрипт в атаче. кто нибудь, объясните в двух словах как из него сделать > > > макрос, > > > > Записать скрипт в файл и в макросе вызывать его. > > в атаче файлы с макросами и с хелпером к нему, исправления/добвления > приветствуются > > -- > Valery V. Inozemtsev > %_fontsdir %_datadir/fonts > > %_bitmapfontsdir %_fontsdir/bitmap > %_type1fontsdir %_fontsdir/type1 > %_ttffontsdir %_fontsdir/ttf > %_otffontsdir %_fontsdir/otf > %_speedofontsdir %_fontsdir/speedo > > %add_bitmapfont_path() %_bindir/mkfontdir %1; \ > %_bindir/fc-cache %1; \ > %prefix/lib/rpm/xfontpath.sh -a %1 \ ';' здесь писать не нужно - '\' после обработки макросов превратится в конец строки, который потом и попадёт в shell. Кроме того, не лучше ли будет засунуть все эти команды в скрипт, добавив к нему опции, указывающие тип шрифта? И стоит ли экономить '_' - не лучше ли назвать этот макрос %add_bitmap_font_path ? > %add_type1font_path() %_bindir/mkfontscale %1; \ > %_bindir/mkfontdir %1; \ > %_bindir/fc-cache %1; \ > %prefix/lib/rpm/xfontpath.sh -a %1 > > %add_ttffont_path() %_sbindir/ttmkfdir -d %1 -o %1/fonts.dir 2>/dev/null; \ > %_sbindir/ttmkfdir -d %1 -o %1/fonts.scale 2>/dev/null; \ > %_bindir/fc-cache %1; \ > %prefix/lib/rpm/xfontpath.sh -a %1 А что мешает здесь сначала сгенерировать fonts.scale с помощью ttmkfdir, а потом, как и в других случаях, вызвать mkfontdir? > %add_otffont_path() %add_ttffont_path > > %add_bitmapfont_path_first() %_bindir/mkfontdir %1; \ > %_bindir/fc-cache %1; \ > %prefix/lib/rpm/xfontpath.sh -fa %1 > > %remove_font_path() %prefix/lib/rpm/xfontpath.sh -r %1 > #!/bin/sh > > PROG="${0##*/}" > > XFS= > USEXFS=0 > XSET= > ADD=0 > FONTPATH= > CHKFONTPATH= > > Usage() > { > [ "$1" = 0 ] || exec >&2 > cat <<EOF > Usage: $PROG option[s] directory > > Valid options are: > -a, --add=DIRECTORY Add directory to font path > -r, --remove=DIRECTORY Remove directory from font path Именно так - с параметром? Или всё-таки --add или --remove для задания режима работы, а каталог отдельно? > -f, --first Make --add to put the directory first (not last) > in the path > EOF > > [ -n "$1" ] && exit "$1" || exit > } > > [ -n "$*" ] || Usage > > TEMP=`getopt -n "$PROG" -o a:r:f -l add:,remove:,first -- "$@"` || Usage > eval set -- "$TEMP" > > if [ -r /etc/sysconfig/xfs ]; then > source /etc/sysconfig/xfs > case "$XFS" in > yes|Yes|YES|true|True|TRUE|on|On|ON|Y|y|1) > USEXFS=1 > ;; > esac > fi > > while :; do > case "$1" in > -a|--add) > shift > [ -n "$XSET" ] || XSET="fp+" > ADD=1 > [ -n "$CHKFONTPATH" ] || CHKFONTPATH="-q -a" > FONTPATH="$1" > shift > ;; > -r|--remove) > shift > XSET="-fp" > ADD=0 > CHKFONTPATH="-q -r" > FONTPATH="$1" > shift > ;; > -f|--first) > XSET="+fp" > ADD=1 > CHKFONTPATH="-q -fa" > shift > ;; > --) > shift > break > ;; > esac > done > > eval /usr/sbin/chkfontpath "$CHKFONTPATH" "$FONTPATH" >/dev/null 2>&1 > > if [ "$USEXFS" = 0 ]; then > XPID=`pidof X` > if [ -n "$XPID" ]; then > for n in $XPID; do > SERVER=`awk -F: '{print(substr($2,1,1))}' /proc/$n/cmdline` > [ -n "$SERVER" ] || continue > AUTH=`awk -F-auth '{print($2)}' /proc/$n/cmdline` > [ -r "$AUTH" ] || continue > export XAUTHORITY="$AUTH" > FP=`xset -display :"$SERVER" q | grep -q "$FONTPATH"; echo $?` > if [ "$FP" = 1 -o "$ADD" = 0 ]; then > xset -display :"$SERVER" "$XSET" "$FONTPATH" > /dev/null 2>&1 > fi > xdpyinfo -display :"$SERVER" | grep -q FontCache && > xset -display :"$SERVER" fp rehash > done > fi > fi Выглядит как набор кривых хаков :( [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-03-24 9:58 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-03-22 13:44 Valery V. Inozemtsev 2006-03-22 14:13 ` Michael Shigorin 2006-03-22 14:30 ` Valery V. Inozemtsev 2006-03-22 14:39 ` Michael Shigorin 2006-03-22 18:38 ` Valery V. Inozemtsev 2006-03-22 19:35 ` Dmitry V. Levin 2006-03-22 20:55 ` Michael Shigorin 2006-03-24 8:20 ` Valery V. Inozemtsev 2006-03-24 9:58 ` Sergey Vlasov [this message] 2006-03-24 10:35 ` Valery V. Inozemtsev 2006-03-24 11:20 ` Sergey Vlasov 2006-03-22 20:09 ` Vitaly Lipatov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20060324095829.GI32278@master.mivlgu.local \ --to=vsu@altlinux.ru \ --cc=devel@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git