diff --git a/common/environment/install/extglob.sh b/common/environment/install/extglob.sh new file mode 100644 index 00000000000..048218c60dc --- /dev/null +++ b/common/environment/install/extglob.sh @@ -0,0 +1,15 @@ +# This provides the extglob function to expand wildcards in the destdir + +expand_destdir() { + local glob_list= result= glob= file= + + for glob; do + glob_list+=" $DESTDIR/$glob" + done + shopt -s extglob + for file in $glob_list; do + result+=" ${file#$DESTDIR/}" + done + shopt -u extglob + echo $result +} diff --git a/common/environment/pkg/extglob.sh b/common/environment/pkg/extglob.sh deleted file mode 100644 index be620cec704..00000000000 --- a/common/environment/pkg/extglob.sh +++ /dev/null @@ -1,17 +0,0 @@ -# This provides the extglob function to expand wildcards in the destdir - -expand_destdir() { - local glob_list= result= glob= file= - - for glob; do - glob_list+=" $DESTDIR/$glob" - done - shopt -s extglob - for file in $glob_list; do - result+=" ${file#$DESTDIR/}" - done - shopt -u extglob - echo $result -} - - diff --git a/common/environment/pkg/extglob.sh b/common/environment/pkg/extglob.sh new file mode 120000 index 00000000000..727ffaf5645 --- /dev/null +++ b/common/environment/pkg/extglob.sh @@ -0,0 +1 @@ +../install/extglob.sh \ No newline at end of file diff --git a/common/hooks/do-pkg/00-gen-pkg.sh b/common/hooks/do-pkg/00-gen-pkg.sh index 8ffa91d8e5a..ab010ff42f8 100644 --- a/common/hooks/do-pkg/00-gen-pkg.sh +++ b/common/hooks/do-pkg/00-gen-pkg.sh @@ -1,7 +1,5 @@ # This hook generates a XBPS binary package from an installed package in destdir. -source ${XBPS_COMMONDIR}/environment/pkg/extglob.sh - genpkg() { local pkgdir="$1" arch="$2" desc="$3" pkgver="$4" binpkg="$5" local _preserve _deps _shprovides _shrequires _gitrevs _provides _conflicts diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh index d584b78d7a1..e9015e25365 100644 --- a/common/hooks/pre-pkg/99-pkglint.sh +++ b/common/hooks/pre-pkg/99-pkglint.sh @@ -1,7 +1,5 @@ # This hook checks for common issues related to void. -source ${XBPS_COMMONDIR}/environment/pkg/extglob.sh - hook() { local error=0 filename= rev= libname= conflictPkg= conflictFile= local conflictRev= ignore= found= mapshlibs=$XBPS_COMMONDIR/shlibs