Commit c3375c88 authored by Vitaly Lipatov's avatar Vitaly Lipatov

Merge branch 'master' of git.alt:packages/etersoft-build-utils

parents e7c2ee53 43672e1d
host-, ?
??
:
fonts-ttf-%fname-1.04-alt1.src.rpm
rpmbph: --define _specdir --define _sourcedir rpmbph: --define _specdir --define _sourcedir
rpmgp -r git - rpmgp -r git -
%name - %name -
......
...@@ -11,10 +11,25 @@ if [ "$1" = "-h" ] ; then ...@@ -11,10 +11,25 @@ if [ "$1" = "-h" ] ; then
exit 1 exit 1
fi fi
PROJECTNAME=$(basename `pwd`) # use as project name
if [ -n "$1" ] ; then
PROJECTNAME=$1
else
PROJECTNAME=$(basename `pwd`)
fi
CURRENTBRANCH=$(git branch | grep "^\*" | cut -d " " -f 2)
if [ -z "$CURRENTBRANCH" ] ; then
echo "Can't detect current branch"
exit 1
fi
# more correctly
CURRENTBRANCH=HEAD
git push $@ git.alt:packages/$PROJECTNAME.git git push $@ git.alt:packages/$PROJECTNAME.git $CURRENTBRANCH:master
git push --tags git.alt:packages/$PROJECTNAME.git git push --tags git.alt:packages/$PROJECTNAME.git $CURRENTBRANCH:master
#> $ git commit -a; A='0.23-alt1'; git tag -s $A; \ #> $ git commit -a; A='0.23-alt1'; git tag -s $A; \
#> git tag -s -f -m 'Sisyphus release $A' sisyphus $A #> git tag -s -f -m 'Sisyphus release $A' sisyphus $A
\ No newline at end of file
...@@ -66,6 +66,10 @@ if [ ! -x "$HSH" ] ; then ...@@ -66,6 +66,10 @@ if [ ! -x "$HSH" ] ; then
exit 1 exit 1
fi fi
# export OURAPTCONF with temp. file contains correct path to sources.list
prepare_aptconfig
HASHERARG="--apt-config=$OURAPTCONF --target $DEFAULTARCH"
mygetopts $LISTARGS mygetopts $LISTARGS
...@@ -78,13 +82,13 @@ fi ...@@ -78,13 +82,13 @@ fi
if [ "$CLEANUP" = "1" ]; then if [ "$CLEANUP" = "1" ]; then
echog "Cleanup $HASHERDIR ..." echog "Cleanup $HASHERDIR ..."
$HSH --cleanup-only $HASHERDIR || fatal "cleanup" $HSH --cleanup-only $HASHERDIR $HASHERARG || fatal "cleanup"
exit 0 exit 0
fi fi
if [ ! -d $HASHERDIR -o "$INITIALIZE" = "1" ]; then if [ ! -d $HASHERDIR -o "$INITIALIZE" = "1" ]; then
echog "Initialize $HASHERDIR ..." echog "Initialize $HASHERDIR ..."
mkdir -p $HASHERDIR && $HSH --initroot-only $HASHERDIR || fatal "mkdir" mkdir -p $HASHERDIR && $HSH $HASHERARG --initroot-only $HASHERDIR || fatal "mkdir"
fi fi
SHELLHASHERARG="--mountpoints=/proc" SHELLHASHERARG="--mountpoints=/proc"
......
...@@ -24,25 +24,30 @@ SPECNAME=$1 ...@@ -24,25 +24,30 @@ SPECNAME=$1
BASERELEASE=$(get_numrelease $SPECNAME) BASERELEASE=$(get_numrelease $SPECNAME)
FIXPATCHFUZZ="%define _default_patch_fuzz 3"
# Set buildreq # Set buildreq
if [ "$VENDOR" = "alt" ] ; then if [ "$VENDOR" = "alt" ] ; then
BUILDREQ="BuildRequires: rpm-build-compat >= 0.95" BUILDREQ="BuildRequires: rpm-build-compat >= 0.95"
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=rpmbsh [ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=$ETERBUILDBIN/rpmbsh
# Change release according to alt policy with extensions # Change release according to alt policy with extensions
# General rule: alwars alt(N-1).MM.(N) # General rule: alwars alt(N-1).MM.(N)
set_release $SPECNAME alt$(decrement_release $BASERELEASE).$MDISTR.$BASERELEASE set_release $SPECNAME alt$(decrement_release $BASERELEASE).$MDISTR.$BASERELEASE
ADDDEF="" ADDDEF=""
CLEANTEXT="" CLEANTEXT=""
# due new libtool
RECONFT="%undefine __libtoolize"
else else
BUILDREQ="BuildRequires: rpm-build-altlinux-compat >= 0.95" # Need our compat package and disable strong patch checking
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=rpmbb BUILDREQ="BuildRequires: rpm-build-altlinux-compat >= 0.95\n$FIXPATCHFUZZ"
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=$ETERBUILDBIN/rpmbb
set_release $SPECNAME eter$BASERELEASE$VENDOR set_release $SPECNAME eter$BASERELEASE$VENDOR
ADDDEF="%defattr(-, root, root)" ADDDEF="%defattr(-, root, root)"
CLEANTEXT="" CLEANTEXT=""
fi fi
# Do not add BuildReq if already exist # Do not add BuildReq if already exist
cat $SPECNAME | grep rpm-build-compat &>/dev/null && BUILDREQ="" cat $SPECNAME | grep rpm-build-compat &>/dev/null && BUILDREQ="$FIXPATCHFUZZ"
# fix mktemp using for MCBC # fix mktemp using for MCBC
if [ "$VENDOR" = "mcbc" ] ; then if [ "$VENDOR" = "mcbc" ] ; then
...@@ -158,6 +163,14 @@ mv $SPECNAME $SPECNAME.old && ...@@ -158,6 +163,14 @@ mv $SPECNAME $SPECNAME.old &&
sed -e "s|^Obsoletes: *\$||g" | \ sed -e "s|^Obsoletes: *\$||g" | \
cat > $SPECNAME cat > $SPECNAME
# hack for build old eter packages
if [ -n "$ETERREGNUM" ] ; then
subst "s|@ETERREGNUM@|$ETERREGNUM|g" $SPECNAME
fi
# Fedora 10 does mismatch for Patch: and %patch0
subst "s|Patch:|Patch0:|g" $SPECNAME
#TODO: #TODO:
#%if %{undefined buildroot} #%if %{undefined buildroot}
#BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot #BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
...@@ -218,7 +231,7 @@ phelp() ...@@ -218,7 +231,7 @@ phelp()
while getopts :hniv opt; do while getopts :hniv opt; do
case $opt in case $opt in
h) phelp; exit 0;; h) phelp; exit 0;;
n) BUILDCOMMAND="rpmbs";; n) BUILDCOMMAND="$ETERBUILDBIN/rpmbs";;
v) VERBOSE=1;; v) VERBOSE=1;;
+?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;; +?) echog "$name: options should not be preceded by a '+'." 1>&2; exit 2;;
# ?) echog "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;; # ?) echog "$name: $OPTARG: bad option. Use -h for help." 1>&2 ; exit 2;;
...@@ -255,7 +268,7 @@ fi ...@@ -255,7 +268,7 @@ fi
unset MENV MENVARG unset MENV MENVARG
# handle src.rpm too, LISTBUILT - result src.rpms in SRPMS dir # handle src.rpm too, LISTBUILT - result with full pathes to src.rpms
pack_src_rpm $LISTNAMES pack_src_rpm $LISTNAMES
export RPMTOPDIR=$RPMDIR/BP export RPMTOPDIR=$RPMDIR/BP
...@@ -265,11 +278,11 @@ export IGNOREGEAR=1 ...@@ -265,11 +278,11 @@ export IGNOREGEAR=1
# NOTE: we can do cd to some other dir... # NOTE: we can do cd to some other dir...
for i in $LISTBUILT ; do for i in $LISTBUILT ; do
SPKG=$RPMDIR/SRPMS/$i uni_rpminstall $i
uni_rpminstall $SPKG SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $i)
SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $SPKG) test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found"
test -r "$SPECNAME" || fatal "Spec $SPECNAME is not found" # FIXME: do not remove if not repacked
rm -f $SPKG #rm -f $SPKG
alt_tolocal $SPECNAME alt_tolocal $SPECNAME
done done
...@@ -141,7 +141,6 @@ set_incoming $MENV ...@@ -141,7 +141,6 @@ set_incoming $MENV
if [ -n "${DELETENOW}" ]; then if [ -n "${DELETENOW}" ]; then
echog "Removing from '$RSYNCINCOMING/$INCOMING/'" echog "Removing from '$RSYNCINCOMING/$INCOMING/'"
check_key check_key
cd $RPMTOPDIR/SRPMS
for i in $LISTBUILT ; do for i in $LISTBUILT ; do
> $i > $i
done done
...@@ -174,13 +173,10 @@ check_gear_and_tag() ...@@ -174,13 +173,10 @@ check_gear_and_tag()
if [ -n "$SIGN" ]; then if [ -n "$SIGN" ]; then
release_check $LISTBUILT release_check $LISTBUILT
cd $RPMTOPDIR/SRPMS
if [ -r "$LISTBUILT" ] ; then if [ -r "$LISTBUILT" ] ; then
echo if one spec, check gear echo if one spec, check gear
[ -n "$SPECDIR" ] || SPECDIR=`dirname $LISTNAMES` [ -n "$SPECDIR" ] || SPECDIR=`dirname $LISTNAMES`
cd -
check_gear_and_tag $SPECDIR check_gear_and_tag $SPECDIR
cd $RPMTOPDIR/SRPMS
fi fi
echog "Will try to sign follow packages with GPG: \$LISTBUILT" echog "Will try to sign follow packages with GPG: \$LISTBUILT"
...@@ -256,4 +252,11 @@ if [ -n "$SIGN" ]; then ...@@ -256,4 +252,11 @@ if [ -n "$SIGN" ]; then
sleep 10 sleep 10
exit 1 exit 1
fi fi
else
if [ -n "$ETERDESTSRPM" ] ; then
mkdir -p $ETERDESTSRPM || echog "Error mkdir $ETERDESTSRPM"
echog "Copying package(s) in \$ETERDESTSRPM"
cp -fv $LISTBUILT $ETERDESTSRPM || echog "Error during copying"
fi
fi fi
...@@ -224,10 +224,8 @@ if [ -n "$INSTALLBINARY" ] ; then ...@@ -224,10 +224,8 @@ if [ -n "$INSTALLBINARY" ] ; then
parse_cmd_pre "$@" parse_cmd_pre "$@"
pack_src_rpm $LISTRPMARGS pack_src_rpm $LISTRPMARGS
echog "Running apt-get for install needed packages for $LISTBUILT" echog "Running apt-get for install needed packages for $LISTBUILT"
cd $RPMTOPDIR/SRPMS
# FIXME: ALT Specific # FIXME: ALT Specific
$SUDO apt-get build-dep $LISTBUILT $SUDO apt-get build-dep $LISTBUILT
cd -
exit 0 exit 0
fi fi
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
# #
# You can add [alt] after rpm for digital signature check # You can add [alt] after rpm for digital signature check
rpm file:/var/ftp/ pub/ALTLinux/4.0/branch/i586 classic rpm file:/var/ftp/ pub/ALTLinux/4.0/i586 classic
rpm file:/var/ftp/ pub/ALTLinux/4.0/branch/noarch classic rpm file:/var/ftp/ pub/ALTLinux/4.0/noarch classic
rpm file:/var/ftp/ pub/ALTLinux/4.0/x86_32 classic
rpm file:/var/ftp/ pub/ALTLinux/updates/4.0/i586 updates #rpm file:/var/ftp/ pub/ALTLinux/updates/4.0/i586 updates
rpm file:/var/ftp/ pub/ALTLinux/backports/4.0/i586 backports #rpm file:/var/ftp/ pub/ALTLinux/backports/4.0/i586 backports
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
# #
# You can add [alt] after rpm for digital signature check # You can add [alt] after rpm for digital signature check
rpm file:/var/ftp/ pub/ALTLinux/4.1/branch/i586 classic rpm file:/var/ftp/ pub/ALTLinux/4.1/i586 classic
rpm file:/var/ftp/ pub/ALTLinux/4.1/branch/noarch classic rpm file:/var/ftp/ pub/ALTLinux/4.1/noarch classic
rpm file:/var/ftp/ pub/ALTLinux/4.1/x86_32 classic
rpm file:/var/ftp/ pub/ALTLinux/updates/4.1/i586 updates #rpm file:/var/ftp/ pub/ALTLinux/updates/4.1/i586 updates
rpm file:/var/ftp/ pub/ALTLinux/backports/4.1/i586 backports #rpm file:/var/ftp/ pub/ALTLinux/backports/4.1/i586 backports
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
# #
# You can add [alt] after rpm for digital signature check # You can add [alt] after rpm for digital signature check
rpm file:/var/ftp/ pub/ALTLinux/5.0/branch/i586 classic rpm file:/var/ftp/ pub/ALTLinux/5.0/i586 classic
rpm file:/var/ftp/ pub/ALTLinux/5.0/branch/noarch classic rpm file:/var/ftp/ pub/ALTLinux/5.0/noarch classic
rpm file:/var/ftp/ pub/ALTLinux/5.0/x86_32 classic
#rpm file:/var/ftp/ pub/ALTLinux/updates/5.0/i586 updates #rpm file:/var/ftp/ pub/ALTLinux/updates/5.0/i586 updates
#rpm file:/var/ftp/ pub/ALTLinux/backports/4.1/i586 backports #rpm file:/var/ftp/ pub/ALTLinux/backports/4.1/i586 backports
Name: etersoft-build-utils Name: etersoft-build-utils
Version: 1.5.6 Version: 1.5.6
Release: alt2 Release: alt3
Summary: A set of build rpm utilities Summary: A set of build rpm utilities
...@@ -61,6 +61,9 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher curl ...@@ -61,6 +61,9 @@ RECOMMENDED packages: gcc-c++ perl-libwww ccache elinks mutt hasher curl
%config(noreplace) %_sysconfdir/eterbuild/repos %config(noreplace) %_sysconfdir/eterbuild/repos
%changelog %changelog
* Fri Apr 24 2009 Vitaly Lipatov <lav@altlinux.ru> 1.5.6-alt3
- rpmbph: small fixes
* Wed Mar 04 2009 Vitaly Lipatov <lav@altlinux.ru> 1.5.6-alt2 * Wed Mar 04 2009 Vitaly Lipatov <lav@altlinux.ru> 1.5.6-alt2
- small replacements fix for nx - small replacements fix for nx
- fix build in empty RPM dir - fix build in empty RPM dir
......
...@@ -23,6 +23,7 @@ set_eterbuilddir() ...@@ -23,6 +23,7 @@ set_eterbuilddir()
ETERBUILDDIR=/usr/share/eterbuild ETERBUILDDIR=/usr/share/eterbuild
fi fi
fi fi
ETERBUILDBIN=$(readlink -f $ETERBUILDDIR/../../bin)
test -n "$ETERBUILDDIR" test -n "$ETERBUILDDIR"
# returns test result # returns test result
} }
...@@ -101,7 +102,7 @@ if [ "$VENDOR" = "alt" ] && [ -n "$MENV" ] ; then ...@@ -101,7 +102,7 @@ if [ "$VENDOR" = "alt" ] && [ -n "$MENV" ] ; then
MENVARG="-$MENV" MENVARG="-$MENV"
else else
# FIXME: echog breakes vars # FIXME: echog breakes vars
echo "Distribution: \$DISTRNAME (\$VENDOR) (target package: \$TARGET)" echog "Distribution: \$DISTRNAME (\$VENDOR) (target package: \$TARGET)"
fi fi
} }
......
...@@ -39,7 +39,7 @@ print_tmp_sourceslist() ...@@ -39,7 +39,7 @@ print_tmp_sourceslist()
# Note: /etc/apt and /etc/eterbuild/apt is supported # Note: /etc/apt and /etc/eterbuild/apt is supported
SLIST=`cat "$1" | \ SLIST=`cat "$1" | \
sed -e "s|\"/etc/.*apt/sources.list|\"$ETERBUILDETC/apt/sources.list|g" | \ sed -e "s|\"/etc/.*apt/sources.list|\"$ETERBUILDETC/apt/sources.list|g" | \
grep "/sources.list" "$1" | sed -e 's|.*"\(.*\)".*|\1|g'` grep "/sources.list" | sed -e 's|.*"\(.*\)".*|\1|g'`
#SLIST="$ETERBUILDETC/apt/`basename $SLIST`" #SLIST="$ETERBUILDETC/apt/`basename $SLIST`"
test -r "$SLIST" || fatal "'$SLIST' - sources.list path from $1 is missed" test -r "$SLIST" || fatal "'$SLIST' - sources.list path from $1 is missed"
cat "$SLIST" | \ cat "$SLIST" | \
...@@ -48,8 +48,8 @@ print_tmp_sourceslist() ...@@ -48,8 +48,8 @@ print_tmp_sourceslist()
prepare_aptconfig() prepare_aptconfig()
{ {
print_tmp_aptconf $APTCONF >$OURTMPDIR/apt.conf.$MENV || fatal "Can't create apt.conf"
export OURAPTCONF=$OURTMPDIR/apt.conf.$MENV export OURAPTCONF=$OURTMPDIR/apt.conf.$MENV
print_tmp_sourceslist $APTCONF >$OURTMPDIR/sources.list.$MENV || fatal "Can't create sources.list" print_tmp_aptconf $APTCONF >$OURAPTCONF || fatal "Can't create apt.conf"
export OURSOURCES=$OURTMPDIR/sources.list.$MENV export OURSOURCES=$OURTMPDIR/sources.list.$MENV
print_tmp_sourceslist $APTCONF >$OURSOURCES || fatal "Can't create sources.list"
} }
...@@ -142,6 +142,7 @@ build_rpms_name() ...@@ -142,6 +142,7 @@ build_rpms_name()
} }
# LISTNAMES, options in arg # LISTNAMES, options in arg
# build LISTBUILT list with src.rpm full path
pack_src_rpm() pack_src_rpm()
{ {
local i local i
...@@ -156,7 +157,13 @@ do ...@@ -156,7 +157,13 @@ do
if [ -z ${i/*rpm/} ] ; then if [ -z ${i/*rpm/} ] ; then
# if rpm not spec, guess it is src.rpm # if rpm not spec, guess it is src.rpm
NAMESRPMIN=$(basename $i) #NAMESRPMIN=$(basename $i)
if [ -f "$i" ] ; then
LISTBUILT="$LISTBUILT $i"
else
fatal "pack_src_rpm: Can't find '$i'"
fi
else else
# #
# BASENAME, RELEASE, VERSION, NAMESRPMIN, NAMERPMIN # BASENAME, RELEASE, VERSION, NAMESRPMIN, NAMERPMIN
...@@ -175,14 +182,15 @@ do ...@@ -175,14 +182,15 @@ do
echog "Just packing \$NAMESRPMIN" echog "Just packing \$NAMESRPMIN"
uni_rpmbuild $i -bs $ARGS $NODEPS --target $DEFAULTARCH || fatal "Error with rpmbuild" uni_rpmbuild $i -bs $ARGS $NODEPS --target $DEFAULTARCH || fatal "Error with rpmbuild"
fi fi
# Check the package really built
if [ -f "$RPMTOPDIR/SRPMS/$NAMESRPMIN" ] ; then
LISTBUILT="$LISTBUILT $RPMTOPDIR/SRPMS/$NAMESRPMIN"
else
fatal "Can't find '$NAMESRPMIN' in '$RPMTOPDIR/SRPMS'"
fi
fi fi
# Check the package really built
if [ -f $RPMTOPDIR/SRPMS/$NAMESRPMIN ] ; then
LISTBUILT="$LISTBUILT $NAMESRPMIN"
else
fatal "Can't find '$NAMESRPMIN' in '$RPMTOPDIR/SRPMS'"
fi
done done
# remove extra space before list # remove extra space before list
LISTBUILT=$(echo "$LISTBUILT" | sed -e "s|^ ||") LISTBUILT=$(echo "$LISTBUILT" | sed -e "s|^ ||")
......
...@@ -9,6 +9,7 @@ get_var() ...@@ -9,6 +9,7 @@ get_var()
} }
# FIXME: only ALT handled rpm -bE
# #
eval_spec() eval_spec()
{ {
...@@ -64,7 +65,8 @@ set_release() ...@@ -64,7 +65,8 @@ set_release()
inc_release() inc_release()
{ {
local BASERELEASE=$(get_numrelease "$1") local BASERELEASE=$(get_numrelease "$1")
set_release "$1" $(get_txtrelease "$1")$(($BASERELEASE + 1 )) local MAJOR=`echo "$BASERELEASE" | sed -e "s|\..*||"`
set_release "$1" $(get_txtrelease "$1")$(($MAJOR + 1 ))
} }
# inc 2.x to 2.(x+1) or 2 to 2.1 # inc 2.x to 2.(x+1) or 2 to 2.1
...@@ -132,8 +134,8 @@ subst_namever() ...@@ -132,8 +134,8 @@ subst_namever()
{ {
sed -e "s|%{name}|$BASENAME|g sed -e "s|%{name}|$BASENAME|g
s|%{version}|$VERSION|g s|%{version}|$VERSION|g
s|%name|$BASENAME/|g s|%name|$BASENAME|g
s|%version|$VERSION/|g" s|%version|$VERSION|g"
} }
......
...@@ -3,3 +3,4 @@ jackit-devel| ...@@ -3,3 +3,4 @@ jackit-devel|
# XOrg # XOrg
xorg-x11-devel| xorg-x11-devel|
xorg-sdk|xorg-x11-server-sdk
\ No newline at end of file
...@@ -3,3 +3,4 @@ gpm-devel| ...@@ -3,3 +3,4 @@ gpm-devel|
libungif-devel| libungif-devel|
perl-devel|perl perl-devel|perl
libgtkmm2-devel|gtkmm24-devel libgtkmm2-devel|gtkmm24-devel
xorg-sdk|xorg-x11-server-sdk
\ No newline at end of file
...@@ -78,3 +78,4 @@ xorg-inputproto-devel|x11-proto-devel ...@@ -78,3 +78,4 @@ xorg-inputproto-devel|x11-proto-devel
xorg-xextproto-devel|x11-proto-devel xorg-xextproto-devel|x11-proto-devel
xorg-sdk|x11-server-devel xorg-sdk|x11-server-devel
libICE-devel|libice6-devel
\ No newline at end of file
libxslt-devel|libxslt1-devel libxslt-devel|libxslt1-devel
libgtkmm2-devel|libgtkmm2.4-devel libgtkmm2-devel|libgtkmm2.4-devel
jackit-devel|libjack-devel
libxslt-devel|libxslt-devel libxslt-devel|libxslt-devel
jackit-devel|libjack-devel
...@@ -72,4 +72,7 @@ gccmakedep|xorg-x11-util-devel ...@@ -72,4 +72,7 @@ gccmakedep|xorg-x11-util-devel
sysvinit-utils|sysvinit sysvinit-utils|sysvinit
netcat|netcat netcat|netcat
\ No newline at end of file
xorg-sdk|xorg-x11-server-sdk
libICE-devel|xorg-x11-libICE-devel
\ No newline at end of file
...@@ -51,12 +51,6 @@ check get_numrelease 3.1 `get_numrelease` ...@@ -51,12 +51,6 @@ check get_numrelease 3.1 `get_numrelease`
TESTREL=alt4.2 TESTREL=alt4.2
check get_txtrelease alt `get_txtrelease` check get_txtrelease alt `get_txtrelease`
TESTREL=alt5
check inc_subrelease "alt5.1" `inc_subrelease ""`
TESTREL=alt6.2
check inc_subrelease "alt6.3" `inc_subrelease ""`
BASERELEASE=27.5 BASERELEASE=27.5
MAJOR=`echo "$BASERELEASE" | sed -e "s|\..*||"` MAJOR=`echo "$BASERELEASE" | sed -e "s|\..*||"`
MINOR=`echo "$BASERELEASE" | sed -e "s|.*\.||"` MINOR=`echo "$BASERELEASE" | sed -e "s|.*\.||"`
......
#!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common
load_mod spec
SPEC=get_ver.spec
check_get_version()
{
RES=$1
cat <<EOF >$SPEC
Name: get_version_test
Release: alt1
Summary: Test
Group: Other
License: Public License
%define major 1.0
%define ver 10
%define maj 1.0
Version: $TESTVER
%description
Get version test
EOF
RESGET=`get_version $SPEC`
[ "$RES" != "$RESGET" ] && echo "FATAL with 'get_version': result '$RES' do not match with '$RESGET'" || echo "OK for 'get_version' with '$RESGET'"
}
TESTVER=1.0.10
check_get_version 1.0.10
# spec evals only on ALT
TESTVER=%major.10
check_get_version 1.0.10
TESTVER=%maj.%ver
check_get_version 1.0.10
rm -f $SPEC
#!/bin/sh
. `dirname $0`/../share/eterbuild/functions/common
load_mod spec
check()
{
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$2' do not match with '$3'" || echo "OK for '$1' with '$2'"
}
get_release()
{
#echo "Warning: Error test %test" >&2
echo $TESTREL
}
set_release()
{
echo "$2"
}
TESTREL=alt5
check inc_subrelease "alt5.1" `inc_subrelease ""`
TESTREL=alt6.2
check inc_subrelease "alt6.3" `inc_subrelease ""`
TESTREL=alt5
check inc_release "alt6" `inc_release ""`
TESTREL=alt6.2
check inc_release "alt7" `inc_release ""`
...@@ -10,7 +10,7 @@ Dir::Etc::main "/dev/null"; ...@@ -10,7 +10,7 @@ Dir::Etc::main "/dev/null";
Dir::Etc::parts "/var/empty"; Dir::Etc::parts "/var/empty";
Dir::Etc::SourceParts "/var/empty"; Dir::Etc::SourceParts "/var/empty";
Dir::Etc::sourcelist "$(pwd)/sources.list.SS"; Dir::Etc::sourcelist "/etc/eterbuild/apt/sources.list.SS";
EOF EOF
cat <<EOF >sources.list.SS cat <<EOF >sources.list.SS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment