Page 2 of 2

Re: No txz2dir in 3.1 Porteus ?

Posted: 24 Aug 2016, 17:36
by Jack
francois wrote:Yes there was I am almost sure in 2.x.
I'm going to look for it. I don't know why it was delete.
EDIT:
I unpack all of those. Well I check 1.0, 1.1, 1.2, 2.0, 2.1, 3.0, 3.0.1 and 3.1 and there is no txz2dir.
EDIT:2
I guest you could use this.

Code: Select all

ROOT=/path/to/folder installpkg -terse *.txz

Re: No txz2dir in 3.1 Porteus ?

Posted: 25 Aug 2016, 00:08
by Rava
francois wrote:Yes there was I am almost sure in 2.x.
And it should not be that hard to get back, at least I root for it...

Done on, say, 15 modules, with any other means, module sized several MB each, it's quite the overkill, when all we need really is

Code: Select all

xzm2dir /path/*
See?

Re: No txz2dir in 3.1 Porteus ?

Posted: 25 Aug 2016, 00:37
by Jack
Just ask brokenman if there was but I did unpack them today and see any txz2dir in none I did.

Re: No txz2dir in 3.1 Porteus ?

Posted: 25 Aug 2016, 03:35
by brokenman
Here is a script to decompress multiple package (or a directory of packages) into a given directory. Will include it in rc5.
It is only compatible with Porteus-v3.2+

txz2dir

Code: Select all

#!/bin/bash

# Script to decompress multiple slakware packages to a dir
# Author: brokenman@portues.org
# August 25th 2016

. /usr/share/porteus/porteus-functions
get_colors
echo

CWD=`pwd`
usage(){
	echo
echo "Usage:"
bold "$0 /path/to/slackware-package.txz /path/to/dir"
bold "$0 /path/to/folder/of/packages /path/to/dir"
echo
exit
}

ARGNUM=$#

# Check input
[ -z $1 ] && usage
[ $# -lt 2 ] && { red "A target dir must be supplied"; usage; }
case $1 in
    -h|--help)
    usage ;;
esac

ARGS=${@:1:$(($#-1))}
LASTARG=${@: -1}
[ -e $1 ] && SRC=FILE
[ -d $1 ] && SRC=DIR
[ -z $SRC ] && { red "$1 does not appear to exist."; usage; }
[ ! -d $LASTARG ] && { red "$LASTARG is not a valid directory."; usage; }
[ ! -w $LASTARG ] && { red "$LASTARG is not writable."; usage; }

# Make variable with source files
if [ "$SRC" = DIR ]; then
	FILES=`find $1 -type f | egrep "*.tgz|*.txz"`
	[[ -z $FILES ]] && { red "$1 does not contain any slackware packages."; usage; }
else
	FILES=${@:1:$(($#-1))}
fi

# Go through packages and extract them
for a in $FILES; do
	file $a | egrep -qo "gzip compressed data|XZ compressed data" || { bold "${a##*/} is not a slackware package. Skipping."; continue; }
	installpkg --terse --root $LASTARG $a
done

Re: No txz2dir in 3.1 Porteus ?

Posted: 25 Aug 2016, 03:44
by ncmprhnsbl
@brokenman nice one (:
was just about to draw attention to the 'installpkg --terse --root' command :lol: (already mentioned by others :oops: )

Re: No txz2dir in 3.1 Porteus ?

Posted: 25 Aug 2016, 13:08
by Jack
francois wrote:@jack, see sitwon script:
convert Slackware's TGZ (or TXZ) package into .xzm compressed file
https://github.com/Sitwon/Porteus/blob/ ... ts/txz2xzm

Code: Select all

#!/bin/bash
# convert Slackware's TGZ (or TXZ) package into .xzm compressed file
# which can be used as a LiveCD module
#
# Author: Tomas M. <http://www.linux-live.org>
# Modifications for Porteus by fanthom
# Switch to root
if [ "$DISPLAY" ]; then
if [ `whoami` != "root" ]; then
mod=`readlink -f $1`
mod2=`readlink -f $2`
xterm -T "Please enter root's password below" -e su - -c "/opt/porteus-scripts/txz2xzm $mod $mod2"
exit
fi
else
if [ `whoami` != "root" ]; then
echo "Please enter root's password below"
mod=`readlink -f $1`
mod2=`readlink -f $2`
su - -c "/opt/porteus-scripts/txz2xzm $mod $mod2"
exit
fi
fi
if [ "$1" = "" -o "$2" = "" ]; then
echo
echo "Convert Slackware's TXZ package into .xzm compressed module"
echo "usage: $0 source_filename.txz output_file.xzm"
exit 1
fi
PATH=.:$(dirname $0):/usr/lib:$PATH
. liblinuxlive || exit 1
TMPDIR=/tmp/txz2xzm$$
installpkg -root $TMPDIR $1
if [ $? != 0 ]; then echo "error installing package"; exit; fi
# optimalization procedures, this doesn't hurt
find $TMPDIR/usr{/local,/}{man,info} -type l -name "*.gz" 2>/dev/null | xargs -r gunzip -f
find $TMPDIR/usr{/local,/}{man,info} -type f -name "*.gz" 2>/dev/null | xargs -r gunzip
rm -f $TMPDIR/{usr,usr/local,var}/man/cat*/*
create_module $TMPDIR "$2"
if [ $? != 0 ]; then echo "error building compressed image"; exit; fi
rm -Rf $TMPDIR
I know those were there but txz2dir was not. Or I must not be seeing it.

Re: No txz2dir in 3.1 Porteus ?

Posted: 25 Aug 2016, 13:15
by Bogomips
Not sure if going round in circle or in spiral. :Search:
ncmprhnsbl wrote:was just about to draw attention to the 'installpkg --terse --root' command
Languishing in Tutorials: http://forum.porteus.org/viewtopic.php? ... 841#p27635

Re: No txz2dir in 3.1 Porteus ?

Posted: 25 Aug 2016, 13:21
by wread
There wasn't any txz2dir as far as I can remember. But there was Ark to do the same, long ago :D

Re: No txz2dir in 3.1 Porteus ?

Posted: 25 Aug 2016, 13:23
by Jack
I won't say anymore on this cause brokenman has just release txz2dir and I made a copy of his script.