Re: [viewvc-dev] [PATCH]: make-database --- allow database to be remote

"C. Michael Pilato" <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Organization CollabNet, Inc.
Message-ID <[email protected]>
Well, the whitespace *was* mangled, but the patch is easy enough to 
hand-apply.  I made some improvements to it (and to make-database in 
general), and committed it all in r1902.  Thanks, Philip!


Philip M. Gollucci wrote:
> Hopefully the whitespace isn't mangled.....
> 
> diff -u make-database.orig make-database
> --- make-database.orig  2008-05-22 22:11:03.000000000 +0000
> +++ make-database       2008-05-22 22:13:11.000000000 +0000
> @@ -126,6 +126,10 @@
> ~     user = raw_input("MySQL User: ")
> ~     passwd = raw_input("MySQL Password: ")
> ~     dbase = raw_input("ViewVC Database Name [default: ViewVC]: ")
> +    dhost = raw_input("ViewVC Database Host [default: localhost]: ")
> +    if dhost:
> +       dhost = "-h %s" % dhost
> +
> ~     if not dbase:
> ~         dbase = "ViewVC"
> 
> @@ -133,12 +137,12 @@
> 
> ~     if sys.platform == "win32":
> ~       # popen2.Popen3 is not provided on windows
> -      cmd = "mysql --user=%s --password=%s" % (user, passwd)
> +      cmd = "mysql --user=%s --password=%s %s " % (user, passwd, dhost)
> ~       mysql = os.popen(cmd, "w")
> ~       mysql.write(dscript)
> ~       status = mysql.close()
> ~     else:
> -      cmd = "{ mysql --user=%s --password=%s ; } 2>&1" % (user, passwd)
> +      cmd = "{ mysql --user=%s --password=%s %s ; } 2>&1" % (user, 
> passwd, dhost)
> ~       pipes = popen2.Popen3(cmd)
> ~       pipes.tochild.write(dscript)
> ~       pipes.tochild.close()
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



-- 
C. Michael Pilato <[email protected]>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFINru/okEGqRcG/W4RAuzJAJkB3WVesGcBnjT3z6QbaX5I/NufjACgoYuK
bZUnLEX/WTO0M0m7BRTrtIM=
=o7+r
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.