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");