- range error when no upgradeable
- remove auto input pwd when apt pwd request
This commit is contained in:
Junyuan Feng
2022-05-25 13:29:51 +08:00
parent 8cbe76d9ff
commit 9cbd29d3c1
6 changed files with 29 additions and 25 deletions

View File

@@ -66,9 +66,8 @@ class AptProvider extends BusyProvider {
}
final result = await _update();
try {
getUpgradeableList(result);
} catch (e) {
getUpgradeableList(result);
try {} catch (e) {
error = '[Server Raw]:\n$result\n[App Error]:\n$e';
} finally {
notifyListeners();
@@ -91,9 +90,11 @@ class AptProvider extends BusyProvider {
// such as: [Could not chdir to home directory /home/test: No such file or directory, , WARNING: apt does not have a stable CLI interface. Use with caution in scripts., , Listing...]
final idx =
list.indexWhere((element) => element.contains('[upgradable from:'));
if (idx != -1) {
list = list.sublist(idx);
if (idx == -1) {
upgradeable = [];
return;
}
list = list.sublist(idx);
list.removeWhere((element) => element.isEmpty);
}
upgradeable = list.map((e) => UpgradePkgInfo(e, dist!)).toList();

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 146;
static const int build = 148;
static const String engine =
"Flutter 3.0.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision fb57da5f94 (4 days ago) • 2022-05-19 15:50:29 -0700\nEngine • revision caaafc5604\nTools • Dart 2.17.1 • DevTools 2.12.2\n";
static const String buildAt = "2022-05-24 13:44:07.002192";
"Flutter 3.0.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision fb57da5f94 (5 days ago) • 2022-05-19 15:50:29 -0700\nEngine • revision caaafc5604\nTools • Dart 2.17.1 • DevTools 2.12.2\n";
static const String buildAt = "2022-05-25 13:19:00.526108";
static const int modifications = 0;
}