Commit b11b1717 authored by Vitaly Lipatov's avatar Vitaly Lipatov

put full path in LISTBUILT, run subcommand from the current repo

parent ac5a7dd6
......@@ -29,7 +29,7 @@ FIXPATCHFUZZ="%define _default_patch_fuzz 3"
# Set buildreq
if [ "$VENDOR" = "alt" ] ; then
BUILDREQ="BuildRequires: rpm-build-compat >= 0.95"
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=rpmbsh
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=$ETERBUILDBIN/rpmbsh
# Change release according to alt policy with extensions
# General rule: alwars alt(N-1).MM.(N)
set_release $SPECNAME alt$(decrement_release $BASERELEASE).$MDISTR.$BASERELEASE
......@@ -38,7 +38,7 @@ if [ "$VENDOR" = "alt" ] ; then
else
# Need our compat package and disable strong patch checking
BUILDREQ="BuildRequires: rpm-build-altlinux-compat >= 0.95\n$FIXPATCHFUZZ"
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=rpmbb
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=$ETERBUILDBIN/rpmbb
set_release $SPECNAME eter$BASERELEASE$VENDOR
ADDDEF="%defattr(-, root, root)"
CLEANTEXT=""
......@@ -161,6 +161,11 @@ mv $SPECNAME $SPECNAME.old &&
sed -e "s|^Obsoletes: *\$||g" | \
cat > $SPECNAME
# hack for build old eter packages
if [ -n "$ETERREGNUM" ] ; then
subst "s|@ETERREGNUM@|$ETERREGNUM|g" $SPECNAME
fi
#TODO:
#%if %{undefined buildroot}
#BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
......@@ -221,7 +226,7 @@ phelp()
while getopts :hniv opt; do
case $opt in
h) phelp; exit 0;;
n) BUILDCOMMAND="rpmbs";;
n) BUILDCOMMAND="$ETERBUILDBIN/rpmbs";;
v) VERBOSE=1;;
+?) 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;;
......@@ -258,7 +263,7 @@ fi
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
export RPMTOPDIR=$RPMDIR/BP
......@@ -268,10 +273,9 @@ export IGNOREGEAR=1
# NOTE: we can do cd to some other dir...
for i in $LISTBUILT ; do
SPKG=$RPMDIR/SRPMS/$i
uni_rpminstall $SPKG
SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $SPKG)
test -r "$SPECNAME" || fatal "Spec $SPECNAME is not found"
uni_rpminstall $i
SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $i)
test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found"
# FIXME: do not remove if not repacked
#rm -f $SPKG
alt_tolocal $SPECNAME
......
......@@ -141,7 +141,6 @@ set_incoming $MENV
if [ -n "${DELETENOW}" ]; then
echog "Removing from '$RSYNCINCOMING/$INCOMING/'"
check_key
cd $RPMTOPDIR/SRPMS
for i in $LISTBUILT ; do
> $i
done
......@@ -174,7 +173,6 @@ check_gear_and_tag()
if [ -n "$SIGN" ]; then
release_check $LISTBUILT
cd $RPMTOPDIR/SRPMS
if [ -r "$LISTBUILT" ] ; then
echo if one spec, check gear
check_gear_and_tag $SPECDIR
......@@ -253,4 +251,11 @@ if [ -n "$SIGN" ]; then
sleep 10
exit 1
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
......@@ -224,10 +224,8 @@ if [ -n "$INSTALLBINARY" ] ; then
parse_cmd_pre "$@"
pack_src_rpm $LISTRPMARGS
echog "Running apt-get for install needed packages for $LISTBUILT"
cd $RPMTOPDIR/SRPMS
# FIXME: ALT Specific
$SUDO apt-get build-dep $LISTBUILT
cd -
exit 0
fi
......
......@@ -2,8 +2,9 @@
#
# 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/branch/noarch classic
rpm file:/var/ftp/ pub/ALTLinux/4.0/i586 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/backports/4.0/i586 backports
#rpm file:/var/ftp/ pub/ALTLinux/updates/4.0/i586 updates
#rpm file:/var/ftp/ pub/ALTLinux/backports/4.0/i586 backports
......@@ -2,8 +2,9 @@
#
# 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/branch/noarch classic
rpm file:/var/ftp/ pub/ALTLinux/4.1/i586 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/backports/4.1/i586 backports
#rpm file:/var/ftp/ pub/ALTLinux/updates/4.1/i586 updates
#rpm file:/var/ftp/ pub/ALTLinux/backports/4.1/i586 backports
......@@ -2,8 +2,9 @@
#
# 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/branch/noarch classic
rpm file:/var/ftp/ pub/ALTLinux/5.0/i586 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/backports/4.1/i586 backports
......@@ -23,6 +23,7 @@ set_eterbuilddir()
ETERBUILDDIR=/usr/share/eterbuild
fi
fi
ETERBUILDBIN=$(readlink -f $ETERBUILDDIR/../../bin)
test -n "$ETERBUILDDIR"
# returns test result
}
......
......@@ -142,6 +142,7 @@ build_rpms_name()
}
# LISTNAMES, options in arg
# build LISTBUILT list with src.rpm full path
pack_src_rpm()
{
local i
......@@ -156,7 +157,13 @@ do
if [ -z ${i/*rpm/} ] ; then
# 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
#
# BASENAME, RELEASE, VERSION, NAMESRPMIN, NAMERPMIN
......@@ -175,14 +182,15 @@ do
echog "Just packing \$NAMESRPMIN"
uni_rpmbuild $i -bs $ARGS $NODEPS --target $DEFAULTARCH || fatal "Error with rpmbuild"
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
# 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
# remove extra space before list
LISTBUILT=$(echo "$LISTBUILT" | sed -e "s|^ ||")
......
......@@ -9,6 +9,7 @@ get_var()
}
# FIXME: only ALT handled rpm -bE
#
eval_spec()
{
......
......@@ -10,7 +10,7 @@ Dir::Etc::main "/dev/null";
Dir::Etc::parts "/var/empty";
Dir::Etc::SourceParts "/var/empty";
Dir::Etc::sourcelist "$(pwd)/sources.list.SS";
Dir::Etc::sourcelist "/etc/eterbuild/apt/sources.list.SS";
EOF
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