[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[3437] trunk
- Subject: SF.net SVN: ledger-smb:[3437] trunk
- From: ..hidden..
- Date: Mon, 04 Jul 2011 21:23:06 +0000
Revision: 3437
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3437&view=rev
Author: ehuelsmann
Date: 2011-07-04 21:23:05 +0000 (Mon, 04 Jul 2011)
Log Message:
-----------
Move single-use migration scripts out of the tree root to tools/.
Added Paths:
-----------
trunk/tools/SL2LS.pl
trunk/tools/sl2ls.sh
Removed Paths:
-------------
trunk/SL2LS.pl
trunk/sl2ls.sh
Deleted: trunk/SL2LS.pl
===================================================================
--- trunk/SL2LS.pl 2011-07-04 21:15:55 UTC (rev 3436)
+++ trunk/SL2LS.pl 2011-07-04 21:23:05 UTC (rev 3437)
@@ -1,45 +0,0 @@
-#!/usr/bin/perl
-
-# http://www.ledgersmb.org/
-#
-# Simple script. Right now, all that needs to be done is that the SL directory
-# needs to be deleted and the sql-ledger.conf needs to be renamed.
-
-$filedie =
- "To install manually:\n"
- . " Rename the sql-ledger.conf to ledger-smb.conf\n"
- . " Delete the SL directory (optional but HIGHLY recommended)\n";
-open( SL, "< sql-ledger.conf" )
- || die("Could not open sql-ledger.conf: $! \n\n $filedie");
-open( LS, "> ledger-smb.conf" )
- || die("Could not open ledger-smb.conf: $! \n $filedie");
-
-while ( $line = <SL> ) {
- print LS $line;
-}
-
-unlink "sql-ledger.conf";
-
-#TODO: Move/Delete the SL directory
-
-&recursive_unlink("SL");
-
-sub recursive_unlink {
- ($dir) = shift @_;
- print "Recursively deleting $dir\n";
- opendir( DIR, $dir );
- while ( $file = readdir DIR ) {
- if ( $file !~ /^\.+$/ ) {
- $file = "$dir/$file";
- if ( -f $file ) {
- unlink $file;
- }
- elsif ( -d $file ) {
- &recursive_unlink("$file");
- }
- }
- }
- closedir(DIR);
- print "Removing $dir\n";
- rmdir $dir;
-}
Deleted: trunk/sl2ls.sh
===================================================================
--- trunk/sl2ls.sh 2011-07-04 21:15:55 UTC (rev 3436)
+++ trunk/sl2ls.sh 2011-07-04 21:23:05 UTC (rev 3437)
@@ -1,66 +0,0 @@
-#
-#
-#
-# SQL-Ledger Dataset name and Dataset Owner
-#
-SLDB=sqlledger
-SLOWN=SQL-Ledger_Owner
-
-#
-# Ledger-SMB Dataset name and Dataset Owner
-#
-LSDB=lsmbprod
-LSOWN=ledgersmb
-
-# Installation directory
-
-IDIR=`pwd`
-
-psql template1 -c "DROP DATABASE ${LSDB};"
-
-pg_dump ${SLDB} > sl2ls.sql
-
-sed -i.orig -e "s/${SLOWN}/${LSOWN}/" sl2ls.sql
-sed -i.orig -e "s/SQL_ASCII/LATIN1/" sl2ls.sql
-
-createdb -O ${LSOWN} ${LSDB}
-
-psql ${LSDB} ${LSOWN} -c "\i ${IDIR}/sql/Pg-central.sql"
-
-psql template1 -c "ALTER USER ${LSOWN} WITH superuser;"
-
-psql ${LSDB} ${LSOWN} -c "\i sl2ls.sql"
-
-psql template1 -c "ALTER USER ${LSOWN} WITH nosuperuser;"
-
-cd ${IDIR}/sql/legacy/
-
-psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
-
-psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.12-2.6.17.sql"
-
-psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
-
-psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.17-2.6.18.sql"
-
-psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
-
-psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.18-2.6.19.sql"
-
-echo '###############################################################'
-echo
-echo 'Should error with--> ERROR: column "version" does not exist'
-echo
-echo '###############################################################'
-
-psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
-
-psql ${LSDB} ${LSOWN} -c "update users_conf set password = md5('apasswrd');"
-
-cd ${IDIR}
-
-./import_members.pl users/members
-
-psql ${LSDB} ${LSOWN} -c "SELECT * FROM users;"
-
-exit
Copied: trunk/tools/SL2LS.pl (from rev 3433, trunk/SL2LS.pl)
===================================================================
--- trunk/tools/SL2LS.pl (rev 0)
+++ trunk/tools/SL2LS.pl 2011-07-04 21:23:05 UTC (rev 3437)
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+
+# http://www.ledgersmb.org/
+#
+# Simple script. Right now, all that needs to be done is that the SL directory
+# needs to be deleted and the sql-ledger.conf needs to be renamed.
+
+$filedie =
+ "To install manually:\n"
+ . " Rename the sql-ledger.conf to ledger-smb.conf\n"
+ . " Delete the SL directory (optional but HIGHLY recommended)\n";
+open( SL, "< sql-ledger.conf" )
+ || die("Could not open sql-ledger.conf: $! \n\n $filedie");
+open( LS, "> ledger-smb.conf" )
+ || die("Could not open ledger-smb.conf: $! \n $filedie");
+
+while ( $line = <SL> ) {
+ print LS $line;
+}
+
+unlink "sql-ledger.conf";
+
+#TODO: Move/Delete the SL directory
+
+&recursive_unlink("SL");
+
+sub recursive_unlink {
+ ($dir) = shift @_;
+ print "Recursively deleting $dir\n";
+ opendir( DIR, $dir );
+ while ( $file = readdir DIR ) {
+ if ( $file !~ /^\.+$/ ) {
+ $file = "$dir/$file";
+ if ( -f $file ) {
+ unlink $file;
+ }
+ elsif ( -d $file ) {
+ &recursive_unlink("$file");
+ }
+ }
+ }
+ closedir(DIR);
+ print "Removing $dir\n";
+ rmdir $dir;
+}
Copied: trunk/tools/sl2ls.sh (from rev 3433, trunk/sl2ls.sh)
===================================================================
--- trunk/tools/sl2ls.sh (rev 0)
+++ trunk/tools/sl2ls.sh 2011-07-04 21:23:05 UTC (rev 3437)
@@ -0,0 +1,66 @@
+#
+#
+#
+# SQL-Ledger Dataset name and Dataset Owner
+#
+SLDB=sqlledger
+SLOWN=SQL-Ledger_Owner
+
+#
+# Ledger-SMB Dataset name and Dataset Owner
+#
+LSDB=lsmbprod
+LSOWN=ledgersmb
+
+# Installation directory
+
+IDIR=`pwd`
+
+psql template1 -c "DROP DATABASE ${LSDB};"
+
+pg_dump ${SLDB} > sl2ls.sql
+
+sed -i.orig -e "s/${SLOWN}/${LSOWN}/" sl2ls.sql
+sed -i.orig -e "s/SQL_ASCII/LATIN1/" sl2ls.sql
+
+createdb -O ${LSOWN} ${LSDB}
+
+psql ${LSDB} ${LSOWN} -c "\i ${IDIR}/sql/Pg-central.sql"
+
+psql template1 -c "ALTER USER ${LSOWN} WITH superuser;"
+
+psql ${LSDB} ${LSOWN} -c "\i sl2ls.sql"
+
+psql template1 -c "ALTER USER ${LSOWN} WITH nosuperuser;"
+
+cd ${IDIR}/sql/legacy/
+
+psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
+
+psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.12-2.6.17.sql"
+
+psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
+
+psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.17-2.6.18.sql"
+
+psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
+
+psql ${LSDB} ${LSOWN} -c "\i Pg-upgrade-2.6.18-2.6.19.sql"
+
+echo '###############################################################'
+echo
+echo 'Should error with--> ERROR: column "version" does not exist'
+echo
+echo '###############################################################'
+
+psql ${LSDB} ${LSOWN} -c "SELECT version FROM defaults;"
+
+psql ${LSDB} ${LSOWN} -c "update users_conf set password = md5('apasswrd');"
+
+cd ${IDIR}
+
+./import_members.pl users/members
+
+psql ${LSDB} ${LSOWN} -c "SELECT * FROM users;"
+
+exit
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.