This answer elaborates on how to properly format punctuation, within a shell script, to get multiple package dependencies for checkinstall to work.
PAK_USER='. , ? ! : + - ^ _ { } = $ % @ [ ] / ; # & * ~ ( ) < > \ |'
PAK_NEEDS='. , ? ! : + - ^ _ { } = $ % @ [ ] / ; # & * ~ ( ) < > \ |'
PAK_NEEDS=$(echo "$PAK_NEEDS" | perl -pe 's/([[:punct:]])/\\\1/g')
0 - Maintainer: [ . , ? ! : + - ^ _ { } = $ % @ [ ] / ]
1 - Summary: [ This is a punctuation escape test. ]
10 - Requires: [ . , ? ! : + - ^ _ { } = $ % @ [ ] / ; # & * ~ ( ) < > \ | ]
The ones that needs escaping appear to be shell operators ; # & * ~ ( ) < > \ |
Some will return a value * ~
terminate the line ; #
or wipe everything out ( ) < > | &
while \
disappears since it's the escape character.
The regex perl -pe 's/([[:punct:]])/\\\1/g'
escapes all the punctuation characters which is overkill but works quite well. Single and Double Quotes are already problematic, along with $
, which will expand unless surrounded by single-quotes.
If you don't want to think about escaping, use the regex and caution with ' " $
.
PAK_NEEDS="libasound2 (>= 1.0.16), libavcodec57 (>= 7:3.4.2) | libavcodec-extra57 (>= 7:3.4.2), libavformat57 (>= 7:3.4.2), libavutil55 (>= 7:3.4.2), libboost-filesystem1.65.1, libboost-system1.65.1, libc6 (>= 2.27), libcurl4 (>= 7.16.2), libexpat1 (>= 2.0.1), libgcc1 (>= 1:3.0), libgl1, libglu1-mesa | libglu1, libmad0 (>= 0.15.1b-3), libsdl2-2.0-0 (>= 2.0.8), libsdl2-image-2.0-0 (>= 2.0.2), libsdl2-net-2.0-0 (>= 2.0.1), libsdl2-ttf-2.0-0 (>= 2.0.14), libsndfile1 (>= 1.0.20), libspeex1 (>= 1.2~beta3-1), libspeexdsp1 (>= 1.2~beta3.2-1), libstdc++6 (>= 5.2), libswscale4 (>= 7:3.4.2), libvorbisfile3 (>= 1.1.2), libzzip-0-13 (>= 0.13.56), zlib1g (>= 1:1.1.4)"
PAK_NEEDS=$(echo "$PAK_NEEDS" | perl -pe 's/([[:punct:]])/\\\1/g')
10 - Requires: [ libasound2 (>= 1.0.16), libavcodec57 (>= 7:3.4.2) | libavcodec-extra57 (>= 7:3.4.2), libavformat57 (>= 7:3.4.2), libavutil55 (>= 7:3.4.2), libboost-filesystem1.65.1, libboost-system1.65.1, libc6 (>= 2.27), libcurl4 (>= 7.16.2), libexpat1 (>= 2.0.1), libgcc1 (>= 1:3.0), libgl1, libglu1-mesa | libglu1, libmad0 (>= 0.15.1b-3), libsdl2-2.0-0 (>= 2.0.8), libsdl2-image-2.0-0 (>= 2.0.2), libsdl2-net-2.0-0 (>= 2.0.1), libsdl2-ttf-2.0-0 (>= 2.0.14), libsndfile1 (>= 1.0.20), libspeex1 (>= 1.2~beta3-1), libspeexdsp1 (>= 1.2~beta3.2-1), libstdc++6 (>= 5.2), libswscale4 (>= 7:3.4.2), libvorbisfile3 (>= 1.1.2), libzzip-0-13 (>= 0.13.56), zlib1g (>= 1:1.1.4) ]
1.6.2
I can't seem to get the>=
to be working,=
is fine. – Illhumored