summaryrefslogtreecommitdiff
path: root/test/make-tar.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/make-tar.sh')
-rwxr-xr-xtest/make-tar.sh38
1 files changed, 20 insertions, 18 deletions
diff --git a/test/make-tar.sh b/test/make-tar.sh
index df4b66aadab6..8bd8f1e53bce 100755
--- a/test/make-tar.sh
+++ b/test/make-tar.sh
@@ -1,7 +1,7 @@
#!/bin/sh
-# $Id: make-tar.sh,v 1.21 2022/11/05 19:41:33 tom Exp $
+# $Id: make-tar.sh,v 1.23 2025/06/20 19:38:25 tom Exp $
##############################################################################
-# Copyright 2019-2021,2022 Thomas E. Dickey #
+# Copyright 2019-2022,2025 Thomas E. Dickey #
# Copyright 2010-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@@ -62,10 +62,12 @@ grep_patchdate() {
# The rpm spec-file in the ncurses tree is a template. Fill in the version
# information from dist.mk
edit_specfile() {
+ RPM_DATE=`date +'%a %b %d %Y' -d "$NCURSES_PATCH"`
sed \
-e "s/\\<MAJOR\\>/$NCURSES_MAJOR/g" \
-e "s/\\<MINOR\\>/$NCURSES_MINOR/g" \
- -e "s/\\<YYYYMMDD\\>/$NCURSES_PATCH/g" "$1" >"$1.new"
+ -e "s/\\<YYYYMMDD\\>/$NCURSES_PATCH/g" \
+ -e "s/\\<RPM_DATE\\>/$RPM_DATE/g" "$1" >"$1.new"
chmod u+w "$1"
mv "$1.new" "$1"
same_timestamp "$1"
@@ -74,7 +76,7 @@ edit_specfile() {
make_changelog() {
[ -f "$1" ] && chmod u+w "$1"
cat >"$1" <<EOF
-`echo $PKG_NAME|tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` ($NCURSES_MAJOR.$NCURSES_MINOR+$NCURSES_PATCH) unstable; urgency=low
+`echo "$PKG_NAME"|tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` ($NCURSES_MAJOR.$NCURSES_MINOR+$NCURSES_PATCH) unstable; urgency=low
* snapshot of ncurses subpackage for $PKG_NAME.
@@ -96,22 +98,22 @@ trap "cd /; rm -rf $BUILD; exit 1" 1 2 3 15
trap "cd /; rm -rf $BUILD; exit 0" 0
umask 077
-if ! ( mkdir $BUILD )
+if ! ( mkdir "$BUILD" )
then
echo "? cannot make build directory $BUILD"
fi
umask 022
-mkdir $BUILD/$ROOTNAME
+mkdir "$BUILD/$ROOTNAME"
-cp -p -r ./* $BUILD/$ROOTNAME/ || exit
+cp -p -r ./* "$BUILD/$ROOTNAME/" || exit
# Add the config.* utility scripts from the top-level directory.
for i in . ..
do
for j in COPYING config.guess config.sub install-sh tar-copy.sh
do
- [ -f $i/$j ] && cp -p $i/$j $BUILD/$ROOTNAME/
+ [ -f "$i/$j" ] && cp -p "$i/$j" "$BUILD/$ROOTNAME"/
done
done
@@ -130,20 +132,20 @@ cp -p "$SOURCE/NEWS" "$BUILD/$ROOTNAME"
# cleanup empty directories (an artifact of ncurses source archives)
-touch $BUILD/$ROOTNAME/MANIFEST
-( cd $BUILD/$ROOTNAME && find . -type f -print | "$SOURCE/misc/csort" >MANIFEST )
-same_timestamp $BUILD/$ROOTNAME/MANIFEST
+touch "$BUILD/$ROOTNAME"/MANIFEST
+( cd "$BUILD/$ROOTNAME" && find . -type f -print | "$SOURCE/misc/csort" >MANIFEST )
+same_timestamp "$BUILD/$ROOTNAME"/MANIFEST
-cd $BUILD || exit
+cd "$BUILD" || exit
# Remove build-artifacts.
find . -name RCS -exec rm -rf {} \;
-find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
-find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
-find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
+find "$BUILD/$ROOTNAME" -type d -exec rmdir {} \; 2>/dev/null
+find "$BUILD/$ROOTNAME" -type d -exec rmdir {} \; 2>/dev/null
+find "$BUILD/$ROOTNAME" -type d -exec rmdir {} \; 2>/dev/null
# There is no need for this script in the tar file.
-rm -f $ROOTNAME/make-tar.sh
+rm -f "$ROOTNAME"/make-tar.sh
# Remove build-artifacts.
find . -name "*.gz" -exec rm -rf {} \;
@@ -154,10 +156,10 @@ chmod -R u+w .
# Cleanup timestamps
[ -n "$TOUCH_DIRS" ] && "$TOUCH_DIRS" "$ROOTNAME"
-tar cf - $TAR_OPTIONS $ROOTNAME | gzip >"$DESTDIR/$ROOTNAME.tar.gz"
+tar cf - $TAR_OPTIONS "$ROOTNAME" | gzip >"$DESTDIR/$ROOTNAME.tar.gz"
cd "$DESTDIR" || exit
pwd
-ls -l $ROOTNAME.tar.gz
+ls -l "$ROOTNAME".tar.gz
# vi:ts=4 sw=4