mozilla/rust — pull request #2489 by z0w0 (2012-06-02 08:14:30+00:00)
Title: Cargo revamp: root in home, automatic init & sync, uninstallation, improved installation syntax and more

* Cargo now always works in ~/.cargo so you don't need a chain of root permissions to just use stuff (unless installing/uninstalling a package at system level). Closes #2475.

* Removed mode command. It's pointless when you have -g and -G. Always works at local level when installing / uninstalling, user level for anything else.

* Cargo now automatically inits and syncs when running for the first time. Closes #1353.

* Cargo now has a (weak) uninstall command. It works the same as install when it comes to working out what level you are working at. Once dependencies are implemented (as described in #1356), I am assuming that there will be a local cache of all the packages installed. Until then, this command simply works off the metadata name / uuid and does a really weak pattern match in the lib/bin directories to find what library files to delete.

```sh
cargo uninstall rustray # uninstalls by metadata name
cargo uninstall c89c5834-63db-4a6e-8e0a-d75985b1730e # uninstalls by metadata uuid
```

* Cargo now uses pretty colours, like rustc. All the error/info/warn messages were changed to be lower case and period-less to match rustc too.

* The cargo install command now accepts a pretty universal range of commands:

```sh
cargo install # installs from the working directory
cargo install rustray
cargo install central/rustray
cargo install c89c5834-63db-4a6e-8e0a-d75985b1730e # rustray uuid
cargo install central/c89c5834-63db-4a6e-8e0a-d75985b1730e
cargo install ../blah/somepkg.tar.gz
cargo install http://blah.com/somepkg.tar.gz
cargo install ftp://blah.com/somepkg.tar.gz
cargo install git://github.com/brson/rustray
cargo install http://github.com/brson/rustray.git
```

* The list command now prints out a prettier version of a summary of a source:

```
info: central (https://raw.github.com/mozilla/cargo-central/master/packages.json)
>> cairo, crypto, csv, elasticsearch, glfw, llvm, mecab, mongrel2, mre, mustache,
>> pcre, rparse, rust-hello, rustgl_4_2_core, rustic, rustray, rustx, sdl, socket,
>> sqlite, time, tnetstring, uri, uuid, zlib, zmq
```