Bug 485654 - prelink cron script uses brace expansion bashism
prelink cron script uses brace expansion bashism
Product: Fedora
Classification: Fedora
Component: prelink (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2009-02-15 19:45 EST by Mike Frysinger
Modified: 2009-02-17 14:03 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-02-17 07:41:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mike Frysinger 2009-02-15 19:45:56 EST
the prelink.cron script uses this bashism:
  cp -a /var/lib/misc/prelink.{full,quick}

simple fix is to do the expansion manually:
Index: prelink.cron
RCS file: /cvs/pkgs/devel/prelink/prelink.cron,v
retrieving revision 1.5
diff -u -p -U 1 -r1.5 prelink.cron
--- prelink.cron        21 Jun 2006 10:07:33 -0000      1.5
+++ prelink.cron        16 Feb 2009 00:45:39 -0000
@@ -25,3 +25,3 @@ if [ ! -f /etc/prelink.cache -o -f /var/
   date > /var/lib/misc/prelink.full
-  cp -a /var/lib/misc/prelink.{full,quick}
+  cp -a /var/lib/misc/prelink.full /var/lib/misc/prelink.quick
@@ -41,3 +41,3 @@ else
   date > /var/lib/misc/prelink.full
-  cp -a /var/lib/misc/prelink.{full,quick}
+  cp -a /var/lib/misc/prelink.full /var/lib/misc/prelink.quick
Comment 1 Jakub Jelinek 2009-02-16 04:31:27 EST
Just use a sane shall instead.
Comment 2 Mike Frysinger 2009-02-16 13:19:56 EST
except for the part where you declared the shebang as /bin/sh.  if you do that, your code needs to be POSIX.  if you want to use bash, then change it to /bin/bash.
Comment 3 Jakub Jelinek 2009-02-17 07:41:21 EST
The prelink.cron script isn't part of the prelink tarball and is Fedora/RHEL specific.  In both Fedora and RHEL /bin/sh is always bash.
Comment 4 Mike Frysinger 2009-02-17 14:03:01 EST
yes, i know it's in the fedora/rhel cvs ... that's how i generated the patch.  i was attempting to post fixes to the script so that other people could use it.  if you start with this broken setup though, you make it pretty hard to convert /bin/sh to something that is POSIX-only.  but that is of course your choice.

Note You need to log in before you can comment on or make changes to this bug.