mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
firmware: improve previous a little more
This commit is contained in:
parent
cf25dd91cb
commit
eec0fbb96b
@ -2,7 +2,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2021 Franco Fichtner <franco@opnsense.org>
|
||||
* Copyright (c) 2021-2022 Franco Fichtner <franco@opnsense.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -114,16 +114,19 @@ function plugins_disk_get()
|
||||
|
||||
foreach (glob('/usr/local/opnsense/version/*') as $name) {
|
||||
$filename = basename($name);
|
||||
if ($filename == 'base' || $filename == 'kernel' || $filename == 'pkgs') {
|
||||
$prefix = explode('.', $filename)[0];
|
||||
|
||||
if ($prefix == 'base' || $prefix == 'kernel' || $prefix == 'pkgs') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ret = json_decode(@file_get_contents($name), true);
|
||||
if ($ret == null || !isset($ret['product_id'])) {
|
||||
echo "Ignoring invalid metadata: $name" . PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strpos($filename, 'core') === 0) {
|
||||
if ($prefix == 'core') {
|
||||
if (strpos($ret['product_id'], '-') !== false) {
|
||||
$type = preg_replace('/[^-]+-/', '', $ret['product_id']);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user