Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/http.dart ('k') | sdk/lib/_internal/pub/lib/src/lock_file.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/io.dart
diff --git a/utils/pub/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
similarity index 97%
rename from utils/pub/io.dart
rename to sdk/lib/_internal/pub/lib/src/io.dart
index 12121e7e1aedf6d9eeab76e951de2ec647a14c17..f70b18a32f321a693132ba7944447263e40db29e 100644
--- a/utils/pub/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -252,23 +252,22 @@ void createPackageSymlink(String name, String target, String symlink,
}
}
-/// Resolves [target] relative to the location of pub.dart.
+/// Resolves [target] relative to the root directory of pub.
String relativeToPub(String target) {
var scriptPath = new File(new Options().script).fullPathSync();
- // Walk up until we hit the "util(s)" directory. This lets us figure out where
- // we are if this function is called from pub.dart, or one of the tests,
- // which also live under "utils", or from the SDK where pub is in "util".
- var utilDir = path.dirname(scriptPath);
- while (path.basename(utilDir) != 'utils' &&
- path.basename(utilDir) != 'util') {
- if (path.basename(utilDir) == '') {
+ // Walk up until we hit the "internal(s)" directory. This lets us figure out
+ // where we are if this function is called from pub.dart, one of the tests, or
+ // from the SDK.
+ var internalDir = path.dirname(scriptPath);
+ while (path.basename(internalDir) != '_internal') {
+ if (path.basename(internalDir) == '') {
throw new Exception('Could not find path to pub.');
}
- utilDir = path.dirname(utilDir);
+ internalDir = path.dirname(internalDir);
}
- return path.normalize(path.join(utilDir, 'pub', target));
+ return path.normalize(path.join(internalDir, 'pub', target));
}
/// A line-by-line stream of standard input.
@@ -564,7 +563,7 @@ Future<bool> _extractTarGzWindows(Stream<List<int>> stream,
// Note: This line of code gets munged by create_sdk.py to be the correct
// relative path to 7zip in the SDK.
- var pathTo7zip = '../../third_party/7zip/7za.exe';
+ var pathTo7zip = '../../../../third_party/7zip/7za.exe';
var command = relativeToPub(pathTo7zip);
return withTempDir((tempDir) {
@@ -652,7 +651,7 @@ ByteStream createTarGz(List contents, {baseDir}) {
// Note: This line of code gets munged by create_sdk.py to be the correct
// relative path to 7zip in the SDK.
- var pathTo7zip = '../../third_party/7zip/7za.exe';
+ var pathTo7zip = '../../../../third_party/7zip/7za.exe';
var command = relativeToPub(pathTo7zip);
// We're passing 'baseDir' both as '-w' and setting it as the working
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/http.dart ('k') | sdk/lib/_internal/pub/lib/src/lock_file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698