Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master guru-tools by Bor Kraljič (854577eaa504f0929034adcec17784fd333c357d)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Bor Kraljič <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master guru-tools by Bor Kraljič (854577eaa504f0929034adcec17784fd333c357d)
  • Date: Thu, 22 Sep 2011 13:22:17 -0500

GIT changes to master guru-tools by Bor Kraljič <pyrobor AT ver.si>:

checkGrimoire.sh | 4 ++--
findLibDepends.sh | 10 +++++++++-
findSharedFiles | 38 +++++++++++++++++++++++---------------
3 files changed, 34 insertions(+), 18 deletions(-)

New commits:
commit 854577eaa504f0929034adcec17784fd333c357d
Author: Bor Kraljič <pyrobor AT ver.si>
Commit: Bor Kraljič <pyrobor AT ver.si>

findLibDepends.sh: ignore symlinks that are from glibc

Symlinks from glibc are special and are not in install log.

commit c6f22211d82550a5cb94d6e352afc44a4c1cfd61
Author: Bor Kraljič <pyrobor AT ver.si>
Commit: Bor Kraljič <pyrobor AT ver.si>

findSharedFiles: added option for compact output.

That is only about 10 lines of code.

Everything else is only whitespaces changes. Check git diff -b.

commit d6cec193963610f46ba03d3f760d15a41798b8e4
Author: Bor Kraljič <pyrobor AT ver.si>
Commit: Bor Kraljič <pyrobor AT ver.si>

checkGrimoire.sh: fixed find params to avoid warnings

diff --git a/checkGrimoire.sh b/checkGrimoire.sh
index f3bbd14..81e33da 100755
--- a/checkGrimoire.sh
+++ b/checkGrimoire.sh
@@ -84,12 +84,12 @@ do_args $*
shift $?

if [ $# -eq 0 ] ; then
- SPELLS=`find ${GRIMOIRE} -follow -type d -mindepth 2 -maxdepth 2
-printf "%f\n"`
+ SPELLS=`find ${GRIMOIRE} -follow -mindepth 2 -maxdepth 2 -type d
-printf "%f\n"`
else
SPELLS=""
# must get spells only in section directory
pushd ${GRIMOIRE}
- SPELLS=`find $* -follow -type d -mindepth 1 -maxdepth 1 -printf
"%f\n"`
+ SPELLS=`find $* -follow -mindepth 1 -maxdepth 1 -type d -printf
"%f\n"`
popd
fi

diff --git a/findLibDepends.sh b/findLibDepends.sh
index 9176f56..e0d24db 100755
--- a/findLibDepends.sh
+++ b/findLibDepends.sh
@@ -32,7 +32,15 @@ function CheckELF()
local ret=0

for lib in $libDeps ; do
- [[ $lib == /lib/ld-linux.so.2 ]] && continue
+ # glibc links are special. so lets readlink for those.
+ if [[ -L $lib ]] && gaze from $(readlink -f $lib) |grep -iq glibc ; then
+ lib=$(readlink -f $lib)
+ fi
+ # files that have lib/../ are not in install logs
+ if echo $lib |grep -iq ".." ; then
+ lib=$(readlink -f $lib)
+ fi
+ # this sed will fail if version have "-" in it...
provider=$(gaze from $lib | sed -n
'1,1s/^\([^:]*\)-\([^-:]*\)\?:.*$/\1/p')
if ! [[ $provider ]] ; then
echo -e "$1 needs $lib. \n\tNot provided by anyone!"
diff --git a/findSharedFiles b/findSharedFiles
index 54e79db..e4e5922 100755
--- a/findSharedFiles
+++ b/findSharedFiles
@@ -75,8 +75,9 @@ function usage() {
Usage : findSharedFiles.sh [OPTION]
Create a list of installed files that are shared between different spells.

- -h, --help print this help page
- -n, --nice print a nice header before each shared file
+ -h, --help print this help page
+ -n, --nice print a nice header before each shared file
+ -c, --compact print all spells for one file in same lines

The output is lines on the form:

@@ -104,8 +105,9 @@ parseArguments() {

case $1 in
-h|--help) usage; exit;;
- -n|--nice) NICE="y"; let numShift++; shift 1;;
- *) return $numShift;;
+ -n|--nice) NICE="y"; let numShift++; shift 1;;
+ -c|--compact) COMPACT="y"; let numShift++; shift 1;;
+ *) return $numShift;;
esac

done
@@ -151,21 +153,27 @@ removeDuplicates() {
# Print the lines with shared files to STDOUT
printSharedFiles() {

- # read duplicates into an array
- noDuplicatesFile=( $(cat "$noDuplicatesFile" | tr '\n' ' ') )
+ # read duplicates into an array
+ noDuplicatesFile=( $(cat "$noDuplicatesFile" | tr '\n' ' ') )

- # loop through the array
- for line in ${noDuplicatesFile[@]}; do
+ # loop through the array
+ for line in ${noDuplicatesFile[@]}; do

- # skip this line if it is a directory
- [[ -d $line ]] && continue
+ # skip this line if it is a directory
+ [[ -d $line ]] && continue

- # print the spell names which installs this file
- [ -n "$NICE" -a "$NICE"="y" ] && \
- echo -e "${BOLD}Shared file: ${FILE_COLOR}$line${DEFAULT_COLOR}";
- grep "^$line:" $installedFiles
+ # print the spell names which installs this file
+ if [[ -n "$NICE" ]] && [[ "$NICE" == "y" ]]; then
+ echo -e "${BOLD}Shared file: ${FILE_COLOR}$line${DEFAULT_COLOR}"
+ fi

- done
+ if [[ $COMPACT == y ]]; then
+ echo "$line: $(grep "^$line:" $installedFiles |cut -d: -f2 |tr \\n '
')"
+ else
+ grep "^$line:" $installedFiles
+ fi
+
+ done

}




  • [SM-Commit] GIT changes to master guru-tools by Bor Kraljič (854577eaa504f0929034adcec17784fd333c357d), Bor Kraljič, 09/22/2011

Archive powered by MHonArc 2.6.24.

Top of Page