Introduce a new format for the automatically generated version field.

By extending it to a mandatory 8 digits and padding it with zeroes on the
right side it should be possible to avoid problems with version numbers
changing format.
This means  1.19.5->1.20 should be handled correctly now.

Add support for the new subsys.conf keyword (defalt/nodefault).

Flesh out the auto_rel function to help with release notes maintenance.
Added a relnotes.template.irix and make newpkg install a copy
into new sandboxes.
Also clean up newpkg a bit.

Fix a problem with the fix_man function and how to locate the man pages.
The problem was discoved when building gcc-3.4.1 into
$prefix=/usr/local/gcc-3.4.1 and still needing $topinstalldir
to be /usr/local. We now attempt to find any extra subdirs
needed by comparing $prefix and $topinstalldir.
This commit is contained in:
Tom G. Christensen 2004-07-19 20:38:22 +00:00
parent 08d497ad37
commit 410760a6d3
3 changed files with 78 additions and 14 deletions

View File

@ -39,9 +39,14 @@ usedepend=1 # Don't use depend file even if it's available
usescripts=1 # Don't add ops even if they're available usescripts=1 # Don't add ops even if they're available
ignore_unpackaged_files=0 # default to check for unpackaged files in the stage area ignore_unpackaged_files=0 # default to check for unpackaged files in the stage area
# ver_width controls the width of the pkgversion numbers created
# do *not* change this blindly
ver_width=8
# Comment these declarations to get it to run with ksh # Comment these declarations to get it to run with ksh
declare -a pc # Array of product categories (image.subsys) declare -a pc # Array of product categories (image.subsys)
declare -a pd # Array of matching descriptions declare -a pd # Array of matching descriptions
declare -a ps # Array of subsystem properties - default or nodefault
declare -a pctop # Array of toplevel product categories (image) declare -a pctop # Array of toplevel product categories (image)
declare -a pdtop # Array of matching descriptions declare -a pdtop # Array of matching descriptions
declare -a reqs # Array of subsystems with prereqs declare -a reqs # Array of subsystems with prereqs
@ -77,9 +82,13 @@ indent24=" "
# fix_ver(): "normalize" a version-pkgver pair # fix_ver(): "normalize" a version-pkgver pair
# params: $1=version # params: $1=version
# Removes any '.' and '-' characters from a version string # Removes any '.' and '-' characters from a version string
# It also extends the width to $ver_width by padding with zeroes on the
# right side
fix_ver() fix_ver()
{ {
local ver=`echo $1 | $SED -e 's/\.//g' -e 's/-//g' -e 's/[a-zA-Z]//g'` local ver=`echo $1 | $SED -e 's/\.//g' -e 's/-//g' -e 's/[a-zA-Z]//g'`
let "numpad = $ver_width - ${#ver}"
ver="$($PRINTF "%s%.0${numpad}u" $ver 0)"
echo $ver echo $ver
} }
# spec_header() # spec_header()
@ -109,10 +118,10 @@ spec_img_footer()
echo "$indent4 endimage" echo "$indent4 endimage"
} }
# spec_subsys_header() # spec_subsys_header()
# param: $1=image $2=subsys $3=description # param: $1=image $2=subsys $3=description $4=subsys property
spec_subsys_header() spec_subsys_header()
{ {
echo "$indent8 subsys $2 default" echo "$indent8 subsys $2 $4"
echo "$indent12 id \"$3\"" echo "$indent12 id \"$3\""
echo "$indent12 replaces self" echo "$indent12 replaces self"
echo "$indent12 exp $pkgname.$1.$2" echo "$indent12 exp $pkgname.$1.$2"
@ -272,13 +281,21 @@ fetch_subsysdesc()
{ {
local i=0 local i=0
local numloops=${#pc[@]} local numloops=${#pc[@]}
local ss
local sp
local desc
while read ss desc while read ss sp desc
do do
for ((i=0; i < $numloops; i++)) # Find subsystem... for ((i=0; i < $numloops; i++)) # Find subsystem...
do do
if [ "${pc[$i]}" = "$ss" ]; then if [ "${pc[$i]}" = "$ss" ]; then
pd[$i]="$desc" pd[$i]="$desc"
if [ "$sp" == "nodefault" ]; then
ps[$i]=""
else
ps[$i]=$sp
fi
break # Found it, skip to the next line break # Found it, skip to the next line
fi fi
done done
@ -445,7 +462,7 @@ create_spec()
do do
rv=`$EXPR match "${pc[$pcidx]}" ''${pctop[$i]}''` rv=`$EXPR match "${pc[$pcidx]}" ''${pctop[$i]}''`
if [ ! "$rv" -eq 0 ]; then # We got a hit! if [ ! "$rv" -eq 0 ]; then # We got a hit!
spec_subsys_header ${pctop[$i]} `echo ${pc[$pcidx]}|$CUT -d . -f 2` "${pd[$pcidx]}" >> $specfile spec_subsys_header ${pctop[$i]} `echo ${pc[$pcidx]}|$CUT -d . -f 2` "${pd[$pcidx]}" "${ps[$pcidx]}" >> $specfile
reqsize=${#reqs[@]} reqsize=${#reqs[@]}
declare -a reqidlist declare -a reqidlist
reqidlidx=0 reqidlidx=0
@ -680,7 +697,22 @@ auto_src()
# and then copy the result to $stagedir/$prefix/relnotes/$topdir-$version-$pkgver.txt # and then copy the result to $stagedir/$prefix/relnotes/$topdir-$version-$pkgver.txt
auto_rel() auto_rel()
{ {
echo "auto_rel() is unimplemented" if [ -r $metadir/relnotes ]; then
local relmetadir=relnotes/$topdir-$version-$pkgver
local cf="$(_upls $configure_args)"
local fullcf="./configure $cf"
local compiler="gcc $(gcc --version 2>&1)"
local pkgnam_temp=$(grep 'pkgname=' $metadir/pkgdef)
local pkgnam=$(_upls ${pkgnam_temp#pkgname=*})
$MKDIR -p $relmetadir
$SED -e "s;%%PKGNAME%%;${pkgnam};g" \
-e "s;%%SOURCE_AND_VER%%;${topdir}-${version};g" \
-e "s;%%CONFIGURE%%;${fullcf};g" \
-e "s;%%COMPILER%%;${compiler};g" \
$metadir/relnotes > "$relmetadir/${topdir}.txt"
else
echo "auto_rel: No release notes found!"
fi
} }
# auto_dist(): Add idb & spec files to stagedir # auto_dist(): Add idb & spec files to stagedir
@ -707,6 +739,9 @@ generic_pack()
fi fi
clean meta clean meta
# Compute manpage location
local dir_prefix="${prefix#$topinstalldir*}"
if [ "$shortroot" -eq 1 ]; then if [ "$shortroot" -eq 1 ]; then
if [ $catman -eq 1 -a -d $stagedir/man ]; then if [ $catman -eq 1 -a -d $stagedir/man ]; then
setdir $stagedir/man setdir $stagedir/man
@ -714,8 +749,8 @@ generic_pack()
fi fi
setdir stage setdir stage
else else
if [ $catman -eq 1 -a -d $stagedir$topinstalldir/man ]; then if [ $catman -eq 1 -a -d ${stagedir}${topinstalldir}${dir_prefix}/man ]; then
setdir $stagedir$topinstalldir/man setdir ${stagedir}${topinstalldir}${dir_prefix}/man
fix_man fix_man
fi fi
setdir $stagedir$topinstalldir setdir $stagedir$topinstalldir

12
newpkg
View File

@ -16,23 +16,21 @@ else
fi fi
echo "Creating sandbox for $arg1" echo "Creating sandbox for $arg1"
mkdir "$arg1" $MKDIR "$arg1"
for i in $REQ_DIRS for i in $REQ_DIRS
do do
mkdir $arg1/$i mkdir $arg1/$i
done done
cp scripts/build.sh.generic $arg1/build.sh $CP scripts/build.sh.generic $arg1/build.sh
chmod 755 $arg1/build.sh chmod 755 $arg1/build.sh
if [ "$($UNAME -s)" == "IRIX" ]; then if [ "$($UNAME -s)" == "IRIX" ]; then
$SED -e 's/bin\/bash/usr\/local\/bin\/bash/g' $arg1/build.sh > $arg1/build.sh.tmp $SED -e 's/bin\/bash/usr\/local\/bin\/bash/g' $arg1/build.sh > $arg1/build.sh.tmp
$MV $arg1/build.sh.tmp $arg1/build.sh $MV $arg1/build.sh.tmp $arg1/build.sh
$CP scripts/pkgdef.template.irix $arg1/meta/pkgdef
$CP scripts/relnotes.template.irix $arg1/meta/relnotes
fi fi
if [ "$($UNAME -s)" == "SunOS" ]; then if [ "$($UNAME -s)" == "SunOS" ]; then
cp scripts/pkgdef.template $arg1/meta/pkgdef $CP scripts/pkgdef.template $arg1/meta/pkgdef
fi
if [ "$($UNAME -s)" == "IRIX" ]; then
cp scripts/pkgdef.template.irix $arg1/meta/pkgdef
fi fi

31
relnotes.template.irix Normal file
View File

@ -0,0 +1,31 @@
PACKAGE NAME
------------
%%PKGNAME%%
SOURCE/VERSION
--------------
%%SOURCE_AND_VER%%
BUILD ENVIRONMENT
-----------------
No special build variables where set
compiler and version:
%%COMPILER%%
CONFIGURE/MAKE FLAGS/TARGETS
----------------------------
%%CONFIGURE%%
<if you've overridden configure_args then you need to update this manually>
KNOWN DEPENDANCIES
------------------
none
ERRORS/MISCELLANEOUS
--------------------
none
<Comments and instructions can be put here>