Bug 485654 - prelink cron script uses brace expansion bashism
Summary: prelink cron script uses brace expansion bashism
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: prelink
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-16 00:45 UTC by Mike Frysinger
Modified: 2009-02-17 19:03 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-02-17 12:41:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mike Frysinger 2009-02-16 00:45:56 UTC
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
 elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
@@ -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
 fi

Comment 1 Jakub Jelinek 2009-02-16 09:31:27 UTC
Just use a sane shall instead.

Comment 2 Mike Frysinger 2009-02-16 18:19:56 UTC
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 12:41:21 UTC
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 19:03:01 UTC
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.