]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- add -f EXTENSION and -i to undos macro
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 26 May 2010 21:56:10 +0000 (21:56 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm.macros -> 1.565

rpm.macros

index 23a8078c9fc0cac2c8fe201832bebcc117e48a89..b7b9127327b953a04be9d36b2b73a72d5d17c9e6 100644 (file)
@@ -1823,16 +1823,30 @@ else: \
 # Undos files
 #
 # Author: Paweł Zuzelski <pawelz@pld-linux.org>
+# Author: Elan Ruusamäe <glen@pld-linux.org>
 #
 # Usage:
 #   %undos list_of_files
+#   %undos -f EXT[,EXT]
+#   %undos -i -f EXT[,EXT]
+#
+#  -f EXT[,EXT] - find(1) files by extensions
+#  -i - case insensitive file search
+#
+# Example:
+#   Un-DOS all *.js, *.css files
+#   %undos -f js,css
+#   Un-DOS all *.js, *.JS files
+#   %undos -f js -i
+#   undos all Makefiles
+#   %{__find} -name Makefile | xargs %undos
 #
 # Requirements:
 # BuildRequires:       sed >= 4.0
 # BuildRequires:       rpmbuild(macros) >= 1.553
 
-# NB: make sure this command stays on one line
-%undos         %{__sed} -i -e 's,\\r$,,'
+# NB: make sure this macro stays on one line
+%undos(f:i)    %{-f:%{__find} -regextype posix-extended -%{-i:i}regex '^.+\\.(%(echo %{-f*} | tr ',' '|'))$' -print0 | xargs -0} %{__sed} -i -e 's,\\r$,,'
 
 # Hook to register nagios object based plugins in Nagios NRPE daemon config.
 #
This page took 0.082211 seconds and 4 git commands to generate.