mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
rewrite pkg
This commit is contained in:
@@ -25,6 +25,9 @@ class UpgradePkgInfo {
|
||||
case PkgManager.opkg:
|
||||
_parseOpkg(raw);
|
||||
break;
|
||||
case PkgManager.apk:
|
||||
_parseApk(raw);
|
||||
break;
|
||||
default:
|
||||
throw Exception('Unsupported pkg type: $_mgr');
|
||||
}
|
||||
@@ -72,4 +75,15 @@ class UpgradePkgInfo {
|
||||
newVersion = parts[2];
|
||||
arch = '';
|
||||
}
|
||||
|
||||
// libcrypto3-3.0.8-r4 x86_64 {openssl} (Apache-2.0) [upgradable from: libcrypto3-3.0.8-r3]
|
||||
void _parseApk(String raw) {
|
||||
final parts = raw.split(' ');
|
||||
final len = parts.length;
|
||||
newVersion = parts[len - 1];
|
||||
nowVersion = parts[0];
|
||||
newVersion = newVersion.substring(0, newVersion.length - 1);
|
||||
package = nowVersion;
|
||||
arch = parts[1];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user