Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: Jason W on December 07, 2011, 05:03:53 PM

Title: Convert dep files to recursive
Post by: Jason W on December 07, 2011, 05:03:53 PM
Here is a tool that can be run in the current directory of .dep files and convert them to recursive based on the current state of the repo.  Running it on my own as well as other's dep files brought to light a bit of redundancy. 

Code: [Select]
#!/bin/sh

HERE=`pwd`
TREEDIR=/tmp/trees
KERN=`uname -r`
[ -d "$TREEDIR" ] && rm -r "$TREEDIR"
mkdir -p "$TREEDIR"/old


cd "$TREEDIR"
for I in `ls "$HERE"/*.dep`; do
EXT=`basename "$I" .dep`



sed -i "/$EXT/d" "$I"

if ls -A *.tree > /dev/null 2>&1; then
 mv -f *.tree old/
fi
  for E in `cat "$I"`; do
      E=`echo "$E" | sed "s:KERNEL:$KERN:"`
    if [ -f old/"$E".tree ]; then
      cp old/"$E".tree .
    else   
      wget -q http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/"$E".tree
    fi
  done

if ls -A *.tree >/dev/null; then
 for B in `ls *.tree`; do
   EXT=`basename "$B" .tree`
   grep "^$EXT" "$B" >/dev/null && sed -i "/^$EXT/d" "$B"
 done
fi

    for F in `cat "$I"`; do
E=`echo "$F" | sed "s:KERNEL:$KERN:"`
  grep "[[:blank:]]$E$" "$TREEDIR"/*.tree >/dev/null && sed -i "/$F/d" "$I"
    done

done


Title: Re: Convert dep files to recursive
Post by: vinnie on December 08, 2011, 03:01:10 AM
Could you explain to me better what is it? serves to update .dep files without using appsaudit (and thus from any other distro), or is it something else?
Title: Re: Convert dep files to recursive
Post by: Jason W on December 08, 2011, 03:26:03 AM
Simply removed redundant entries in dep files making them recursive, for extension makers.
Title: Re: Convert dep files to recursive
Post by: vinnie on December 08, 2011, 03:58:58 AM
Uh, ah! OK  :D
Title: Re: Convert dep files to recursive
Post by: vinnie on February 04, 2012, 02:29:46 PM
ehy jason, I dusted off this script for a moment, why not include it in the work of submitqc4 if there is a .dep to check the directory?
is very useful, no longer have to manually check  if .dep is recursive
Title: Re: Convert dep files to recursive
Post by: Jason W on February 12, 2012, 12:06:43 PM
I personally like this one kept separate, as submitqc4 already takes so long, but I will consider it.
Title: Re: Convert dep files to recursive
Post by: Rich on February 12, 2012, 12:37:21 PM
Hi Jason W
I agree, keeping it as a separate tool to be used as an aid for creating dependency files makes sense. Adding the
script to the submitqc  extension might not be a bad idea. You could echo a message at the end of submitqc
asking the builder "Did you remember to run makerecursive?" as a reminder. The same holds true for your
genlddoutput script.
Title: Re: Convert dep files to recursive
Post by: vinnie on February 12, 2012, 02:04:32 PM
Thanks jason, without tcsubmit I'd be lost!