mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-01 05:45:04 +01:00
Support yum.
This commit is contained in:
@@ -29,7 +29,7 @@ class ServerTabMenuItems {
|
||||
|
||||
static const sftp = MenuItem(text: 'SFTP', icon: Icons.insert_drive_file);
|
||||
static const snippet = MenuItem(text: 'Snippet', icon: Icons.label);
|
||||
static const apt = MenuItem(text: 'Apt', icon: Icons.system_security_update);
|
||||
static const apt = MenuItem(text: 'Apt/Yum', icon: Icons.system_security_update);
|
||||
static const docker = MenuItem(text: 'Docker', icon: Icons.view_agenda);
|
||||
static const edit = MenuItem(text: 'Edit', icon: Icons.edit);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:toolbox/data/model/distribution.dart';
|
||||
|
||||
class AptUpgradePkgInfo {
|
||||
class UpgradePkgInfo {
|
||||
final String _raw;
|
||||
final Distribution _dist;
|
||||
|
||||
@@ -9,7 +9,7 @@ class AptUpgradePkgInfo {
|
||||
late String newVersion;
|
||||
late String arch;
|
||||
|
||||
AptUpgradePkgInfo(this._raw, this._dist) {
|
||||
UpgradePkgInfo(this._raw, this._dist) {
|
||||
switch (_dist) {
|
||||
case Distribution.debian:
|
||||
case Distribution.unknown:
|
||||
@@ -29,5 +29,13 @@ class AptUpgradePkgInfo {
|
||||
nowVersion = split2[5].replaceFirst(']', '');
|
||||
}
|
||||
|
||||
void _parseYum() {}
|
||||
void _parseYum() {
|
||||
final result = RegExp(r'\S+').allMatches(_raw);
|
||||
final pkgAndArch = result.elementAt(0).group(0) ?? '.';
|
||||
final split1 = pkgAndArch.split('.');
|
||||
package = split1[0];
|
||||
arch = split1[1];
|
||||
newVersion = result.elementAt(1).group(0) ?? 'Unknown';
|
||||
nowVersion = '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user