summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author B. Watson <urchlay@slackware.uk>2023-06-01 02:38:02 -0400
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2023-06-03 10:38:37 +0700
commit4e158b736b4b96c334f76734c79c640df4f1178a (patch)
treee94e423d952e266fed44fae066e76d73d61c382b
parent9de00470fae28a7bb467f254dcc46c58020597ff (diff)
downloadslackbuilds-4e158b736b4b96c334f76734c79c640df4f1178a.tar.gz
slackbuilds-4e158b736b4b96c334f76734c79c640df4f1178a.tar.xz
system/a2tools: Fix compile warnings.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--system/a2tools/a2tools.SlackBuild25
-rw-r--r--system/a2tools/fix_warnings.diff21
2 files changed, 34 insertions, 12 deletions
diff --git a/system/a2tools/a2tools.SlackBuild b/system/a2tools/a2tools.SlackBuild
index 2722eec9ea..7688d71525 100644
--- a/system/a2tools/a2tools.SlackBuild
+++ b/system/a2tools/a2tools.SlackBuild
@@ -6,11 +6,13 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20230601 bkw: BUILD=2, fix compiler warnings.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=a2tools
VERSION=${VERSION:-003}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -33,16 +35,12 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
fi
set -e
@@ -51,16 +49,18 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
-unzip $CWD/$PRGNAM-v$VERSION.zip
+unzip $CWD/$PRGNAM-v$VERSION.zip -x '*.exe' '*.dos' '*.csh'
cd $PRGNAM
chown -R root:root .
-find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
- \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+chmod 644 *
+
+# 20230531 bkw: fix a couple of (probably harmless) compiler warnings.
+patch -p1 < $CWD/fix_warnings.diff
# It doesn't come with a Makefile, it comes with a csh script. Don't
# use it...
-gcc $SLKCFLAGS -DUNIX -Wall -o $PRGNAM $PRGNAM.c
+${CC:-gcc} $SLKCFLAGS -DUNIX -Wall -o $PRGNAM $PRGNAM.c
mkdir -p $PKG/usr/bin $PKG/usr/man/man6
install -s -m0755 $PRGNAM $PKG/usr/bin
gzip -9c < $PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
@@ -70,9 +70,10 @@ for link in a2ls a2in a2out a2rm; do
ln -s $PRGNAM.6.gz $PKG/usr/man/man6/$link.6.gz
done
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a LICENSE README $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
diff --git a/system/a2tools/fix_warnings.diff b/system/a2tools/fix_warnings.diff
new file mode 100644
index 0000000000..33ff698796
--- /dev/null
+++ b/system/a2tools/fix_warnings.diff
@@ -0,0 +1,21 @@
+diff -Naur a2tools/a2tools.c a2tools.patched/a2tools.c
+--- a2tools/a2tools.c 2001-04-10 00:18:01.000000000 -0400
++++ a2tools.patched/a2tools.c 2023-05-31 23:25:37.538490402 -0400
+@@ -541,7 +541,7 @@
+ void a2out (void) {
+ unsigned char listbuffer[256];
+ unsigned int hop, next_trk, next_sec, i, j;
+- void (*postproc_function)(void);
++ void (*postproc_function)(void) = NULL;
+ if (!dir_do(dir_find_name)) quit(6,"File not found.\n");
+ hop = begun = 0;
+ next_trk=dir_entry_data[0];
+@@ -817,7 +817,7 @@
+
+ /* prepare source filename by padding blanks */
+ i=0;
+- while(i<30 && a2_name[i]) padded_name[i]=a2_name[i++] & 0x7f;
++ while(i<30 && a2_name[i]) { padded_name[i]=a2_name[i] & 0x7f; i++; }
+ while(i<30) padded_name[i++]=' ';
+
+ /* get VTOC and check validity */