distributions/fedora/build.sh
author František Kučera <franta-hg@frantovo.cz>
Sat, 25 Jul 2020 17:25:19 +0200
branchv_0
changeset 252 a9d4a8d5c57f
parent 250 aae5009bd0af
permissions -rwxr-xr-x
improve multiple results support

The specification talks exactly about -1:
> Returns: the current result as an update count;
> -1 if the current result is a ResultSet object or there are no more results

Other negative numbers can theoretically mean something different than „no more results“
e.g. unknown number of updates (?).
     1 #!/bin/bash
     2 
     3 # SQL-DK
     4 # Copyright © 2014 František Kučera (frantovo.cz)
     5 # 
     6 # This program is free software: you can redistribute it and/or modify
     7 # it under the terms of the GNU General Public License as published by
     8 # the Free Software Foundation, version 3 of the License.
     9 # 
    10 # This program is distributed in the hope that it will be useful,
    11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    13 # GNU General Public License for more details.
    14 # 
    15 # You should have received a copy of the GNU General Public License
    16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
    17 
    18 DIR="$( cd "$( dirname "$0" )" && pwd )"
    19 TOPDIR="$DIR/TMP";
    20 DBPATH="$DIR/TMP/RPMDB";
    21 
    22 rm -rf "$TOPDIR";
    23 
    24 rpmbuild \
    25 	--define "_dbpath $DBPATH" \
    26 	--define "_topdir $TOPDIR" \
    27 	-bb \
    28 	"$DIR/sql-dk.spec";
    29 	
    30 cp "$TOPDIR"/RPMS/*/sql-dk-*.rpm $DIR/