WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: extension audit script  (Read 150567 times)

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: extension audit script
« Reply #30 on: March 07, 2010, 05:03:55 AM »
I copied and pasted it and it works fine here.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: extension audit script
« Reply #31 on: April 02, 2010, 09:26:37 AM »
recopied and repasted but:
Code: [Select]
/home/tc/.local/bin/tce-check: line 82: syntax error: unexpected "then" (expecting "done"can u publish this script also as an attachment of the post?
Thanx
dCore user

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: extension audit script
« Reply #32 on: April 02, 2010, 09:29:26 AM »
wheneve u modify this script and also the others, plz add another post saying that u modified it
dCore user

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: extension audit script
« Reply #33 on: April 02, 2010, 09:32:14 AM »
indentation is not perfect: look at line 80
dCore user

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: extension audit script
« Reply #34 on: April 02, 2010, 06:34:29 PM »
Attachment made.  I have made some portability changes.  At one time I was bugfixing quite a bit and didn't want to announce every little change.  But since the script is pretty much completed, I will announce any new features or feature removal.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: extension audit script
« Reply #35 on: April 03, 2010, 05:12:54 AM »
Code: [Select]
tc-ita.tcz is a corrupt tcz file, please remake.
The following errors are found in tc-ita.tcz.info. No news is good news:

changing the line
Code: [Select]
TMP2=`mktemp -d tmp.XXXXX`like this:
Code: [Select]
TMP2=`mktemp -d`it works
dCore user

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: extension audit script
« Reply #36 on: April 03, 2010, 09:02:21 AM »
There should probably be six X's instead of five.
The only barriers that can stop you are the ones you create yourself.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: extension audit script
« Reply #37 on: April 03, 2010, 10:58:10 AM »
`mktemp -d` makes 10 characters, changed to mktemp -d.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: extension audit script
« Reply #38 on: April 03, 2010, 12:33:59 PM »
`mktemp -d` was causing problems with me, so using manual directory creation, along with other bug fixes.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: extension audit script
« Reply #39 on: April 03, 2010, 12:58:44 PM »
u could post your script also in the wiki
dCore user

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: extension audit script
« Reply #40 on: April 03, 2010, 07:32:56 PM »
Scripts should not be posted in the wiki - a link back to the thread should be the way to go.

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: extension audit script
« Reply #41 on: May 04, 2010, 01:42:53 PM »
If Bash isn't installed then there is an error so the Bash check is useless. Try this:
Code: [Select]
#!/bin/sh

if [ ! `which bash` ]; then
echo "Install bash."
exit 1
fi

bash

RED=`echo -e '\e[1;31m'`
YELLOW=`echo -e '\e[1;33m'`
WHITE=`echo -e '\e[00m'`
GREEN=`echo -e '\e[0;32m'`

if [ ! `which file` ]; then
echo "Install the file extension."
exit 1
fi

if [ ! `which mksquashfs` ]; then
echo "Install the squashfs-tools extension."
exit 1
fi

And the info file check can be changed to:
Code: [Select]
for I in `ls *.info`; do

INFOERR=""

echo "Checking for errors in "$I"..."
[ -z `awk '/Title:/ { print $2 }' "$I"` ] && INFOERR=`echo -e "\tTitle: field is not valid in "$I"."\n`
[ -z `awk '/Description:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tDescription: field is not valid in "$I"."\n`
[ -z `awk '/Version:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tVersion: field is not valid in "$I"."\n`
[ -z `awk '/Author:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tAuthor: field is not valid in "$I"."\n`
[ -z `awk '/Original-site:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tOriginal-site: field is not valid in "$I"."\n`
[ -z `awk '/Copying-policy:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tCopying-policy: field is not valid in "$I"."\n`
[ -z `awk '/Size:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tSize: field is not valid in "$I"."\n`
[ -z `awk '/Extension_by:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tExtension_by: field is not valid in "$I"."\n`
[ -z `awk '/Comments:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tComments: field is not valid in "$I"."\n`
[ -z `awk '/Change-log:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tChange-log: field is not valid in "$I"."\n`
[ -z `awk '/Current:/ { print $2 }' "$I"` ] && INFOERR=$INFOERR`echo -e "\tCurrent: field is not valid in "$I"."\n`
file "$I" | grep "CRLF" && dos2unix -u "$I" && INFOERR=$INFOERR`echo -e "\t${YELLOW}Fixed CRLF line terminators in "$I".  Please don't use Windows apps to edit Linux files.${WHITE}"\n`

if [ -n $INFOERR ]; then
echo "${RED}$INFOERR"
else
echo -e "\bNo Errors found."
fi

sleep 1
done
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: extension audit script
« Reply #42 on: May 04, 2010, 01:54:52 PM »
Thanks, I will add that in soon.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: extension audit script
« Reply #43 on: June 16, 2010, 12:13:28 PM »
Dropped bash requirement, added robc's suggestion and also added the listing of .list file differences from the extension being audited and the one in the repo to draw attention to list file content differences when updating existing extensions.  Particular attention in list file diffs is those of /usr/local/lib/lib.so.X number differences that often result in breakage of dependent apps when the extension being updated is a library one.  This just raises a yellow flag on file content differences for the submitter to determine the relevance. 

A version for 2.x and 3.x are attached to original post.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: extension audit script
« Reply #44 on: June 16, 2010, 06:41:50 PM »
robc-

I undid your info changes as I saw errors and don't have time to troubleshoot.  If you would confirm it working or bugfix it I would be glad to include it in.