From 6e28b501e90b1eee003a04295409452e04c1b891 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Thu, 15 Jul 2021 08:38:24 +0200 Subject: [PATCH] Fix directory path when is symlink Change the directory path to follow symlinks --- tools/createTftpbootXmlStructure.php | 15 ++++++++------- tools/tftpbootFiles.xml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/tools/createTftpbootXmlStructure.php b/tools/createTftpbootXmlStructure.php index 574d136..1916dd0 100644 --- a/tools/createTftpbootXmlStructure.php +++ b/tools/createTftpbootXmlStructure.php @@ -9,15 +9,16 @@ function createCats($currDirPos){ if(is_dir($currDirPos)){ // Remove unix ./.. foreach (array_diff(scandir($currDirPos),array('.','..')) as $subDir) { - //remove link information - $subDir = (explode(' ', $subDir)); - - if(is_dir("{$currDirPos}/{$subDir[0]}")) { - $xml .= "" . ltrim("{$currDirPos}/{$subDir[0]}",'./') . "/"; - $xml .= createCats("{$currDirPos}/{$subDir[0]}"); + if (is_dir("{$currDirPos}/{$subDir}")) { + $thisPath = "{$currDirPos}/{$subDir}"; + if (is_link("{$currDirPos}/{$subDir}")) { + $thisPath= $currDirPos . "/" . readlink("{$currDirPos}/{$subDir}"); + } + $xml .= "" . ltrim($thisPath,'./') . "/"; + $xml .= createCats("{$currDirPos}/{$subDir}"); $xml .= ""; } else { - $xml .= "{$subDir[0]}"; + $xml .= "{$subDir}"; } } } diff --git a/tools/tftpbootFiles.xml b/tools/tftpbootFiles.xml index f4b3a30..edae1e8 100644 --- a/tools/tftpbootFiles.xml +++ b/tools/tftpbootFiles.xml @@ -61,7 +61,7 @@ P00405000700.sbn - tftpboot/firmware/7911/ + tftpboot/firmware/7906/ SCCP11.9-4-2SR3-1S.loads apps11.9-4-2ES26.sbn cnu11.9-4-2ES26.sbn @@ -194,7 +194,7 @@ term65.default.loads - tftpboot/firmware/7960/ + tftpboot/firmware/7940/ P0030801SR02.bin P0030801SR02.loads P0030801SR02.sb2 @@ -202,7 +202,7 @@ P0030801SR02.txt - tftpboot/firmware/7961/ + tftpboot/firmware/7941/ SCCP41.9-4-2SR3-1S.loads apps41.9-4-2ES26.sbn cnu41.9-4-2ES26.sbn @@ -213,7 +213,7 @@ term61.default.loads - tftpboot/firmware/7962/ + tftpboot/firmware/7942/ SCCP42.9-4-2SR3-1S.loads apps42.9-4-2ES26.sbn cnu42.9-4-2ES26.sbn @@ -224,7 +224,7 @@ term62.default.loads - tftpboot/firmware/7965/ + tftpboot/firmware/7945/ SCCP45.9-3-1SR1-1S.loads SCCP45.9-4-2SR4-3S.loads apps45.9-3-1ES8.sbn @@ -252,7 +252,7 @@ term71.default.loads - tftpboot/firmware/7971/ + tftpboot/firmware/7970/ SCCP70.9-4-2SR3-1S.loads apps70.9-4-2ES26.sbn cnu70.9-4-2ES26.sbn @@ -302,12 +302,12 @@ ATA030204SCCP090202A.zup - tftpboot/firmware/ata188/ + tftpboot/firmware/ata186/ ATA030204SCCP090202A.zup mkregex.py - tftpboot/firmware/spa30x/ + tftpboot/firmware/spa50x/ tftpboot/firmware/spa30x/locale/ spa50x_30x_bg_v756.xml