ready for more pkg manager

This commit is contained in:
lollipopkit
2023-01-26 16:11:34 +08:00
parent 0522cfef1c
commit 96034f9487
12 changed files with 106 additions and 91 deletions

View File

@@ -1,8 +1,8 @@
import 'package:toolbox/data/model/distribution.dart';
import 'package:toolbox/data/model/server/dist.dart';
class UpgradePkgInfo {
final String _raw;
final Distribution _dist;
final Dist _dist;
late String package;
late String nowVersion;
@@ -11,12 +11,15 @@ class UpgradePkgInfo {
UpgradePkgInfo(this._raw, this._dist) {
switch (_dist) {
case Distribution.debian:
case Distribution.unknown:
case Dist.debian:
case Dist.ubuntu:
_parseApt();
break;
case Distribution.rehl:
case Dist.centos:
_parseYum();
break;
default:
throw Exception('Unsupported dist: $_dist');
}
}