Skip to content
Permalink
Browse files

Don't use shellescape in MacPorts < 2.6.99

It's not available yet.
  • Loading branch information
ryandesign committed Jun 28, 2020
1 parent 91737e3 commit 6c5276d315e64e99f0a7e57b6cf9940b83e9eab6
@@ -133,7 +133,11 @@ extract {
xinstall -d ${my_build_dir}
foreach my_arch ${configure.universal_archs} {
foreach my_distfile_type {basic sdk} {
if {[vercmp [macports_version] 2.6.99] >= 0} {
system "${extract.cmd} ${extract.pre_args} ${extract.post_args} [shellescape ${distpath}/[format $my_distname_format(${my_arch}) ${my_distfile_type}]${extract.suffix}]"
} else {
system "${extract.cmd} ${extract.pre_args} ${extract.post_args} '${distpath}/[format $my_distname_format(${my_arch}) ${my_distfile_type}]${extract.suffix}'"
}
}
move ${extract.dir}/[format ${my_worksrcdir_format} [join [lrange [split ${version} .] 0 1] "_"]] ${my_build_dir}/${my_arch}
}
@@ -70,7 +70,11 @@ if {${name} eq ${subport}} {

pre-extract {
# Create list of data files we want to exclude.
if {[vercmp [macports_version] 2.6.99] >= 0} {
system -W ${workpath} "${extract.cmd} ${extract.pre_args} [shellescape ${distpath}/${distfiles}] | tar -tf - --exclude '*.cfg' [shellescape ${worksrcdir}/data1] | grep -v /$ > datafiles.txt"
} else {
system -W ${workpath} "${extract.cmd} ${extract.pre_args} '${distpath}/${distfiles}' | tar -tf - --exclude '*.cfg' '${worksrcdir}/data1' | grep -v /$ > datafiles.txt"
}
}

# Avoid extracting data files.
@@ -146,15 +146,24 @@ proc my_attach_disk_image {disk_image} {
global workpath
set tmp_disk_image_dir [mkdtemp "${workpath}/.tmp/disk_image.XXXXXXXX"]
set tmp_disk_image ${tmp_disk_image_dir}/[file tail ${disk_image}].cdr
system "hdiutil convert -quiet -ov -format UDTO -o [shellescape ${tmp_disk_image}] [shellescape ${disk_image}]"
set mountpoint [mkdtemp "${workpath}/.tmp/mountpoint.XXXXXXXX"]
if {[vercmp [macports_version] 2.6.99] >= 0} {
system "hdiutil convert -quiet -ov -format UDTO -o [shellescape ${tmp_disk_image}] [shellescape ${disk_image}]"
system "hdiutil attach -quiet [shellescape ${tmp_disk_image}] -mountpoint [shellescape ${mountpoint}] -private -nobrowse -noautoopen -noautofsck -noverify -readonly"
} else {
system "hdiutil convert -quiet -ov -format UDTO -o '${tmp_disk_image}' '${disk_image}'"
system "hdiutil attach -quiet '${tmp_disk_image}' -mountpoint '${mountpoint}' -private -nobrowse -noautoopen -noautofsck -noverify -readonly"
}
return ${mountpoint}
}

# Unmounts a disk image.
proc my_detach_disk_image {mountpoint} {
if {[vercmp [macports_version] 2.6.99] >= 0} {
system "hdiutil detach [shellescape ${mountpoint}] -force"
} else {
system "hdiutil detach '${mountpoint}' -force"
}
file delete -force ${mountpoint}
}

@@ -259,7 +259,11 @@ subport curl-ca-bundle {
${worksrcdir}/lib/mk-ca-bundle.pl

post-extract {
if {[vercmp [macports_version] 2.6.99] >= 0} {
system -W ${workpath} "unzip -q -a [shellescape ${distpath}/${certdata_distfile}]"
} else {
system -W ${workpath} "unzip -q -a '${distpath}/${certdata_distfile}'"
}
move ${workpath}/mozilla-central-${certdata_commit}/${certdata_path} ${worksrcpath}/${certdata_file}
}

@@ -31,7 +31,11 @@ depends_lib-append port:gmp
extract.only ${pure_reduce_distfile}

post-extract {
if {[vercmp [macports_version] 2.6.99] >= 0} {
system -W ${worksrcpath} "tar xjf [shellescape ${distpath}/${reduce_distfile}]"
} else {
system -W ${worksrcpath} "tar xjf '${distpath}/${reduce_distfile}'"
}
}

patchfiles patch-Makefile.diff

0 comments on commit 6c5276d

Please sign in to comment.
You can’t perform that action at this time.