Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c461e933
Unverified
Commit
c461e933
authored
Dec 11, 2018
by
Jonah Williams
Committed by
GitHub
Dec 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Ensure that cache dirs and files have appropriate permissions" (#25240)
parent
234855ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
39 deletions
+15
-39
update_dart_sdk.sh
bin/internal/update_dart_sdk.sh
+1
-5
os.dart
packages/flutter_tools/lib/src/base/os.dart
+7
-20
cache.dart
packages/flutter_tools/lib/src/cache.dart
+7
-14
No files found.
bin/internal/update_dart_sdk.sh
View file @
c461e933
...
...
@@ -27,11 +27,9 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
case
"
$(
uname
-s
)
"
in
Darwin
)
DART_ZIP_NAME
=
"dart-sdk-darwin-x64.zip"
IS_USER_EXECUTABLE
=
"-perm +100"
;;
Linux
)
DART_ZIP_NAME
=
"dart-sdk-linux-x64.zip"
IS_USER_EXECUTABLE
=
"-perm /u+x"
;;
*
)
echo
"Unknown operating system. Cannot install Dart SDK."
...
...
@@ -50,7 +48,7 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
# install the new sdk
rm
-rf
--
"
$DART_SDK_PATH
"
mkdir
-
m
755
-
p
--
"
$DART_SDK_PATH
"
mkdir
-p
--
"
$DART_SDK_PATH
"
DART_SDK_ZIP
=
"
$FLUTTER_ROOT
/bin/cache/
$DART_ZIP_NAME
"
curl
--continue-at
-
--location
--output
"
$DART_SDK_ZIP
"
"
$DART_SDK_URL
"
2>&1
||
{
...
...
@@ -72,8 +70,6 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
exit
1
}
rm
-f
--
"
$DART_SDK_ZIP
"
find
"
$DART_SDK_PATH
"
-type
d
-exec
chmod
755
{}
\;
find
"
$DART_SDK_PATH
"
-type
f
$IS_USER_EXECUTABLE
-exec
chmod
a+x,a+r
{}
\;
echo
"
$ENGINE_VERSION
"
>
"
$ENGINE_STAMP
"
# delete any temporary sdk path
...
...
packages/flutter_tools/lib/src/base/os.dart
View file @
c461e933
...
...
@@ -25,15 +25,7 @@ abstract class OperatingSystemUtils {
OperatingSystemUtils
.
_private
();
/// Make the given file executable. This may be a no-op on some platforms.
void
makeExecutable
(
File
file
);
/// Updates the specified file system [entity] to have the file mode
/// bits set to the value defined by [mode], which can be specified in octal
/// (e.g. `644`) or symbolically (e.g. `u+x`).
///
/// On operating systems that do not support file mode bits, this will be a
/// no-op.
void
chmod
(
FileSystemEntity
entity
,
String
mode
);
ProcessResult
makeExecutable
(
File
file
);
/// Return the path (with symlinks resolved) to the given executable, or null
/// if `which` was not able to locate the binary.
...
...
@@ -86,13 +78,8 @@ class _PosixUtils extends OperatingSystemUtils {
_PosixUtils
()
:
super
.
_private
();
@override
void
makeExecutable
(
File
file
)
{
chmod
(
file
,
'a+x'
);
}
@override
void
chmod
(
FileSystemEntity
entity
,
String
mode
)
{
processManager
.
runSync
(<
String
>[
'chmod'
,
mode
,
entity
.
path
]);
ProcessResult
makeExecutable
(
File
file
)
{
return
processManager
.
runSync
(<
String
>[
'chmod'
,
'a+x'
,
file
.
path
]);
}
@override
...
...
@@ -165,11 +152,11 @@ class _PosixUtils extends OperatingSystemUtils {
class
_WindowsUtils
extends
OperatingSystemUtils
{
_WindowsUtils
()
:
super
.
_private
();
// This is a no-op.
@override
void
makeExecutable
(
File
file
)
{}
@override
void
chmod
(
FileSystemEntity
entity
,
String
mode
)
{}
ProcessResult
makeExecutable
(
File
file
)
{
return
ProcessResult
(
0
,
0
,
null
,
null
);
}
@override
List
<
File
>
_which
(
String
execName
,
{
bool
all
=
false
})
{
...
...
packages/flutter_tools/lib/src/cache.dart
View file @
c461e933
...
...
@@ -145,10 +145,8 @@ class Cache {
/// Return a directory in the cache dir. For `pkg`, this will return `bin/cache/pkg`.
Directory
getCacheDir
(
String
name
)
{
final
Directory
dir
=
fs
.
directory
(
fs
.
path
.
join
(
getRoot
().
path
,
name
));
if
(!
dir
.
existsSync
())
{
if
(!
dir
.
existsSync
())
dir
.
createSync
(
recursive:
true
);
os
.
chmod
(
dir
,
'755'
);
}
return
dir
;
}
...
...
@@ -196,10 +194,8 @@ class Cache {
final
Directory
thirdPartyDir
=
getArtifactDirectory
(
'third_party'
);
final
Directory
serviceDir
=
fs
.
directory
(
fs
.
path
.
join
(
thirdPartyDir
.
path
,
serviceName
));
if
(!
serviceDir
.
existsSync
())
{
if
(!
serviceDir
.
existsSync
())
serviceDir
.
createSync
(
recursive:
true
);
os
.
chmod
(
serviceDir
,
'755'
);
}
final
File
cachedFile
=
fs
.
file
(
fs
.
path
.
join
(
serviceDir
.
path
,
url
.
pathSegments
.
last
));
if
(!
cachedFile
.
existsSync
())
{
...
...
@@ -556,16 +552,13 @@ class FlutterEngine extends CachedArtifact {
return
result
;
}
void
_makeFilesExecutable
(
Directory
dir
)
{
os
.
chmod
(
dir
,
'a+r,a+x'
);
for
(
FileSystemEntity
entity
in
dir
.
listSync
(
recursive:
true
))
{
for
(
FileSystemEntity
entity
in
dir
.
listSync
())
{
if
(
entity
is
File
)
{
final
FileStat
stat
=
entity
.
statSync
();
final
bool
isUserExecutable
=
((
stat
.
mode
>>
6
)
&
0x1
)
==
1
;
if
(
entity
.
basename
==
'flutter_tester'
||
isUserExecutable
)
{
// Make the file readable and executable by all users.
os
.
chmod
(
entity
,
'a+r,a+x'
);
}
final
String
name
=
fs
.
path
.
basename
(
entity
.
path
);
if
(
name
==
'flutter_tester'
)
os
.
makeExecutable
(
entity
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment