Merge pull request #40 from lesydimitri/patch-1

cabextract: keep old symlink behaviour
This commit is contained in:
abbodi1406 2023-02-13 14:31:15 +03:00 committed by GitHub
commit 242b66af1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -374,6 +374,10 @@ function errorHandler() {
fi fi
} }
function version() {
echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'
}
if [ -e ISODIR ]; then if [ -e ISODIR ]; then
rm -rf ISODIR rm -rf ISODIR
fi fi
@ -418,12 +422,18 @@ if [ $runVirtualEditions -eq 1 ] && [ "$VIRTUAL_EDITIONS_PLUGIN_LOADED" != "1" ]
fi fi
echo "" echo ""
cabextractVersion=$(cabextract --version | cut -d ' ' -f 3)
if [ $(version $cabextractVersion) -ge $(version "1.10") ] ; then
keepSymlinks="-k"
else
keepSymlinks=""
fi
for file in `find "$uupDir" -type f -iname "*.cab" -not -iname "*windows1*-kb*.cab" -not -iname "ssu-*.cab" -not -iname "*desktopdeployment*.cab" -not -iname "*aggregatedmetadata*.cab"`; do for file in `find "$uupDir" -type f -iname "*.cab" -not -iname "*windows1*-kb*.cab" -not -iname "ssu-*.cab" -not -iname "*desktopdeployment*.cab" -not -iname "*aggregatedmetadata*.cab"`; do
fileName=`basename $file .cab` fileName=`basename $file .cab`
echo -e "$infoColor""CAB -> ESD:""$resetColor"" $fileName" echo -e "$infoColor""CAB -> ESD:""$resetColor"" $fileName"
mkdir "$extractDir" mkdir "$extractDir"
cabextract -d "$extractDir" "$file" >/dev/null 2>/dev/null cabextract "$keepSymlinks" -d "$extractDir" "$file" >/dev/null 2>/dev/null
errorHandler $? "Failed to extract $fileName.cab" errorHandler $? "Failed to extract $fileName.cab"
wimlib-imagex capture "$extractDir" "$tempDir/$fileName.esd" \ wimlib-imagex capture "$extractDir" "$tempDir/$fileName.esd" \