Simon Nivault <simon.nivault(a)lrde.epita.fr> writes:
> URL: https://svn.lrde.epita.fr/svn/lrde-tools/trunk
>
> ChangeLog:
> 2007-11-15 Simon Nivault <simon.nivault(a)lrde.epita.fr>
>
> Tool for checking guards of header files of a project.
>
> * README: Add description.
> * src/check-guards: New.
Cool!
> Index: trunk/src/check-guards
> ===================================================================
> --- trunk/src/check-guards (revision 0)
> +++ trunk/src/check-guards (revision 454)
> @@ -0,0 +1,39 @@
> +#!/bin/sh
> +
> +# Utility to check guards of header files.
> +# Usage : ./check-guards BASE SUB...
> +#
> +# - BASE : Specify the root of the project.
> +# For example, here an header file :
> +# /home/user/proj1/prj/module1/header.hh
> +# The path '/home/user/proj1/' should be used
> +# if the expected guard for this file is
> +# "PRJ_MODULE1_HEADER_HH".
> +# Warning! BASE must end with one '/'
> +#
> +# - SUB : Specify the element you want to verify.
> +# Those element can be either directories or files
> +# and are expected to be located in BASE.
> +#
> +############################################################
> +
> +base_dir=$1
> +shift
> +loc=$@
> +
> +for sub in $loc
In fact, you can just write
for sub
here, and get rid of `loc' (by default, for iterates on `$@' [1]).
> + do
> + for file in $(find ${base_dir}$sub -name '*.hh')
> + do
> + expr1=$(echo "${file##$base_dir}" | tr "[:lower:]" "[:upper:]" | tr "[:punct:]" "_")
It's still nice to use lines smaller than 80 columns (even in shell
scripts!). :)
> + expr2=$(cat $file | grep "#ifndef" | grep HH | cut -d ' ' -f 2)
> + expr3=$(cat $file | grep "# define" | grep HH | cut -d ' ' -f 3)
> + expr4=$(cat $file | grep "#endif" | grep HH | cut -d ' ' -f 4)
Instead of
cat file | cmd ...
you can just write
cmd <file ...
(it saves a fork).
> + if [ "$expr1" = "$expr2" -a "$expr1" = "$expr2" -a "$expr1" = "$expr2" ]; then
Likewise with the 80 columns.
Moreover, this lines looks weird. Didn't you want to write
if [ "$expr1" = "$expr2" -a \
"$expr1" = "$expr3" -a \
"$expr1" = "$expr4" ]; then
instead ?
> + res=OK
> + else
> + res="KO, should be $expr1"
> + fi
> + echo "${file##$base_dir} : $res"
> + done
> +done
> \ No newline at end of file
Text files shall end with a newline character.
> Index: trunk/README
> ===================================================================
> --- trunk/README (revision 453)
> +++ trunk/README (revision 454)
> @@ -139,6 +139,9 @@
> ** src/apatche
> Send patches to a mailing list.
>
> +** src/check-gards
> +Check recursivly all the guards of header files.
s/recursivly/recursively/
s/header/C and C++ header/
Thanks for this contribution! :)
Notes:
[1] See Bash's manual for instance:
for name [ in word ] ; do list ; done
The list of words following in is expanded, generating a list of
items. The variable name is set to each element of this list in
turn, and list is executed each time. If the in word is omit-
ted, the for command executes list once for each positional
parameter that is set (see PARAMETERS below). The return status
is the exit status of the last command that executes. If the
expansion of the items following in results in an empty list, no
commands are executed, and the return status is 0.
URL: https://svn.lrde.epita.fr/svn/lrde-tools/trunk
ChangeLog:
2007-11-15 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Tool for checking guards of header files of a project.
* README: Add description.
* src/check-guards: New.
---
README | 3 +++
src/check-guards | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
Index: trunk/src/check-guards
===================================================================
--- trunk/src/check-guards (revision 0)
+++ trunk/src/check-guards (revision 454)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Utility to check guards of header files.
+# Usage : ./check-guards BASE SUB...
+#
+# - BASE : Specify the root of the project.
+# For example, here an header file :
+# /home/user/proj1/prj/module1/header.hh
+# The path '/home/user/proj1/' should be used
+# if the expected guard for this file is
+# "PRJ_MODULE1_HEADER_HH".
+# Warning! BASE must end with one '/'
+#
+# - SUB : Specify the element you want to verify.
+# Those element can be either directories or files
+# and are expected to be located in BASE.
+#
+############################################################
+
+base_dir=$1
+shift
+loc=$@
+
+for sub in $loc
+ do
+ for file in $(find ${base_dir}$sub -name '*.hh')
+ do
+ expr1=$(echo "${file##$base_dir}" | tr "[:lower:]" "[:upper:]" | tr "[:punct:]" "_")
+ expr2=$(cat $file | grep "#ifndef" | grep HH | cut -d ' ' -f 2)
+ expr3=$(cat $file | grep "# define" | grep HH | cut -d ' ' -f 3)
+ expr4=$(cat $file | grep "#endif" | grep HH | cut -d ' ' -f 4)
+ if [ "$expr1" = "$expr2" -a "$expr1" = "$expr2" -a "$expr1" = "$expr2" ]; then
+ res=OK
+ else
+ res="KO, should be $expr1"
+ fi
+ echo "${file##$base_dir} : $res"
+ done
+done
\ No newline at end of file
Property changes on: trunk/src/check-guards
___________________________________________________________________
Name: svn:executable
+ *
Index: trunk/README
===================================================================
--- trunk/README (revision 453)
+++ trunk/README (revision 454)
@@ -139,6 +139,9 @@
** src/apatche
Send patches to a mailing list.
+** src/check-gards
+Check recursivly all the guards of header files.
+
** src/g2b
Change the compression system from Gzip to Bzip2.
>>> "RL" == Roland Levillain <roland(a)lrde.epita.fr> writes:
> https://svn.lrde.epita.fr/svn/lrde-tools/trunk
> This should ease the transition to PySyck 0.61 (which supports
> multiple YAML document in a single file/stream) for Mac OS X users.
> TC's generators should run fine with the programs installed by this script.
Youpi !
Merci !
https://svn.lrde.epita.fr/svn/lrde-tools/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
* README: Update paths and descriptions.
README | 147 +++++++++++++++++++++++++++++++++--------------------
ics2mail/weekly.sh | 5 +
2 files changed, 96 insertions(+), 56 deletions(-)
Index: README
--- README (revision 452)
+++ README (working copy)
@@ -1,136 +1,173 @@
--*- text -*-
+LRDE Tools -*- outline -*-
-* ChangeLog management
+The LRDE Tools provide a collection of utilities aimed at making the
+life of developers easier.
-** cl-date
+
+* ChangeLog Management
+** changelog/cl-count
+Report the number of ChangeLog entries per author.
+
+** changelog/cl-date
Change the date format in ChangeLogs.
-** cl-first
+** changelog/cl-first
Extract the first entry from ChangeLogs.
-** cl-merge
+** changelog/cl-merge
Merge several ChangeLogs into one, sorting the entry.
-** cl-prefix
+** changelog/cl-prefix
Prefix the files of a ChangeLog with a directory. Useful when moving
ChangeLogs.
-** cl-single-header
+** changelog/cl-single-header
Some people issue one ChangeLog header (date & author) per patch,
other simply issue an empty line between ChangeLog entries sharing the
same date & author. This program replaces subsequent equal headers in
ChangeLog by empty lines.
-** clcnt
-Report the number of ChangeLog entries per author.
+** src/cl2patch
+Prepare a patch for application: change the date for ChangeLog entries.
+* Diff utilities
+** src/diffed
+Manipulate patches in the diff format.
-* CVS Utilities
-** cvapply
+** src/diff-r
+Recursive diff between two files/tarballs.
+
+** src/xdiff
+A wrapper around "diff" that recognize files by their extension
+to provide heading for diff hunks. It is meant to completely
+replace "diff" (but slaving it).
+
+
+* Version Control Utilities
+
+** (Near-) Agnostic Version Control Utilities
+*** src/checkin
+An ancestor of Vcs and svn-wrapper.
+
+*** vcs/
+An extensibe Version Control System wrapper for Subversion, CVS, and
+other VCS, written in Ruby. As of now, Vcs mainly supports
+Subversion, and some CVS features.
+
+** CVS Utilities
+*** src/cvapply
Apply a batch of patches to a CVS repository.
-** cvsfiles
+*** src/cvsfiles
List CVS-controlled files in a tree.
-** cvsldup
+*** src/cvsldup
Duplicate a CVS tree locally.
-** cvssnap
+*** src/cvssnap
Build a tarball with all CVS-controlled files.
+** PRCS Utilities
+*** prcs/
+Miscellaneous scripts for PRCS. See prcs/README for more details.
-* PRCS Utilities
-** prcommit
-As clcommit: commit a version of a PRCS controlled project, adjusting
-the New-Version-Log from the ChangeLog.
-
-** prcs-back
+*** src/prcs-back
Run backwards in the history of the project until a property is met.
Useful to find origin of bugs.
-** prcs-checkout
+*** src/prcs-checkout
Make sure that when a file is checked out, its time stamp is updated,
so that "make" does its job.
-** prcs-diff-cb
+*** src/prcs-commit
+As clcommit: commit a version of a PRCS controlled project, adjusting
+the New-Version-Log from the ChangeLog.
+
+*** src/prcs-diff-cb
A call back for prcs diff that can use this information to provide
information in various forms.
-** prcs-list-nonignored
+*** src/prcs-list-nonignored
Simple list of files not in the repository, and not ignored. Useful
to check for files to add to the repository.
-** prcs2cl
+*** src/prcs2cl
Wrap a proto ChangeLog entry based on prcs diff.
-** Prcs2svn
+*** prcs2svn/
Export an archive from PRCS to Subversion.
-** prcsin
+*** src/prcsin
Put a tarball under PRCS.
-** prdiff
+*** src/prdiff
Make clean diff between revision of a PRCS controlled project.
-
** Subversion Utilities
-** svn-populate
-Subversion adaptation of prcs populate command.
-
-** svn-ignore
+*** src/svn-ignore
Quickly add ignore entries in subversion. Automatically determine the
concerned directory.
-** svndiff
+*** src/svn-populate
+Subversion adaptation of prcs populate command.
+
+*** src/svndiff
A better svn diff.
-* Miscellaneous utilities
-** apatche
-Send patches to a mailing list.
-** cl2patch
-Prepare a patch for application: change the date for ChangeLog entries.
+* Automated Builds
+** buildfarm/
+The (old) LRDE build farm, based on Samba's.
+
+** buildbot/
+Helper scripts for a BuiltBot-based build farm.
-** diffed
-Manipulate patches in the diff format.
-** g2b
+* Time Management and Calendars
+** ics2mail/weekly.sh
+Compute the number of work/busy hours from an ICS calendar hosted on a
+Web server.
+
+
+* Miscellaneous utilities
+** metaInternshipSite/
+A generator for the mandatory Internship Web site EPITA (Ing) students are
+expected to deliver at the end of their first internship (at the
+beginning of ``Ing 2'').
+
+** src/apatche
+Send patches to a mailing list.
+
+** src/g2b
Change the compression system from Gzip to Bzip2.
-** insist
+** src/insist
Repeatedly do something until it succeeds.
-** install-on
+** src/install-on
Remotely install a package on a machine.
** src/install-pysyck
Install PySyck from http://pyyaml.org. Useful under Mac OS X, whose
MacPorts do not contain PySyck.
-** rdiff
-Recursive diff between two files/tarballs.
-
-** symbuild
+** src/symbuild
Easy navigation between source and build trees
-** tarr
+** src/tarr
Quickly make tarballs.
-** timeout
+** src/timeout
Run a command and killing it if it is too slow.
-** whitespace
+** src/whitespace
Normalize whitespace uses in files.
-** xdiff
-A wrapper around "diff" that recognize files by their extension
-to provide heading for diff hunks. It is meant to completely
-replace "diff" (but slaving it).
--
-Copyright (C) 2003 LRDE
+Copyright (C) 2003, 2007 LRDE
This file is part of LrdeTools. This program is free software; you can
redistribute it and/or modify it under the terms of the GNU General
Index: ics2mail/weekly.sh
--- ics2mail/weekly.sh (revision 452)
+++ ics2mail/weekly.sh (working copy)
@@ -75,6 +75,9 @@
}
}
' "$cal" | sed 's/é/�/g'
-# if anyone can convert UTF8 to ascii automatically ... I didn't manage to.
+# FIXME: if anyone can convert UTF8 to ascii automatically ... I
+# didn't managed to.
+#
+# 2007-11-13: Use recode! -- Roland.
rm "$cal"
Benoit Sigoure <tsuna(a)lrde.epita.fr> writes:
> URL: https://svn.lrde.epita.fr/svn/lrde-tools/trunk/buildbot
> Git branch: master (HEAD: c78d1f6)
>
> ChangeLog:
> 2007-11-12 Benoit Sigoure <tsuna(a)lrde.epita.fr>
>
> Adjust the default URLs.
> * masters/template_gnu_master.cfg,
> * masters/template_qt_master.cfg: Adjust the default values for
> projectURL / buildbotURL.
Thanks! Do you plan on merging these ``BuildBot Tools'' with
Gostai's? Or perhaps this is already the case?
(Sorry, I don't remember exactly -- I think you said you wanted to
push these tools to the BuildBot Project itself, right?).
URL: https://svn.lrde.epita.fr/svn/lrde-tools/trunk/buildbot
Git branch: master (HEAD: c78d1f6)
ChangeLog:
2007-11-12 Benoit Sigoure <tsuna(a)lrde.epita.fr>
Adjust the default URLs.
* masters/template_gnu_master.cfg,
* masters/template_qt_master.cfg: Adjust the default values for
projectURL / buildbotURL.
---
masters/ChangeLog | 7 +++++++
masters/template_gnu_master.cfg | 4 ++--
masters/template_qt_master.cfg | 4 ++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/masters/ChangeLog b/masters/ChangeLog
index e7e0809..daf1ffd 100644
--- a/masters/ChangeLog
+++ b/masters/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-12 Benoit Sigoure <tsuna(a)lrde.epita.fr>
+
+ Adjust the default URLs.
+ * masters/template_gnu_master.cfg,
+ * masters/template_qt_master.cfg: Adjust the default values for
+ projectURL / buildbotURL.
+
2007-11-09 Benoit Sigoure <tsuna(a)lrde.epita.fr>
Remove an unused ctor argument.
diff --git a/masters/template_gnu_master.cfg b/masters/template_gnu_master.cfg
index e5edc33..d34c082 100644
--- a/masters/template_gnu_master.cfg
+++ b/masters/template_gnu_master.cfg
@@ -9,7 +9,7 @@ c = BuildmasterConfig = {}
# http://buildbot.sourceforge.net/manual-0.7.4.html#Defining-the-Project
c['projectName'] = '<PROJECT_NAME>'
-c['projectURL'] = 'https://core.gostai.com/projects/<REPOS_NAME>/'
+c['projectURL'] = 'https://<REPOS_NAME>.lrde.org/'
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.Waterfall page) is visible. This
@@ -17,7 +17,7 @@ c['projectURL'] = 'https://core.gostai.com/projects/<REPOS_NAME>/'
# with an externally-visible host name which the buildbot cannot figure out
# without some help.
-c['buildbotURL'] = 'https://core.gostai.com/buildfarm/<BB_DIR_NAME>/'
+c['buildbotURL'] = 'https://build.lrde.org/buildfarm/<BB_DIR_NAME>/'
# 'slavePortnum' defines the TCP port to listen on. This must match the value
# configured into the buildslaves (with their --master option)
diff --git a/masters/template_qt_master.cfg b/masters/template_qt_master.cfg
index eb997cf..ecf7788 100644
--- a/masters/template_qt_master.cfg
+++ b/masters/template_qt_master.cfg
@@ -9,7 +9,7 @@ c = BuildmasterConfig = {}
# http://buildbot.sourceforge.net/manual-0.7.4.html#Defining-the-Project
c['projectName'] = '<PROJECT_NAME>'
-c['projectURL'] = 'https://core.gostai.com/projects/<REPOS_NAME>/'
+c['projectURL'] = 'https://<REPOS_NAME>.lrde.org/'
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.Waterfall page) is visible. This
@@ -17,7 +17,7 @@ c['projectURL'] = 'https://core.gostai.com/projects/<REPOS_NAME>/'
# with an externally-visible host name which the buildbot cannot figure out
# without some help.
-c['buildbotURL'] = 'https://core.gostai.com/buildfarm/<BB_DIR_NAME>/'
+c['buildbotURL'] = 'https://build.lrde.org/buildfarm/<BB_DIR_NAME>/'
# 'slavePortnum' defines the TCP port to listen on. This must match the value
# configured into the buildslaves (with their --master option)
--
SIGOURE Benoit aka Tsuna (SUSv3 compliant)
_____ "I think Git is definitely in the running
/EPITA\ Promo 2008.CSI/ACU/YAKA to be the dominate version control system."
-- Bob Proulx