Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Kubuntu User (http://www.linux-archive.org/kubuntu-user/)
-   -   Fix unpack_updates_img argument handling (#811979) (http://www.linux-archive.org/kubuntu-user/670209-fix-unpack_updates_img-argument-handling-811979-a.html)

Will Woods 05-23-2012 07:32 PM

Fix unpack_updates_img argument handling (#811979)
 
unpack_updates_img takes one or two arguments - the image (required),
and the output dir (optional, defaults to "/updates").

That should be: outdir="${2:-/updates}"
Instead we had: outdir="${2:+/updates}"

Which means "outdir is empty unless $2 is set, then it's /updates".
Definitely not what we wanted.
---
dracut/anaconda-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index a045bab..212e6b7 100755
--- a/dracut/anaconda-lib.sh
+++ b/dracut/anaconda-lib.sh
@@ -100,7 +100,7 @@ anaconda_auto_updates() {

# Unpack an image into the given dir.
unpack_updates_img() {
- local img="$1" tmpdir="/tmp/${1##*/}.$$" outdir="${2:+/updates}"
+ local img="$1" tmpdir="/tmp/${1##*/}.$$" outdir="${2:-/updates}"
# NOTE: unpack_img $img $outdir can clobber existing subdirs in $outdir,
# which is why we use a tmpdir and copytree (which doesn't clobber)
unpack_img $img $tmpdir
--
1.7.10.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 11:45 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.