Alexpux / MSYS2-pacman

MSYS2 port of Arch Linux packman package manager.
GNU General Public License v2.0
164 stars 34 forks source link

Scan for build directory absolute Windows path after building #16

Closed DavidEGrayson closed 8 years ago

DavidEGrayson commented 8 years ago

Several issues reported to the MINGW-packages repository resulted from the Windows path to the packager's MSYS2 installation accidentally being baked into the package itself:

I would suggest adding a pass to makepkg that scans the package for this issue. Something like this could go a long way:

grep -Fr `cygpath -w /` $pkgdir && echo "warning: absolute path to build directory found in package"
yfwz100 commented 8 years ago

I suggest the detection command changed to

grep -Fr `cygpath -m /` $pkgdir && echo "warning: absolute path to build directory found in package"

cygpath -w / fail to detect path with '/' as separator.

DavidEGrayson commented 8 years ago

Thanks, that's a good idea. I don't know which version is more common (the one with forward slashes or backslashes). We might as well check for both.

DavidEGrayson commented 8 years ago

makepkg already has a feature for warning about build directory references:

https://github.com/Alexpux/MSYS2-pacman/blob/master/scripts/libmakepkg/lint_package/build_references.sh.in

I am working on a pull request that improves that script.

yfwz100 commented 8 years ago

:+1: