From f70f8bff885d5b937964da26a20d4290e052f07f Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Thu, 4 Aug 2011 20:00:19 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=BC=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../portage-exclude-gen.sh | 31 ++++++++++++++++--- c/tex_parser/tex_parser.c | 1 - 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/bash/portage-exclude-gen/portage-exclude-gen.sh b/bash/portage-exclude-gen/portage-exclude-gen.sh index 7948904..a6bf590 100755 --- a/bash/portage-exclude-gen/portage-exclude-gen.sh +++ b/bash/portage-exclude-gen/portage-exclude-gen.sh @@ -1,14 +1,35 @@ #!/bin/bash +ninstalled=0 +installed= +for p in `qlist -IC | sort -d`; do + installed[ninstalled]=$p + let ninstalled++ +done + +idx=0 cd /usr/portage/ || exit -1 -for d in *-* virtual; do - if [[ `qlist -IC $d/ | wc -l` == 0 ]]; then - echo $d/ +dir_list=`ls -1 --color=never -d */ | sort -d` +for d in $dir_list ; do + if [[ `qlist -IC $d | wc -l` == 0 ]]; then + echo $d else - for pn in $d/*; do - if [[ `qlist -IC $pn | wc -l` == 0 ]]; then + pn_list=`ls -1 --color=never -d ${d}*/ | sort -d` + for pn in $pn_list; do + pn=${pn%/} + #echo PN=$pn + #echo INSTALLED[$idx]=${installed[$idx]} + + while [[ "`echo ${installed[$idx]} | sed 's~\-~\~~g'`" < "`echo $pn | sed 's~\-~\~~g'`" && $idx -lt $ninstalled ]]; do + let idx++ + done + + if [[ "$pn" == "${installed[$idx]}" ]]; then + let idx++ + else echo $pn/ fi done fi done + diff --git a/c/tex_parser/tex_parser.c b/c/tex_parser/tex_parser.c index 1f4df8a..3b0d102 100644 --- a/c/tex_parser/tex_parser.c +++ b/c/tex_parser/tex_parser.c @@ -203,7 +203,6 @@ void tex_parse(const char *source, size_t len, struct tex_struct_s **tex_struct, return; } - #ifdef __TEX_PARSER_DEBUG puts("<-OBJ_UNDEF"); puts("<-OBJ_UNDEF");