WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Convert dep files to recursive  (Read 3293 times)

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Convert dep files to recursive
« on: December 07, 2011, 08: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


« Last Edit: December 07, 2011, 08:58:35 PM by Jason W »

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Convert dep files to recursive
« Reply #1 on: December 08, 2011, 06: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?

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Convert dep files to recursive
« Reply #2 on: December 08, 2011, 06:26:03 AM »
Simply removed redundant entries in dep files making them recursive, for extension makers.

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Convert dep files to recursive
« Reply #3 on: December 08, 2011, 06:58:58 AM »
Uh, ah! OK  :D

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Convert dep files to recursive
« Reply #4 on: February 04, 2012, 05: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

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Convert dep files to recursive
« Reply #5 on: February 12, 2012, 03:06:43 PM »
I personally like this one kept separate, as submitqc4 already takes so long, but I will consider it.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11675
Re: Convert dep files to recursive
« Reply #6 on: February 12, 2012, 03: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.

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Convert dep files to recursive
« Reply #7 on: February 12, 2012, 05:04:32 PM »
Thanks jason, without tcsubmit I'd be lost!