Merge pull request #1433 from contivero/fix-export-p

Fix 'export -p' being undefined under POSIX sh
This commit is contained in:
Vidar Holen 2019-01-08 19:33:03 -08:00 committed by GitHub
commit 0e21f91c07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -141,6 +141,8 @@ prop_checkBashisms58= verify checkBashisms "#!/bin/sh\nulimit -c 0"
prop_checkBashisms59 = verify checkBashisms "#!/bin/sh\njobs -s" prop_checkBashisms59 = verify checkBashisms "#!/bin/sh\njobs -s"
prop_checkBashisms60 = verifyNot checkBashisms "#!/bin/sh\njobs -p" prop_checkBashisms60 = verifyNot checkBashisms "#!/bin/sh\njobs -p"
prop_checkBashisms61 = verifyNot checkBashisms "#!/bin/sh\njobs -lp" prop_checkBashisms61 = verifyNot checkBashisms "#!/bin/sh\njobs -lp"
prop_checkBashisms62 = verify checkBashisms "#!/bin/sh\nexport -f foo"
prop_checkBashisms63 = verifyNot checkBashisms "#!/bin/sh\nexport -p"
checkBashisms = ForShell [Sh, Dash] $ \t -> do checkBashisms = ForShell [Sh, Dash] $ \t -> do
params <- ask params <- ask
@ -286,7 +288,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
] ++ if not isDash then ["local"] else [] ] ++ if not isDash then ["local"] else []
allowedFlags = Map.fromList [ allowedFlags = Map.fromList [
("exec", []), ("exec", []),
("export", ["-p"]), ("export", ["p"]),
("jobs", ["l", "p"]), ("jobs", ["l", "p"]),
("printf", []), ("printf", []),
("read", if isDash then ["r", "p"] else ["r"]), ("read", if isDash then ["r", "p"] else ["r"]),