This forum has been archived. All content is frozen. Please use KDE Discuss instead.
The Discussions and Opinions forum is a place for open discussion regarding everything related to KDE, within the boundaries of KDE Code of Conduct. If you have a question or need a solution for a KDE problem, please post in the apppropriate forum instead.

Number of lines of whole KDE repo

Tags: None
(comma "," separated)
User avatar
maattd
Registered Member
Posts
10
Karma
0

Number of lines of whole KDE repo

Mon Oct 20, 2008 12:31 pm
Hi,
Just a simple question :
Does anyone how many lines does the entiere KDE *trunk* repos (KDE + Extragear + Review + Koffice ..) contains ?

Last edited by maattd on Mon Oct 20, 2008 12:43 pm, edited 1 time in total.


maattd, proud to be a member of KDE forums since 2008-Oct.
User avatar
Githzerai
Registered Member
Posts
54
Karma
0
OS
Lines, as in lines of code?


Stercus accidit
User avatar
maattd
Registered Member
Posts
10
Karma
0
Githzerai wrote:Lines, as in lines of code?


Yes :-)


maattd, proud to be a member of KDE forums since 2008-Oct.
User avatar
GeneralZod
KDE Developer
Posts
77
Karma
1
OS
http://www.ohloh.net/projects/kde

is a good resource. The "enlistments" link, I think, gives a breakdown of what areas of SVN it's counting.


ssj-gz.blogspot.com: KDE4Daily, Konqueror4 Restoration
User avatar
maattd
Registered Member
Posts
10
Karma
0
I'm making a little script with some grep -c to count lines :D
If someone have the trunk/KDe on is computer, he may would try it (but i don't know anything about performance of the script :D i really really don't :d)


maattd, proud to be a member of KDE forums since 2008-Oct.
User avatar
maattd
Registered Member
Posts
10
Karma
0
If someone have the whole repos (at least kdebase) on his computer, can he run this script plz :)
(i know .. 4 month for a 20 lines shell script :D )
Code: Select all
#! /bin/sh

if [ $# -gt 1 ]
then
   echo "Usage : $0 [nom_rep]" >&2
   exit 1
fi
if [ $# -eq 0 ]
then
   set "."
fi
nboctets=0
for fich in "$1"
do
   if [ -f "$fich" ]
   then
      if [ ! -r "$fich" ]
      then
         echo "$fich : Fichier non accessible en lecture" >&2
      else
         taille=`cat "$fich" | wc -l | tr -d ' '`
         nboctets=`expr $nboctets + $taille`
      fi
   elif [ -d "$fich" ]
   then
      if [ ! -r "$fich" -o ! -x "$fich" ]
      then
         echo "$fich : Repertoire non accessible en lecture et execution" >&2
      else
         taille=`$0 "$fich"`
         nboctets=`expr $nboctets + $taille`
      fi
   fi
done
echo $nboctets
exit 0

Last edited by maattd on Fri Feb 13, 2009 11:42 pm, edited 1 time in total.


maattd, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

RE: Number of lines of whole KDE repo

Sat Feb 14, 2009 12:38 am
The script does not work: expr: syntax error
in addition does it check the current directory, or the directory the script is in?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
maattd
Registered Member
Posts
10
Karma
0
You have to give a directory in parameter ( Usage : sh name_of_the_script.sh /My/directory/ )

Can you try this version, i correct a little mistake. Thanks :-)
Code: Select all
#! /bin/sh

if [ $# -gt 1 ]
then
   echo "Usage : $0 [nom_rep]" >&2
   exit 1
fi
if [ $# -eq 0 ]
then
   set "."
fi
nboctets=0
for fich in "$1"/*
do
   if [ -f "$fich" ]
   then
      if [ ! -r "$fich" ]
      then
         echo "$fich : Fichier non accessible en lecture" >&2
      else
         taille=`cat "$fich" | wc -l | tr -d ' '`
         nboctets=`expr $nboctets + $taille`
      fi
   elif [ -d "$fich" ]
   then
      if [ ! -r "$fich" -o ! -x "$fich" ]
      then
         echo "$fich : Repertoire non accessible en lecture et execution" >&2
      else
         taille=`$0 "$fich"`
         nboctets=`expr $nboctets + $taille`
      fi
   fi
done
echo "Total numer of lines : $nboctets"
exit 0


maattd, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
I think something must be wrong still. Apparently kdelibs has only 147 lines of code. I still recieved stacks of these errors:

expr: non-numeric argument
expr: syntax error

"expr" version:
Code: Select all
expr (GNU coreutils) 6.12
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Parker.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
maattd
Registered Member
Posts
10
Karma
0
I don't have expr error in my computer.
And the lines are basics ( nboctets=`expr $nboctets + $taille` ) i can't understand why it doesn't work.

Well here is a script really light, without all the test and without expr :D Can you try this one plz ? (but i have no idea about the perf)

For the script to work, do not have binary file in the directory ( .o or executable), just the sources.

Code: Select all
#! /bin/sh

if [ $# -gt 1 ]
then
   echo "Usage : $0 [nom_rep]" >&2
   exit 1
fi
if [ $# -eq 0 ]
then
   echo " You have to enter a parameter, i suppose you want to use current directory so.."
   set "."
fi
nboctets=$(find $1 -type f -exec cat {} ; | wc -l)
echo "Total number of lines = $nboctets"
exit 0

Last edited by maattd on Sat Feb 14, 2009 10:03 am, edited 1 time in total.


maattd, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

RE: Number of lines of whole KDE repo

Sat Feb 14, 2009 11:18 am
That worked. KDE Libs contains 3347812 lines. However, that figure will be skewed if the script takes into account hidden ( .* ) directories, since my copy was checked out of svn.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
maattd
Registered Member
Posts
10
Karma
0

RE: Number of lines of whole KDE repo

Sat Feb 14, 2009 12:15 pm
Yea this script counts ALL the files in the directory/subdirectory.

So now we have the script can you please, do it for :

trunk/KDE/kdebase
trunk/KDE
trunk/extragear
trunk/koffice

and maybe trunk/ but i doubt someone have the whole trunk repo sync in his computer :D

Thanks a lot. (and kudos for the forum)


maattd, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Unfortunately I only have sections of Trunk, but these are the figures for the modules I have:
I only get subsections of the extragear & playground modules, so my counts of those are useless.

kdebase: 3775223
kdeedu: 4080073
kdegames: 2047614
kdegraphics: 650468
kdemultimedia: 277919
kdenetwork: 1708141
kdepim: 2782210
kdepimlibs: 761965
kdeplasma-addons: 202193
kdesdk:1360238
kdesupport: 2784267
kdeutils: 478537
kdevelop: 408324
kdevplatform: 368204
koffice: 6224186


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
maattd
Registered Member
Posts
10
Karma
0
bcooksley wrote:Unfortunately I only have sections of Trunk, but these are the figures for the modules I have:
I only get subsections of the extragear & playground modules, so my counts of those are useless.

kdebase: 3775223
kdeedu: 4080073
kdegames: 2047614
kdegraphics: 650468
kdemultimedia: 277919
kdenetwork: 1708141
kdepim: 2782210
kdepimlibs: 761965
kdeplasma-addons: 202193
kdesdk:1360238
kdesupport: 2784267
kdeutils: 478537
kdevelop: 408324
kdevplatform: 368204
koffice: 6224186


Thanks a lot cookley. :)
This is more lines than i was guessing oO


maattd, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
If it includes .svn directories then halve those figures at least.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]