[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[14389] trunk
From:       jervfors () users ! sourceforge ! net
Date:       2013-07-28 23:33:13
Message-ID: E1V3aSi-0000yt-NB () sfs-ml-2 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 14389
          http://sourceforge.net/p/squirrelmail/code/14389
Author:   jervfors
Date:     2013-07-28 23:33:12 +0000 (Sun, 28 Jul 2013)
Log Message:
-----------
Move the copyright update script to a file of its own

Modified Paths:
--------------
    trunk/documentation/devel/devel.sgml

Added Paths:
-----------
    trunk/util/update-copyright

Modified: trunk/documentation/devel/devel.sgml
===================================================================
--- trunk/documentation/devel/devel.sgml	2013-07-28 23:32:49 UTC (rev 14388)
+++ trunk/documentation/devel/devel.sgml	2013-07-28 23:33:12 UTC (rev 14389)
@@ -3307,100 +3307,10 @@
 Also, make sure to update the <tt>define</tt> statement in
 <tt>trunk/squirrelmail/include/constants.php</tt> around line 28 that defines
 <tt>SM_COPYRIGHT</tt>.
-<p>Below is an example bash script that can be used to update all of the paths
-that are listed above (you have to run it against each one).  
-<tscreen><verb>
-#!/bin/bash
-#
-# This script updates the copyright notices in SquirrelMail.
-#
-# Copyright 2010-2013 The SquirrelMail Project Team
-# License   http://opensource.org/licenses/gpl-license.php GNU Public License
-# Version   $Id$
-#
+<p>A script that can be used to update any of the paths that are listed above
+(you have to run it against each one) is stored in
+<tt>svnroot/squirrelmail/trunk/util/update-copyright</tt>.
 
-update_copyrights()
-{
-
-   if [[ -z $1 ]] || [[ ! -d $1 ]]; then
-      echo
-      echo "Error: update_copyrights() expects valid directory, got $1"
-      echo
-      exit 1;
-   fi
-
-   cd $1
-
-   for file in `ls`; do
-
-      # recurse directories
-      #
-      if [[ -d $file ]]; then
-         echo "Traversing $PWD/$file"
-         update_copyrights $file
-         cd ..
-
-      # we have a file, but what kind?
-      #
-      else
-
-         # skip binary compiled translations, help files, image files, etc
-         #
-         if [[ $file =~ '(\.mo)|(\.hlp)|(\.png)|(\.gif)|(\.jpg)$' ]]; then
-
-            echo "   Skipping $file"
-
-
-         # restrict the search/replace to top 10 lines of translation files
-         #
-         elif [[ $file =~ '\.po$' ]]; then
-
-            echo "   Updating $file (only in first 10 lines)"
-
-            # this line can be used to update copyrights
-            # explicitly from just last year to this year
-            #
-            #`sed -i "1,10 s/\(copyright .*\)-$last_year\( The \
                SquirrelMail\)/\1-$this_year\2/i" $file`
-
-            `sed -i "1,10 s/\(copyright .*\)-2[0-9][0-9][0-9]\( The \
                SquirrelMail\)/\1-$this_year\2/i" $file`
-
-
-         # all other files
-         #
-         else
-
-            echo "   Updating $file"
-
-            # this line can be used to update copyrights
-            # explicitly from just last year to this year
-            #
-            #`sed -i "s/\(copyright .*\)-$last_year\( The \
                SquirrelMail\)/\1-$this_year\2/i" $file`
-
-            `sed -i "s/\(copyright .*\)-2[0-9][0-9][0-9]\( The \
                SquirrelMail\)/\1-$this_year\2/i" $file`
-         fi
-      fi
-
-   done
-
-}
-
-if [[ -z $1 ]] || [[ ! -d $1 ]]; then
-   echo
-   echo "Usage: $0 [directory]"
-else
-   this_year=`date +%Y`
-   last_year=$((this_year - 1))
-   echo
-   echo "Updating Copyrights from $last_year to $this_year"
-   echo
-   update_copyrights $1
-fi
-
-echo
-echo "Done"
-echo
-</verb></tscreen>
-
 <sect>Miscellaneous
 <p>
 TODO: This is a quick and dirty import of the documents in "/doc/Development". They \
all need to be cleand up and in the LinuxDoc format.

Added: trunk/util/update-copyright
===================================================================
--- trunk/util/update-copyright	                        (rev 0)
+++ trunk/util/update-copyright	2013-07-28 23:33:12 UTC (rev 14389)
@@ -0,0 +1,89 @@
+#!/bin/bash
+#
+# This script updates the copyright notices in SquirrelMail.
+#
+# Copyright 2010-2013 The SquirrelMail Project Team
+# License   http://opensource.org/licenses/gpl-license.php GNU Public License
+# Version   $Id$
+#
+
+update_copyrights()
+{
+
+   if [[ -z $1 ]] || [[ ! -d $1 ]]; then
+      echo
+      echo "Error: update_copyrights() expects valid directory, got $1"
+      echo
+      exit 1;
+   fi
+
+   cd $1
+
+   for file in `ls`; do
+
+      # recurse directories
+      #
+      if [[ -d $file ]]; then
+         echo "Traversing $PWD/$file"
+         update_copyrights $file
+         cd ..
+
+      # we have a file, but what kind?
+      #
+      else
+
+         # skip binary compiled translations, help files, image files, etc
+         #
+         if [[ $file =~ '(\.mo)|(\.hlp)|(\.png)|(\.gif)|(\.jpg)$' ]]; then
+
+            echo "   Skipping $file"
+
+
+         # restrict the search/replace to top 10 lines of translation files
+         #
+         elif [[ $file =~ '\.po$' ]]; then
+
+            echo "   Updating $file (only in first 10 lines)"
+
+            # this line can be used to update copyrights
+            # explicitly from just last year to this year
+            #
+            #`sed -i "1,10 s/\(copyright .*\)-$last_year\( The \
SquirrelMail\)/\1-$this_year\2/i" $file` +
+            `sed -i "1,10 s/\(copyright .*\)-2[0-9][0-9][0-9]\( The \
SquirrelMail\)/\1-$this_year\2/i" $file` +
+
+         # all other files
+         #
+         else
+
+            echo "   Updating $file"
+
+            # this line can be used to update copyrights
+            # explicitly from just last year to this year
+            #
+            #`sed -i "s/\(copyright .*\)-$last_year\( The \
SquirrelMail\)/\1-$this_year\2/i" $file` +
+            `sed -i "s/\(copyright .*\)-2[0-9][0-9][0-9]\( The \
SquirrelMail\)/\1-$this_year\2/i" $file` +         fi
+      fi
+
+   done
+
+}
+
+if [[ -z $1 ]] || [[ ! -d $1 ]]; then
+   echo
+   echo "Usage: $0 [directory]"
+else
+   this_year=`date +%Y`
+   last_year=$((this_year - 1))
+   echo
+   echo "Updating Copyrights from $last_year to $this_year"
+   echo
+   update_copyrights $1
+fi
+
+echo
+echo "Done"
+echo


Property changes on: trunk/util/update-copyright
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic