From ac4391c6ffad3de54d6bd6515378ff781ed37987 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 23 Apr 2017 13:31:43 +0200 Subject: [PATCH] Some updates I guess --- binutils-ROCKET.TXT | 2 -- convert32-supported | 1 + convert32pkg.sh | 48 +++++++++++++++++++++++++++------------------ glib2-ROCKET.TXT | 2 -- gtk+2-ROCKET.TXT | 2 -- kernel.SlackBuild | 3 ++- massconvert32.sh | 20 ++++++++++++------- readme.txt | 15 ++++++++++---- update-repo.sh | 3 ++- 9 files changed, 58 insertions(+), 38 deletions(-) delete mode 100644 binutils-ROCKET.TXT delete mode 100644 glib2-ROCKET.TXT delete mode 100644 gtk+2-ROCKET.TXT diff --git a/binutils-ROCKET.TXT b/binutils-ROCKET.TXT deleted file mode 100644 index eee4558..0000000 --- a/binutils-ROCKET.TXT +++ /dev/null @@ -1,2 +0,0 @@ -Modifications: -- Apply a fix for https://sourceware.org/bugzilla/show_bug.cgi?id=19775. diff --git a/convert32-supported b/convert32-supported index 03b7d3f..1bfeae0 100644 --- a/convert32-supported +++ b/convert32-supported @@ -14,6 +14,7 @@ mpg123 # d libtool +llvm # l alsa-lib diff --git a/convert32pkg.sh b/convert32pkg.sh index 400f364..2663f12 100755 --- a/convert32pkg.sh +++ b/convert32pkg.sh @@ -24,7 +24,7 @@ pkgbuild="$(echo "$pkgbase" | sed -e 's?.*-[^-]*-[^-]*-\([^-]*\)$?\1?')" case "$pkgarch" in i?86) pkgarch=x86_64 ;; *) - echo "Unknown package architecture '$pkgarch'. Can't proceed." 1>&2 + echo "Unsupported package architecture '$pkgarch'. Can't proceed." 1>&2 exit 1 ;; esac @@ -49,8 +49,9 @@ explodepkg "$pkg32" if [ "$pkg64" ]; then echo echo "Removing files:" - $tool -cd "$pkg64" | tar-1.13 t | grep -v "^install/" | while read -r file; do - rm -vf "./$file" 2> /dev/null || true + $tool -cd "$pkg64" | tar-1.13 t | grep -v '^install/' | while read -r file; do + echo "./$file" + rm -f "./$file" 2> /dev/null || true done else if [ ! -f "$pkginfo" ]; then @@ -59,23 +60,24 @@ else fi # See /sbin/removepkg - if fgrep "./" "$pkginfo" 1> /dev/null 2>&1; then - TRIGGER="^\.\/" + if fgrep './' "$pkginfo" 1> /dev/null 2>&1; then + TRIGGER='^\.\/' else - TRIGGER="FILE LIST:" + TRIGGER='FILE LIST:' fi echo - echo "Removing files:" - sed -n "/$TRIGGER/,/^$/p" "$pkginfo" | fgrep -v "FILE LIST:" | grep -v "^install/" | while read -r file; do - rm -vf "./$file" 2> /dev/null || true + echo 'Removing files:' + sed -n "/$TRIGGER/,/^$/p" "$pkginfo" | fgrep -v 'FILE LIST:' | grep -v '^install/' | while read -r file; do + echo "./$file" + rm -f "./$file" 2> /dev/null || true done fi # Clean empty directories echo -echo "Empty directories:" -find . -mindepth 1 -type d -empty -print -delete +echo 'Empty directories:' +find . -type d -empty -print -delete # Remove all symlinks present in the 64bit package if [ -f install/doinst.sh ]; then @@ -107,16 +109,24 @@ if [ -f install/doinst.sh ]; then fi # Extract all lines treating with symlinks. See /sbin/removepkg - sed -n -e 's,^[ ]*( [ ]*cd[ ]* .* [ ]*; [ ]*\(rm\|ln\) [ ]*-\(rf\|sf\)[ ]* .* [ ]*)[ ]*$,&,p' -e 's,^[ ]*config .*[ ]*,&,p' install/doinst.64 > install/doinst + sed -n -e 's,^[ ]*( [ ]*cd[ ]* .* [ ]*; [ ]*\(rm\|ln\) [ ]*-\(rf\|sf\)[ ]* .* [ ]*)[ ]*$,&,p' -e 's,^[ ]*config .*[ ]*$,&,p' install/doinst.64 > install/doinst + rm install/doinst.64 echo - echo "Removed lines in doinst.sh:" - fgrep -xf install/doinst install/doinst.sh || true + echo 'Removed lines in doinst.sh:' + if [ -s install/doinst ]; then + fgrep -xf install/doinst install/doinst.sh || true + + # Remove all symlinks present in the 64bit package + fgrep -vxf install/doinst install/doinst.sh > install/doinst.sh.new || true + mv install/doinst.sh.new install/doinst.sh - # Remove all symlinks present in the 64bit package - fgrep -vxf install/doinst install/doinst.sh > install/doinst.sh.new || true - mv install/doinst.sh.new install/doinst.sh - rm -f install/doinst install/doinst.64 + # If the resulting doinst.sh is empty, remove it. + if [ ! -s install/doinst.sh ]; then + rm install/doinst.sh + fi + fi + rm install/doinst fi # Rename package in slack-desc @@ -126,7 +136,7 @@ fi if ! find . | grep -v '^.$\|^./install' > /dev/null; then echo - echo "Package is empty. Not running makepkg." 1>&2 + echo 'Package is empty. Not running makepkg.' 1>&2 exit 0 fi diff --git a/glib2-ROCKET.TXT b/glib2-ROCKET.TXT deleted file mode 100644 index 729b3e1..0000000 --- a/glib2-ROCKET.TXT +++ /dev/null @@ -1,2 +0,0 @@ -Modifications: -- Applied glib-thumbnailer.patch which is required by the patched gtk+2. Requires tumbler. diff --git a/gtk+2-ROCKET.TXT b/gtk+2-ROCKET.TXT deleted file mode 100644 index 754f6b1..0000000 --- a/gtk+2-ROCKET.TXT +++ /dev/null @@ -1,2 +0,0 @@ -Modifications: -- Applied gtk2-filechooser-icon-view.patch which adds support for an icon view. diff --git a/kernel.SlackBuild b/kernel.SlackBuild index 5019a49..0b93161 100755 --- a/kernel.SlackBuild +++ b/kernel.SlackBuild @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e PKGNAM=${PKGNAM:-linux} BASEVER=${BASEVER:-4.4.29} diff --git a/massconvert32.sh b/massconvert32.sh index 5ea9464..335ff78 100755 --- a/massconvert32.sh +++ b/massconvert32.sh @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e # DISCLAIMER # Don't ever think of installing every single package generated with this script. @@ -22,7 +23,6 @@ find "$slackware" -type f -name "*.t?z" -printf '%P\n' | sort | while read -r pk 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?')" if [ "$whitelist" ]; then if ! grep -v '^#' "$whitelist" | fgrep -xq "$pkgname"; then @@ -32,17 +32,23 @@ find "$slackware" -type f -name "*.t?z" -printf '%P\n' | sort | while read -r pk case "$pkgarch" in i?86) pkgarch=x86_64 ;; - *) continue ;; + # Architecture-independent stuff + noarch|fw) continue ;; + # Only kernel-headers uses x86 as pkgarch. That doesn't need conversion. + x86) continue ;; + *) + echo "WARNING: Package '$pkg' has an unsupported architecture: '$pkgarch'" + exit + ;; esac - pkg64="$(dirname "$pkg")/$pkgname-$pkgver-$pkgarch-$pkgbuild.$pkgext" - - if [ ! -f "$slackware64/$pkg64" ]; then + if [ ! -f "$slackware64/$(dirname "$pkg")/$pkgname-$pkgver-$pkgarch-"*".$pkgext" ]; then + echo "WARNING: Package '$pkg' doesn't exist in slackware64, or there were multiple with different build versions." continue fi rpkg="$(realpath "$slackware/$pkg")" - rpkg64="$(realpath "$slackware64/$pkg64")" + rpkg64="$(realpath "$slackware64/$(dirname "$pkg")/$pkgname-$pkgver-$pkgarch-"*".$pkgext")" mkdir -p "$(dirname "$pkg")" diff --git a/readme.txt b/readme.txt index d3ef128..6122f61 100644 --- a/readme.txt +++ b/readme.txt @@ -1,8 +1,15 @@ This repo contains all my slackware modifications of the base install. Additional packages are contained in RocketLinux and built in a non-standard manner. +This branch contains a few scripts I use to manage things. -This branch contains general bookkeeping information about the entire repo. - -Right now, it's populated by .TXT files, containing ideas I will later implement. -There's also a kernel.SlackBuild, which I could use to build a new, nearly-identical slackware kernel. +- kernel.SlackBuild is capable of building a near-identical slackware kernel +- convert32pkg.sh converts a 32bit package to be installable on 64bit (by + removing everything present in the 64bit package). + It is only designed to support some packages in the official slackware iso, + because there's all kinds of packages that need special treatment, + especially for their doinst.sh scripts. +- massconvert32.sh calls convert32pkg.sh over an entire package directory +- update-repo.sh is my shitty implementation of a slackware repo generator, + that tries to generate everything as close to the official slackware repo as + possible. diff --git a/update-repo.sh b/update-repo.sh index 73c3e81..5dd6043 100755 --- a/update-repo.sh +++ b/update-repo.sh @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e gpgkey='' timestamp="$(LC_ALL=C date -u)"