[FE training-materials-updates] gen-lab-archive: only chown when needed

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri May 22 17:57:24 CEST 2015

Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=1204f640cd79470c9d00bc3314426fff2efef77a


commit 1204f640cd79470c9d00bc3314426fff2efef77a
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date:   Fri May 22 17:56:07 2015 +0200

    gen-lab-archive: only chown when needed
    Only chown the lab-data directory when some tarballs have been
    extracted as root.
    I don't like to run stuff that need sudo password.
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>


 gen-lab-archive | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gen-lab-archive b/gen-lab-archive
index f7214c5..ad7d067 100755
--- a/gen-lab-archive
+++ b/gen-lab-archive
@@ -46,12 +46,16 @@ $RSYNC --exclude=.git -a --delete lab-data/$1/ $FELABS
 $ECHO "Extracting tar.xz archives (root permissions needed for device files)"
 for f in `$FIND $FELABS -name "*.tar.xz"`; do
 	$SUDO $TAR -C `dirname $f` -Jxf $f
 	$RM $f
+	tarball_extracted=yes
+if test "${tarball_extracted}" = "yes"; then
 $ECHO "Uncompressing other .xz files"
 $FIND $FELABS -name "*.xz" -exec $UNXZ {} ';'

More information about the training-materials-updates mailing list