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" ...@@ -29,7 +29,7 @@ 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
...@@ -38,7 +38,7 @@ if [ "$VENDOR" = "alt" ] ; then ...@@ -38,7 +38,7 @@ if [ "$VENDOR" = "alt" ] ; then
else else
# Need our compat package and disable strong patch checking # Need our compat package and disable strong patch checking
BUILDREQ="BuildRequires: rpm-build-altlinux-compat >= 0.95\n$FIXPATCHFUZZ" 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 set_release $SPECNAME eter$BASERELEASE$VENDOR
ADDDEF="%defattr(-, root, root)" ADDDEF="%defattr(-, root, root)"
CLEANTEXT="" CLEANTEXT=""
...@@ -161,6 +161,11 @@ mv $SPECNAME $SPECNAME.old && ...@@ -161,6 +161,11 @@ 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
#TODO: #TODO:
#%if %{undefined buildroot} #%if %{undefined buildroot}
#BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot #BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
...@@ -221,7 +226,7 @@ phelp() ...@@ -221,7 +226,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;;
...@@ -258,7 +263,7 @@ fi ...@@ -258,7 +263,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
...@@ -268,10 +273,9 @@ export IGNOREGEAR=1 ...@@ -268,10 +273,9 @@ 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 # FIXME: do not remove if not repacked
#rm -f $SPKG #rm -f $SPKG
alt_tolocal $SPECNAME alt_tolocal $SPECNAME
......
...@@ -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,7 +173,6 @@ check_gear_and_tag() ...@@ -174,7 +173,6 @@ 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
check_gear_and_tag $SPECDIR check_gear_and_tag $SPECDIR
...@@ -253,4 +251,11 @@ if [ -n "$SIGN" ]; then ...@@ -253,4 +251,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
...@@ -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
} }
......
...@@ -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()
{ {
......
...@@ -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