diff options
author | Richard Jones <rjones@redhat.com> | 2010-03-01 13:32:34 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-03-01 13:32:34 +0000 |
commit | 457fccae1b665347f81045e8c7a3309d8328c4fc (patch) | |
tree | 3918afa58fac5bc33fb0f84e8c39b276a4eb8dcb | |
parent | afcb3695b6ce9036f8a531745e254f146507f2a0 (diff) | |
download | libguestfs-457fccae1b665347f81045e8c7a3309d8328c4fc.tar.gz libguestfs-457fccae1b665347f81045e8c7a3309d8328c4fc.tar.xz libguestfs-457fccae1b665347f81045e8c7a3309d8328c4fc.zip |
build: Fix for bash quoting in supermin-split.sh.in (RHBZ#566511 RHBZ#566512)
Bash changed how the =~ operator worked, see bash FAQ question
E14 http://tiswww.case.edu/php/chet/bash/FAQ and
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487387#25
(RHBZ#566511).
This also stops stray "builddir" (yum database) files being
incorporated into supermin hostfiles in Koji (RHBZ#566512).
-rwxr-xr-x | appliance/supermin-split.sh.in | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/appliance/supermin-split.sh.in b/appliance/supermin-split.sh.in index c710dc3b..753fca37 100755 --- a/appliance/supermin-split.sh.in +++ b/appliance/supermin-split.sh.in @@ -51,17 +51,28 @@ for path in $(find -not -name fakeroot.log); do dir=$(dirname "$path") file=$(basename "$path") + # For quoting problems with the bash =~ operator, see bash FAQ + # question E14 here http://tiswww.case.edu/php/chet/bash/FAQ and + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487387#25 + # (RHBZ#566511). + # All we're going to keep are the special files /init, the daemon, # configuration files (/etc), devices and modifiable stuff (/var). if [ "$path" = "./init" -o "$file" = "guestfsd" ]; then echo "$path" >&5 - elif [[ "$path" =~ '^\./etc' || "$path" =~ '^./dev' || "$path" =~ '^\./var' ]]; then + elif [[ "$path" =~ ^\./etc || "$path" =~ ^\./dev || "$path" =~ ^\./var ]] + then echo "$path" >&5 # Kernel modules are always copied in from the host, including all # the dependency files. - elif [[ "$path" =~ '^\./lib/modules/' ]]; then + elif [[ "$path" =~ ^\./lib/modules/ ]]; then + : + + # On mock/Koji, exclude bogus /builddir directory which for some + # reason contains some yum temporary files (RHBZ#566512). + elif [[ "$path" =~ ^\./builddir ]]; then : elif [ -d "$path" ]; then @@ -71,27 +82,27 @@ for path in $(find -not -name fakeroot.log); do # Some libraries need fixed version numbers replaced by wildcards. - elif [[ "$file" =~ '^ld-[.0-9]+\.so$' ]]; then + elif [[ "$file" =~ ^ld-[.0-9]+\.so$ ]]; then echo "$dir/ld-*.so" >&6 # Special case for libbfd - elif [[ "$file" =~ '^libbfd-.*\.so$' ]]; then + elif [[ "$file" =~ ^libbfd-.*\.so$ ]]; then echo "$dir/libbfd-*.so" >&6 # Special case for libgcc_s-<gccversion>-<date>.so.N - elif [[ "$file" =~ '^libgcc_s-.*\.so\.([0-9]+)$' ]]; then + elif [[ "$file" =~ ^libgcc_s-.*\.so\.([0-9]+)$ ]]; then echo "$dir/libgcc_s-*.so.${BASH_REMATCH[1]}" >&6 # libfoo-1.2.3.so - elif [[ "$file" =~ '^lib(.*)-[-.0-9]+\.so$' ]]; then + elif [[ "$file" =~ ^lib(.*)-[-.0-9]+\.so$ ]]; then echo "$dir/lib${BASH_REMATCH[1]}-*.so" >&6 # libfoo-1.2.3.so.1.2.3 (but NOT '*.so.N') - elif [[ "$file" =~ '^lib(.*)-[-.0-9]+\.so\.([0-9]+)\.' ]]; then + elif [[ "$file" =~ ^lib(.*)-[-.0-9]+\.so\.([0-9]+)\. ]]; then echo "$dir/lib${BASH_REMATCH[1]}-*.so.${BASH_REMATCH[2]}.*" >&6 # libfoo.so.1.2.3 (but NOT '*.so.N') - elif [[ "$file" =~ '^lib(.*)\.so\.([0-9]+)\.' ]]; then + elif [[ "$file" =~ ^lib(.*)\.so\.([0-9]+)\. ]]; then echo "$dir/lib${BASH_REMATCH[1]}.so.${BASH_REMATCH[2]}.*" >&6 else |