Re: Progressbar for extracting Basefiles

2023-01-18 Diskussionsfäden Karsten Nordsiek

Please find included the both files I have changed.

Hint: you need to install pv in the nfsroot

Am 18.01.23 um 15:19 schrieb Karsten Nordsiek:

Yes that's working.

I have added the -f Option
Now it works as fine as it should

thx for the hint.

Regards


Karsten Nordsiek


Am 18.01.23 um 14:34 sch
rieb Thomas Lange:
On Wed, 18 Jan 2023 12:28:26 +0100, Karsten Nordsiek 
 said:
 >     -1   Use only first tar file matching 
class name.

 >     -c class[class]  Define classes (space separated).
Hmmm, it's hard to see what you have changed. A diff or git diff would
be much better to understand.

My first guess is to add -f to the pv call.

   -f, --force  output even if standard error is not a 
terminal


Inside FAI we redirect the output to a pipe which also does tee into a
file. Or you may try to force the output (does pv use stderr?) to
/dev/ttyN.
#! /bin/bash

#*
#
# ftar -- extract tar files using FAI classes
#
# This script is part of FAI (Fully Automatic Installation)
# Copyright (C) 2001-2017 Thomas Lange, la...@informatik.uni-koeln.de
# Universitaet zu Koeln
#
#*
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# A copy of the GNU General Public License is available as
# '/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
# can also obtain it by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#*

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
die() {

local e=$1   # first parameter is the exit code
shift

echo "ftar: $@" >&2 # print error message
exit $e
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
extract() {

local file=$1
local catname=$2

if [ $deletefiles -eq 1 ] ; then
  cd $target/$dir && rm -f  -- .* * 2>/dev/null
  deletefiles=0
fi

if [ $removedir -eq 1 ]; then
cd $target/$dir || die 4 "ERROR: cd to $target/$dir failed. Aborting."
[ $PWD = "/" ] && die 3 "WARNING: Will not do recursive removal of 
directory /"
rm -rf -- .* * 2>/dev/null
removedir=0
fi

if [ $progress -eq 1 ]; then

echo "ftar: extracting $file to $target/$dir" | tr -s '/'
$catname $file | pv -f -s $(du -sb $file | awk '{print $1}') | tar 
$xattrs --numeric-owner -C $target/$dir $vflag -xf -
else
echo "ftar: extracting $file to $target/$dir" | tr -s '/'
$catname $file | tar $xattrs --numeric-owner -C $target/$dir $vflag -xf 
-
tardone=1
# if option -1 is set, only one class will be used
[ $single -eq 1 ] && exit 0
fi

}

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
usage() {

cat <#! /bin/bash

#*
#
# subroutines -- useful subroutines for FAI
#
# This script is part of FAI (Fully Automatic Installation)
# (c) 2000-2021 by Thomas Lange, la...@informatik.uni-koeln.de
# Universitaet zu Koeln
# (c) 2001-2005 by Henning Glawe, gla...@physik.fu-berlin.de
# Freie Universitaet Berlin
#
#*
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# A copy of the GNU General Public License is available as
# `/usr/share/common-licences/GPL' in the Debian GNU/Linux distribution
# or on the World Wide Web at http://www.gnu.org/copyleft/gpl.html.  You
# can also obtain it by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#*

# source this file, then you have these function available in the shell

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
die() {

# echo comment and 

Re: Progressbar for extracting Basefiles

2023-01-18 Diskussionsfäden Karsten Nordsiek

Yes that's working.

I have added the -f Option
Now it works as fine as it should

thx for the hint.

Regards


Karsten Nordsiek


Am 18.01.23 um 14:34 sch
rieb Thomas Lange:

On Wed, 18 Jan 2023 12:28:26 +0100, Karsten Nordsiek  
said:

 >     -1   Use only first tar file matching class name.
 >     -c class[class]  Define classes (space separated).
Hmmm, it's hard to see what you have changed. A diff or git diff would
be much better to understand.

My first guess is to add -f to the pv call.

   -f, --force  output even if standard error is not a terminal

Inside FAI we redirect the output to a pipe which also does tee into a
file. Or you may try to force the output (does pv use stderr?) to
/dev/ttyN.



Re: Progressbar for extracting Basefiles

2023-01-18 Diskussionsfäden Thomas Lange
> On Wed, 18 Jan 2023 12:28:26 +0100, Karsten Nordsiek 
>  said:

>     -1   Use only first tar file matching class name.
>     -c class[class]  Define classes (space separated).
Hmmm, it's hard to see what you have changed. A diff or git diff would
be much better to understand.

My first guess is to add -f to the pv call.

  -f, --force  output even if standard error is not a terminal

Inside FAI we redirect the output to a pipe which also does tee into a
file. Or you may try to force the output (does pv use stderr?) to
/dev/ttyN.

-- 
viele Grüße Thomas