mid-kid
8 years ago
2 changed files with 90 additions and 11 deletions
@ -0,0 +1,49 @@ |
|||||
|
#!/bin/sh -e |
||||
|
|
||||
|
# DISCLAIMER |
||||
|
# Don't ever think of installing every single package generated with this script. |
||||
|
# While it *should* not cause any problems, doing so is simply overkill, and not recommended in the least. |
||||
|
|
||||
|
if [ "$#" -lt 2 ]; then |
||||
|
echo "Usage: $0 <slackware> <slackware64>" 1>&2 |
||||
|
exit 1 |
||||
|
fi |
||||
|
|
||||
|
scriptdir="$(realpath "$(dirname "$0")")" |
||||
|
|
||||
|
slackware="$1" |
||||
|
slackware64="$2" |
||||
|
|
||||
|
find "$slackware" -type f -name "*.t?z" -printf '%P\n' | sort | while read -r pkg; do |
||||
|
# See /sbin/installpkg |
||||
|
pkgbase="$(echo "$pkg" | sed -e 's?.*/??;s/\.t[bglx]z$//')" |
||||
|
pkgext="$(echo "$pkg" | sed -e 's?.*/??;s/.*\.\(t[bglx]z\)$/\1/')" |
||||
|
pkgname="$(echo "$pkgbase" | sed -e 's?-[^-]*-[^-]*-[^-]*$??')" |
||||
|
pkgver="$(echo "$pkgbase" | sed -e 's?.*-\([^-]*\)-[^-]*-[^-]*$?\1?')" |
||||
|
pkgarch="$(echo "$pkgbase" | sed -e 's?.*-[^-]*-\([^-]*\)-[^-]*$?\1?')" |
||||
|
pkgbuild="$(echo "$pkgbase" | sed -e 's?.*-[^-]*-[^-]*-\([^-]*\)$?\1?')" |
||||
|
|
||||
|
case "$pkgarch" in |
||||
|
i?86) pkgarch=x86_64 ;; |
||||
|
*) continue ;; |
||||
|
esac |
||||
|
|
||||
|
pkg64="$(dirname "$pkg")/$pkgname-$pkgver-$pkgarch-$pkgbuild.$pkgext" |
||||
|
|
||||
|
if [ ! -f "$slackware64/$pkg64" ]; then |
||||
|
continue |
||||
|
fi |
||||
|
|
||||
|
rpkg="$(realpath "$slackware/$pkg")" |
||||
|
rpkg64="$(realpath "$slackware64/$pkg64")" |
||||
|
|
||||
|
mkdir -p "$(dirname "$pkg")" |
||||
|
|
||||
|
( cd "$(dirname "$pkg")" |
||||
|
"$scriptdir/convert32pkg.sh" "$rpkg" "$rpkg64" |
||||
|
) |
||||
|
done |
||||
|
|
||||
|
# if [ ! "$(tar tf "convert32-$pkgname-$pkgver-$pkgarch-$pkgbuild.$pkgext" | grep -v '^./\|^install/')" ]; then |
||||
|
# rm -f "convert32-$pkgname-$pkgver-$pkgarch-$pkgbuild.$pkgext" |
||||
|
# fi |
Loading…
Reference in new issue