Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 12 Dec 2017, 07:59
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to put a progress bar in dir2sfs? (Solved)
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 3 [33 Posts]   Goto page: Previous 1, 2, 3
Author Message
rg66


Joined: 23 Jul 2012
Posts: 1129
Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!

PostPosted: Wed 04 Oct 2017, 16:46    Post subject:  

belham2 wrote:
I just have one question: you wrote this above in an earlier message:

Code:
This also works for unsquashfs as well  Very Happy


Am I misunderstanding? I dropped one of the newly created .sfs files on the script to test the unsquashfs capabilitiy, and the script does nothing.

Was/Is the script meant to do unsquashing too just by dropping a .sfs on it? (I don't see unsquashfs commands in the script, so was trying to figure out what you meant when you wrote "this also works for unsquashfs as well...very happy".



P.S. Just found something weird...in Micko's latest Slacko64 (700-r3), on another machine at my desk here, the script does nothing. It won't launch at all, even though it is set up the same way with the same permissions as in X-Slacko-4.4. Weird, as it should easily run in 64-bit slacko because it's only a script after all, right? Surprised


Sorry belham2, I meant the code will also work with the unsquashfs command.

I've updated pac-tools with the new progress bar (attached below, just remove fake .gz and make sure it's executable) put it in /usr/bin. You can select as many sfs's as you want (as long as /tmp has enough space to extract them) and right click > repack-extract packages > extract. You can also put the new dir2sfs in /sbin and right click multiple folders > Convert to sfs. The right click options are in X-series and Carolina.

Slacko64 (700-r3) probably doesn't have yad so the script will fail. Also check if it has the script command, if not, download slackware util-linux from the repo.

Edit: pac-tools had a few typo's do to a sed accident Shocked, I've uploaded a new one, see below.
pac-tools.gz
Description  remove fake .gz
gz

 Download 
Filename  pac-tools.gz 
Filesize  5.16 KB 
Downloaded  11 Time(s) 

_________________
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
X-series repo

Last edited by rg66 on Fri 06 Oct 2017, 01:12; edited 1 time in total
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 2627
Location: holland

PostPosted: Wed 04 Oct 2017, 17:47    Post subject:  

Hi Belham, here's sfs2dir, basically the same as the last dir2sfs from rg66, but the other way around.
Unsquashes to directory name, same as the name of .sfs (but without the .sfs extension)

Code:
#!/bin/bash

[ ! -f "$1" ] && exit
DIR="${1%.*}"

if [ "$(echo "$1" | wc -w)" -gt 1 ]; then
  yad --window-icon="application-x-squashfs-image" --title="Rename File" --text="Remove blank spaces from\n<b>$(basename "$1")</b> \
and try again." --text-align="center" --borders="10" --width="220" --no-buttons --timeout="3"
exit
fi

if [ -d "$DIR" ];then
  yad --window-icon="application-x-squashfs-image" --title="Overwrite" --text="<b>$(basename $DIR)</b> already exists.\n Would you like to overwrite it?\n" \
  --text-align="center" --borders="10" --buttons-layout="center" --button="gtk-yes:0" --button="gtk-no:1"
  case $? in
    0) rm -rf "$DIR" ;;
    *) exit ;;
  esac
fi

(script -q -c "stty rows 40 cols 100; unsquashfs -d "$DIR" "$1"" | while read -n 50 LINE ; do
echo $LINE | busybox strings | egrep '[0-9]\%' | awk '{print $NF}'; done
) | Xdialog --title "Extracting Squashfile " --gauge "Extracting $(basename $1)\n\nPlease Wait..." 7 50 0
if [ $? -ne 0 ]; then
  killall unsquashfs
  rm -f typescript
  exit
fi

rm -f typescript
sync


Fred
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4764
Location: Kingwood, TX

PostPosted: Thu 12 Oct 2017, 00:00    Post subject:  

goingnuts and I did a progress bar implementation for tar here ... could probably be adapted
_________________
Check out my github repositories. I may eventually get around to updating my blogspot.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 3 of 3 [33 Posts]   Goto page: Previous 1, 2, 3
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0955s ][ Queries: 15 (0.0090s) ][ GZIP on ]