projects/aports·blob master · refs

122 lines · 4.0 KiB

1--- ./packages/flutter_tools/lib/src/version.dart.orig
2+++ ./packages/flutter_tools/lib/src/version.dart
3@@ -79,7 +79,7 @@
4 }) {
5 final File versionFile = getVersionFile(fs, flutterRoot);
6
7- if (!fetchTags && versionFile.existsSync()) {
8+ if (versionFile.existsSync()) {
9 final _FlutterVersionFromFile? version = _FlutterVersionFromFile.tryParseFromFile(
10 versionFile,
11 git: git,
12@@ -99,10 +99,7 @@
13 }
14 }
15
16- final String frameworkRevision = git
17- .logSync(['-n', '1', '--pretty=format:%H'], workingDirectory: flutterRoot)
18- .stdout
19- .trim();
20+ final String frameworkRevision = "alpineaports0000000000000000000000000000";
21
22 return FlutterVersion.fromRevision(
23 clock: clock,
24@@ -137,7 +134,8 @@
25 workingDirectory: flutterRoot,
26 fetchTags: fetchTags,
27 );
28- final String frameworkVersion = gitTagVersion.frameworkVersionFor(frameworkRevision);
29+ final String frameworkVersion =
30+ globals.fs.file(globals.fs.path.join(Cache.flutterRoot!, 'version')).readAsStringSync();
31 final result = _FlutterVersionGit._(
32 clock: clock,
33 flutterRoot: flutterRoot,
34@@ -222,10 +220,7 @@
35 final String flutterRoot;
36
37 String _getTimeSinceCommit({String? revision}) {
38- return _git
39- .logSync(['-n', '1', '--pretty=format:%ar', ?revision], workingDirectory: flutterRoot)
40- .stdout
41- .trim();
42+ return 'unknown (alpine package)';
43 }
44
45 // TODO(fujino): calculate this relative to frameworkCommitDate for
46@@ -345,6 +340,7 @@
47 /// Returns `null` if the cached version is out-of-date or missing, and we are
48 /// unable to reach the server to get the latest version.
49 Future<DateTime?> _getLatestAvailableFlutterDate() async {
50+ return null;
51 globals.cache.checkLockAcquired();
52 final VersionCheckStamp versionCheckStamp = await VersionCheckStamp.load(
53 globals.cache,
54@@ -464,6 +460,14 @@
55 required Git git,
56 required String? workingDirectory,
57 }) {
58+ final File versionFile = globals.fs.file(
59+ globals.fs.path.join(workingDirectory!, 'bin', 'cache', 'flutter.version.json'),
60+ );
61+
62+ final _FlutterVersionFromFile version =
63+ _FlutterVersionFromFile.tryParseFromFile(versionFile, flutterRoot: workingDirectory, git: git)!;
64+ return version.frameworkCommitDate;
65+
66 final RunResult result = git.logSync([
67 gitRef,
68 '-n',
69@@ -592,9 +596,7 @@
70 final String devToolsVersion;
71
72 @override
73- void ensureVersionFile() {
74- _ensureLegacyVersionFile(fs: fs, flutterRoot: flutterRoot, frameworkVersion: frameworkVersion);
75- }
76+ void ensureVersionFile() {}
77 }
78
79 class _FlutterVersionGit extends FlutterVersion {
80@@ -708,16 +710,7 @@
81 required FileSystem fs,
82 required String flutterRoot,
83 required String frameworkVersion,
84-}) {
85- // TODO(matanlurey): https://github.com/flutter/flutter/issues/171900.
86- if (featureFlags.isOmitLegacyVersionFileEnabled) {
87- return;
88- }
89- final File legacyVersionFile = fs.file(fs.path.join(flutterRoot, 'version'));
90- if (!legacyVersionFile.existsSync()) {
91- legacyVersionFile.writeAsStringSync(frameworkVersion);
92- }
93-}
94+}) {}
95
96 /// Checks if the provided [version] is tracking a standard remote.
97 ///
98@@ -743,6 +736,7 @@
99 ///
100 /// Returns [VersionCheckError] if the tracking remote is not standard.
101 VersionCheckError? run() {
102+ return null;
103 final String? flutterGit = platform.environment['FLUTTER_GIT_URL'];
104 final String? repositoryUrl = version.repositoryUrl;
105
106@@ -950,7 +944,7 @@
107 if (revision == null) {
108 return '';
109 }
110- return revision.length > 10 ? revision.substring(0, 10) : revision;
111+ return revision.length > 12 ? revision.substring(0, 12) : revision;
112 }
113
114 /// Version of Flutter SDK parsed from Git.
115@@ -1011,6 +1005,7 @@
116 bool fetchTags = false,
117 String gitRef = 'HEAD',
118 }) {
119+ return parse(globals.fs.file(globals.fs.path.join(Cache.flutterRoot!, 'version')).readAsStringSync());
120 if (fetchTags) {
121 final String channel = git
122 .runSync(['symbolic-ref', '--short', 'HEAD'], workingDirectory: workingDirectory)