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