m-ab-s / media-autobuild_suite

This Windows Batchscript helps setup a Mingw-w64 compiler environment for building ffmpeg and other media tools under Windows.
GNU General Public License v3.0
1.55k stars 266 forks source link

A question about media-suite_compile.sh #161

Closed pat357 closed 9 years ago

pat357 commented 9 years ago

Not an issue, this time, just a 2 questions:

  1. in "media-suite_compile.sh" sed -ri "s/ ?--(target-os|prefix|bindir|extra-(cflags|libs))=(\S+|'[^']+')//g" config.h
    What stands the backquoted S (\S) for ? Spaces ? A selection ? You don't gave to explain extended regular expressions, just what \S+ is.
  2. Concerning the MSys updates I mentioned earlier (these that broke D3D11 ...) I reinstalled the older files (see my previous post) and DXVA/D3D11 is back in ffmpeg. How can I prevent that the updated are reinstalled when I update ? How to make some kind of a blacklist for these updates ?

Thanks for your answer !

wiiaboo commented 9 years ago

What stands the backquoted S (\S) for ? Spaces ? A selection ? You don't gave to explain extended regular expressions, just what \S+ is.

\S is the same as [^\s], which is the same as [\w], or "any character that's not whitespace".

How to make some kind of a blacklist for these updates ?

See /etc/pacman.conf and add the relevant packages to (I think) IgnorePkg. But if you run pacman -S <package> it will still try to update it, since you're being explicit. You can update the packages now anyway. Only thing that's missing is D3D11VA. DXVA2 works fine and is what mpv and lavfilters use. D3D11VA is basically the same of DXVA2 afaik.

pat357 commented 9 years ago

so [^ ]+ (1 or more no spaces) and [^ ][^ ]is the same as /S+ ? It means 1 or more not spaces ?

pat357 commented 9 years ago

The 2nd one should be [^ ][^ ]* . (with a * behind)

wiiaboo commented 9 years ago

Yes. + for one or more, * for zero or more, ? for zero or one. To use + without escaping you need -r option in sed. There's also the {n,n} if you want to control repetitions more exactly. Dunno if it works with sed. Ex: \d{1,3} which is equivalent to \d\d?\d?.

Also, \s is not just spaces, it also grabs TABs and newlines.

pat357 commented 9 years ago

The rest of the ERE: |'[^']+')//g Where comes the | out ? Is "|" just a literal or has it maybe also another meaning... ? I see no matches for | or am I missing something ?

pat357 commented 9 years ago

Do you maybe have a good url about Extended RE's ?

pat357 commented 9 years ago

Now I see it : (...a...| ...b..) :+1: means a or b . I got it now ;-)

wiiaboo commented 9 years ago

| separates an alternative match You can test and learn about regex in many sites. I use http://www.regexr.com/ and https://regex101.com/