summary refs log tree commit diff
path: root/src/librustpkg/path_util.rs
AgeCommit message (Collapse)AuthorLines
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-5/+4
2013-06-29Remove unused variableJordi Boggiano-1/+0
2013-06-27rustpkg: Implement RUST_PATHTim Chevalier-3/+32
Unfortunately, the main test for this is ignored due to #7071. Closes #5682
2013-06-23vec: remove BaseIter implementationDaniel Micay-3/+4
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-14rustpkg: Write more automated testsTim Chevalier-22/+67
Automate more tests described in the commands.txt file, and add infrastructure for running them. Right now, tests shell out to call rustpkg. This is not ideal.
2013-06-14add IteratorUtil to the preludeDaniel Micay-1/+0
2013-06-10std: replace str::each_split* with an iteratorHuon Wilson-1/+2
2013-06-09rustpkg: Accept package IDs like github.com/foo/bar#0.3Tim Chevalier-5/+11
If the package ID is of the form s#v, where v is a valid version string, fetch tag v of that package.
2013-06-01rustc/rusti/rustpkg: Infer packages from `extern mod` directivesTim Chevalier-42/+94
This commit won't be quite as useful until I implement RUST_PATH and until we change `extern mod` to take a general string instead of an identifier (#5682 and #6407). With that said, now if you're using rustpkg and a program contains: extern mod foo; rustpkg will attempt to search for `foo`, so that you don't have to provide a -L directory explicitly. In addition, rustpkg will actually try to build and install `foo`, unless it's already installed (specifically, I tested that `extern mod extra;` would not cause it to try to find source for `extra` and compile it again). This is as per #5681. Incidentally, I changed some driver code to infer the link name from the crate link_meta attributes. If that change isn't ok, say something. Also, I changed the addl_lib_search_paths field in the session options to be an @mut ~[Path] so that it can be modified after expansion but before later phases.
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-1/+3
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+1
to libextra
2013-05-14rustpkg: Tests for well-formed and ill-formed package IDs...Tim Chevalier-15/+16
...and cleanup, making how we handle version numbers more rational (specifically, not passing in a versioned name to rustc with the -o flag), and removing unused code.
2013-05-14rustpkg: Implement URL-like package IDsTim Chevalier-48/+59
This patch implements package IDs like github.com/catamorphism/test-pkg. To support such package IDs, I changed the PkgId struct to contain a LocalPath and a RemotePath field, where the RemotePath reflects the actual URL and the LocalPath reflects the file name of the cached copy. Right now, the only difference is that the local path doesn't contain dashes, but this will change when we implement #6407. Also, PkgIds now have a short_name field -- though the short name can be derived from the LocalPath, I thought it was cleaner not to call option::get() wantonly.
2013-05-14rustpkg: Remove #[allow(vecs_implicitly_copyable)]Alex Crichton-12/+13
2013-05-03rustpkg: Handle sysroot more correctlyTim Chevalier-5/+1
In rustpkg, pass around sysroot; in rustpkg tests, set the sysroot manually so that tests can find libcore and such. With bonus metadata::filesearch refactoring to avoid copies.
2013-05-03rustpkg: Implement install commandTim Chevalier-11/+119
The install command should work now, though it only installs in-place (anything else has to wait until I implement RUST_PATH). Also including: core: Add remove_directory_recursive, change copy_file Make copy_file preserve permissions, and add a remove_directory_recursive function.
2013-04-27only use #[no_core] in libcoreDaniel Micay-3/+0
2013-04-26core: Move mkdir_recursive from rustpkg into core::osTim Chevalier-39/+5
mkdir_recursive creates a directory as well as any of its parent directories that don't exist already. Seems like a useful thing to have in core.
2013-04-24rustpkg: Make path searching work as described in the rustpkg docTim Chevalier-52/+116
rustpkg now searches for package directories in ./src rather than in . . I also added a rudimentary RUST_PATH that's currently hard-wired to the current directory. rustpkg now uses src/, lib/, and build/ directories as described in the manual. Most of the existing test scenarios build now; the README file (in a separate commit) explains which ones.
2013-04-24libcore: unify `gen_<type>` methods on `rand::RngUtil` into the generic `gen`.Huon Wilson-1/+1
This moves all the basic random value generation into the Rand instances for each type and then removes the `gen_int`, `gen_char` (etc) methods on RngUtil, leaving only the generic `gen` and the more specialised methods. Also, removes some imports that are redundant due to a `use core::prelude::*` statement.
2013-04-24libcore: remove @Rng from rand, and use traits instead.Huon Wilson-1/+1
Also, rename RandRes -> IsaacRng, and make the constructors static methods.
2013-04-17rustpkg: Fail when crate inference fails; inject link attributesTim Chevalier-1/+20
1. Fail when there's no package script and no crates named main.rs, lib.rs, bench.rs, or test.rs. 2. Inject the crate link_meta "name" and "vers" attributes, so that the output file gets named correctly in the library case. 3. Normalize '-' to '_' in package names.
2013-04-15TidyTim Chevalier-2/+2
2013-04-12rustpkg: Factor out tests; use a condition instead of returning an optionTim Chevalier-0/+83
Pulled out tests into their own modules inside the files they test, as per the draft style guidelines. Started a new module, path_util, for utility functions to do with paths and directories. Changed default_dest_dir to use a condition and return Path instead of Option<Path>.