General TC > Programming & Scripting - Unofficial

Quick hack to convert Debian packages.

<< < (8/9) > >>

Misalf:
Works here.
Does the message "Install the squashfs-tools package before proceeding." still show up after

--- Code: ---tce-load -i squashfs-tools.tcz

--- End code ---
?

marttt:

--- Quote from: Misalf on August 16, 2016, 10:41:29 AM ---Works here.
Does the message "Install the squashfs-tools package before proceeding." still show up after

--- Code: ---tce-load -i squashfs-tools.tcz

--- End code ---
?

--- End quote ---
For me it didnt. The script worked without errors (and saved me from despair). Thanks to the author!

xor:
Can we download "steam" with this!?

Mathimino:
hello, i know this chat is a long time ago but i can't seem to use the script

Green_goblin:
I updated the script with a few minor changes, it should work now:


--- Code: ---#!/bin/sh
# Create tce/tcz from Debian package
# Usage: $ deb2tcz packagename.deb packaganame.tcz

if [ `/usr/bin/id -u` -ne 0 ]; then
echo "Please run as root".
exit 1
fi

HERE=`pwd`
PKGDIR=/tmp/deb2tcz.1234
PKG="$PKGDIR"/pkg
FILE="$1"
APPNAME="$2"
INPUT=${FILE##*.}

[ -d "$PKGDIR" ] || mkdir -p "$PKGDIR"

make_tcz() {

mkdir -p "$PKG"
ar p "$FILE" data.tar.xz > "$PKGDIR"/data.tar.xz # unpack .deb
tar xf "$PKGDIR"/data.tar.xz -C "$PKG" # unpack .tar

[ -d "$PKG"/usr/share/doc ] && rm -r "$PKG"/usr/share/doc
[ -d "$PKG"/usr/share/man ] && rm -r "$PKG"/usr/share/man
[ -d "$PKG"/usr/share/menu ] && rm -r "$PKG"/usr/share/menu
cd "$PKG"
find . -type d -empty | xargs rmdir > /dev/null 2>&1
cd "$PKGDIR"
mksquashfs pkg "$HERE"/"$APPNAME" -noappend
cd "$HERE"
rm -r "$PKGDIR"
}



if [ ! -f /usr/local/tce.installed/findutils ]; then
echo "Install findutils.tcz before proceeding."
exit 1
fi

if [ ! `which mksquashfs` ]; then
echo "Install the squashfs-tools package before proceeding."
exit 1
fi



[ -z "$APPNAME" ] && echo "You must specify an extension name." && exit 1

[ -z "$1" ] && echo "You must specify a file."
if [ ! "$INPUT" == "deb" ] ; then
echo "Only Debian packages work with this."
exit 1
fi
EXT=${APPNAME##*.}
if [ `echo "$EXT" | grep "tcz"` 2>/dev/null ]; then
make_tcz
else
echo "You need to specify a tcz  for the output file."
exit 1
fi

if [ -f "$APPNAME" ]; then
echo "Success."
else
echo "Something went wrong."
fi
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version