OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 15-Aug-2005 18:23:45 Branch: HEAD Handle: 2005081517234400 Modified files: openpkg-src/openpkg HISTORY aux.wrapsrc.sh openpkg.boot openpkg.spec Log: Apply some cleanups after check with Thomas' intentions: 1. move the tool determination into .spec where it belongs more (because the .boot should be kept as minimal as possible), GNU shtool is available anyway, and especially at the same time unbreaks the upgrade procedure (old release already installed). 2. backout --fallback option for now as it is should be replaced soon with a --define option which is then also available in RPM in non-bootstrap situations. 3. unbreak --help command (was broken by cut & paste bugs) Summary: Revision Changes Path 1.289 +3 -0 openpkg-src/openpkg/HISTORY 1.20 +3 -4 openpkg-src/openpkg/aux.wrapsrc.sh 1.56 +9 -64 openpkg-src/openpkg/openpkg.boot 1.444 +81 -19 openpkg-src/openpkg/openpkg.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/openpkg/HISTORY ============================================================================ $ cvs diff -u -r1.288 -r1.289 HISTORY --- openpkg-src/openpkg/HISTORY 15 Aug 2005 16:17:35 -0000 1.288 +++ openpkg-src/openpkg/HISTORY 15 Aug 2005 16:23:44 -0000 1.289 @@ -2,6 +2,9 @@ 2005 ==== +20050815 move tool determination back into .spec to unbreak upgrades +20050815 backout --fallback option (has to be replaced by a more general solution) +20050815 unbreak *.sh --help command (was broken by cut & paste bugs) 20050815 fix Fedora Core 4 compile problems with a more clean and permanent patch 20050813 add --fallback and related options, enabling use of "foreign" dev tools 20050812 use ls(1) as a better strip(1) replacement as both fail when a file is missing @@ . patch -p0 <<'@@ .' Index: openpkg-src/openpkg/aux.wrapsrc.sh ============================================================================ $ cvs diff -u -r1.19 -r1.20 aux.wrapsrc.sh --- openpkg-src/openpkg/aux.wrapsrc.sh 12 Aug 2005 22:51:38 -0000 1.19 +++ openpkg-src/openpkg/aux.wrapsrc.sh 15 Aug 2005 16:23:44 -0000 1.20 @@ -53,13 +53,12 @@ --prefix=* ) l_prefix=$arg ;; esac done -if [ ".$help" = .1 ]; then - echo "Usage: sh $me" 2>&1 - echo " [--prefix=<instancedir>] [--tag=<str>]" 2>&1 +if [ ".$o_help" = .yes ]; then + echo "Usage: sh $l_me" 2>&1 + echo " [--prefix=<prefix>] [--tag=<str>]" 2>&1 echo " [--user=<usr>] [--group=<grp>]" 2>&1 echo " [--{s,m,r,n}usr=<usr>] [--{s,m,r,n}grp=<grp>]" 2>&1 echo " [--{s,m,r,n}uid=<uid>] [--{s,m,r,n}gid=<gid>]" 2>&1 - echo " [--fallback=<devtoolsdir>]" 2>&1 echo " [--use_tar=<tar>] [--use_make=<make>] [--use_cc=<cc>]" 2>&1 echo " [--use_ar=<ar>] [--use_ld=<ld>] [--use_strip=<strip>]" 2>&1 echo " [-t|--tar] [-h|--help] [-v|--version]" 2>&1 @@ . patch -p0 <<'@@ .' Index: openpkg-src/openpkg/openpkg.boot ============================================================================ $ cvs diff -u -r1.55 -r1.56 openpkg.boot --- openpkg-src/openpkg/openpkg.boot 12 Aug 2005 22:51:39 -0000 1.55 +++ openpkg-src/openpkg/openpkg.boot 15 Aug 2005 16:23:44 -0000 1.56 @@ -56,7 +56,7 @@ muid=''; mgid='' ruid=''; rgid='' nuid=''; ngid='' -fallback=''; use_tar=''; use_make=''; use_cc=''; use_ar=''; use_ld=''; use_strip='' +use_tar=''; use_make=''; use_cc=''; use_ar=''; use_ld=''; use_strip='' bs=0 # parse command line options @@ -89,7 +89,6 @@ --rgid=* ) rgid=$arg ;; --nuid=* ) nuid=$arg ;; --ngid=* ) ngid=$arg ;; - --fallback=* ) fallback=$arg ;; --use_tar=* ) use_tar=$arg ;; --use_make=* ) use_make=$arg ;; --use_cc=* ) use_cc=$arg ;; @@ -105,11 +104,10 @@ fi if [ ".$help" = .1 ]; then echo "Usage: sh $me" 2>&1 - echo " [--prefix=<instancedir>] [--tag=<str>]" 2>&1 + echo " [--prefix=<prefix>] [--tag=<str>]" 2>&1 echo " [--user=<usr>] [--group=<grp>]" 2>&1 echo " [--{s,m,r,n}usr=<usr>] [--{s,m,r,n}grp=<grp>]" 2>&1 echo " [--{s,m,r,n}uid=<uid>] [--{s,m,r,n}gid=<gid>]" 2>&1 - echo " [--fallback=<devtoolsdir>]" 2>&1 echo " [--use_tar=<tar>] [--use_make=<make>] [--use_cc=<cc>]" 2>&1 echo " [--use_ar=<ar>] [--use_ld=<ld>] [--use_strip=<strip>]" 2>&1 echo " [-t|--tar] [-h|--help] [-v|--version]" 2>&1 @@ -131,9 +129,6 @@ # canonicalize prefix prefix=`echo "$prefix" | sed -e 's;//*;/;g' -e 's;/$;;'` -# canonicalize fallback -fallback=`echo "$fallback" | sed -e 's;//*;/;g' -e 's;/$;;'` - # provide default package tag if [ ".$tag" = . ]; then tag="<loc>" @@ -255,7 +250,7 @@ # find reasonable safe program path test ".$PATH" = . && PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin" -for dir in /usr/ccs/bin /usr/xpg4/bin $fallback; do +for dir in /usr/ccs/bin /usr/xpg4/bin; do test -d $dir && PATH="$PATH:$dir" done export PATH @@ -264,56 +259,6 @@ umask 022 unset ls rm mv cp sed grep awk >/dev/null 2>&1 || true -# find reasonable tool -findtool () { - n="$1" - shift - if [ ".$1" = . ]; then - shift - set -- "$@" - else - set -- "$1" - fi - tool='' - for t in "$@"; do - if [ ".$t" != . ]; then - echo "$t" | grep "\.\./" >/dev/null - if [ $? -eq 0 ]; then - echo "$0:FAILED: required tool $n at \"$t\" must not use relative path" - exit 1 - fi - echo "$t" | grep "^/" >/dev/null - if [ $? -eq 0 ]; then - if [ -f "$t" ]; then - tool="$t" - return - else - echo "$0:FAILED: required tool $n at \"$t\" not found" - exit 1 - fi - fi - for p in `IFS=":"; echo $PATH`; do - if [ -f "$p/$t" ]; then - tool="$p/$t" - return - fi - done - fi - done - if [ ".$tool" = . ]; then - echo "$0:FAILED: required tool $n not found" - exit 1 - fi -} -findtool "tar(1)" "$use_tar" gtar tar ; l_tar="$tool" -findtool "make(1L)" "$use_make" gmake make ; l_make="$tool" -findtool "cc(1)" "$use_cc" egcc ggcc gcc cc ; l_cc="$tool" -findtool "ar(1)" "$use_ar" ar ; l_ar="$tool" -findtool "ld(1)" "$use_ld" ld ; l_ld="$tool" -findtool "strip(1)" "$use_strip" strip ls ; l_strip="$tool" -set -- -echo "++ tar=$l_tar make=$l_make cc=$l_cc ar=$l_ar ld=$l_ld strip=$l_strip" - ## ## execute the spec file manually by emulating ## the behaviour of the OpenPKG RPM tool. @@ -346,12 +291,12 @@ echo "l_rgid=$rgid" echo "l_nuid=$nuid" echo "l_ngid=$ngid" - echo "l_tar=$l_tar" - echo "l_make=$l_make" - echo "l_cc=$l_cc" - echo "l_ar=$l_ar" - echo "l_ld=$l_ld" - echo "l_strip=$l_strip" + echo "use_tar=$use_tar" + echo "use_make=$use_make" + echo "use_cc=$use_cc" + echo "use_ar=$use_ar" + echo "use_ld=$use_ld" + echo "use_strip=$use_strip" grep '%define' $spec | \ sed \ -e 's:^%define *\([^ ]*\) *\(.*\):\1="\2":' @@ . patch -p0 <<'@@ .' Index: openpkg-src/openpkg/openpkg.spec ============================================================================ $ cvs diff -u -r1.443 -r1.444 openpkg.spec --- openpkg-src/openpkg/openpkg.spec 15 Aug 2005 16:17:36 -0000 1.443 +++ openpkg-src/openpkg/openpkg.spec 15 Aug 2005 16:23:44 -0000 1.444 @@ -260,26 +260,88 @@ shtool=`SOURCE shtool` echo "shtool=$shtool" >>./.buildenv - # development tools - l_tar="tar"; export l_tar - l_make="make"; export l_make - l_cc="cc"; export l_cc - l_ar="ar"; export l_ar - l_ld="ld"; export l_ld - l_strip="strip"; export l_strip + # determine development tools + # - bootstrapping: %{l_xxx} is set via sed(1) + # - upgrading new: %{l_xxx} is set via rpmmacros + # - upgrading old: %{l_xxx} is not set at all + + # manually make sure tar(1) is available + l_tar=""; export l_tar [ ".%{?l_tar:set}" = .set ] && l_tar="%{l_tar}" - [ ".%{?l_make:set}" = .set ] && l_make="%{l_make}" - [ ".%{?l_cc:set}" = .set ] && l_cc="%{l_cc}" - [ ".%{?l_ar:set}" = .set ] && l_ar="%{l_ar}" - [ ".%{?l_ld:set}" = .set ] && l_ld="%{l_ld}" - [ ".%{?l_strip:set}" = .set ] && l_strip="%{l_strip}" - ( echo "l_tar=\"$l_tar\"; export l_tar" - echo "l_make=\"$l_make\"; export l_make" - echo "l_cc=\"$l_cc\"; export l_cc" - echo "l_ar=\"$l_ar\"; export l_ar" - echo "l_ld=\"$l_ld\"; export l_ld" - echo "l_strip=\"$l_strip\"; export l_strip" - ) >>.buildenv + [ ".%{?use_tar:set}" = .set ] && l_tar="%{use_tar}" + if [ ".$l_tar" = . ]; then + l_tar=`sh $shtool path gtar tar` + if [ ".$l_tar" = . ]; then + echo "openpkg: prerequisite tool \`gtar' or \`tar' not found" + exit 1 + fi + fi + echo "l_tar=\"$l_tar\"; export l_tar" >>.buildenv + + # manually make sure make(1) is available + l_make=""; export l_make + [ ".%{?l_make:set}" = .set ] && l_make="%{l_make}" + [ ".%{?use_make:set}" = .set ] && l_make="%{use_make}" + if [ ".$l_make" = . ]; then + l_make=`sh $shtool path gmake make` + if [ ".$l_make" = . ]; then + echo "openpkg: prerequisite tool \`gmake' or \`make' not found" + exit 1 + fi + fi + echo "l_make=\"$l_make\"; export l_make" >>.buildenv + + # manually make sure cc(1) is available + l_cc=""; export l_cc + [ ".%{?l_cc:set}" = .set ] && l_cc="%{l_cc}" + [ ".%{?use_cc:set}" = .set ] && l_cc="%{use_cc}" + if [ ".$l_cc" = . ]; then + l_cc=`sh $shtool path gcc cc` + if [ ".$l_cc" = . ]; then + echo "openpkg: prerequisite tool \`gcc' or \`cc' not found" + exit 1 + fi + fi + echo "l_cc=\"$l_cc\"; export l_cc" >>.buildenv + + # manually make sure ar(1) is available + l_ar=""; export l_ar + [ ".%{?l_ar:set}" = .set ] && l_ar="%{l_ar}" + [ ".%{?use_ar:set}" = .set ] && l_ar="%{use_ar}" + if [ ".$l_ar" = . ]; then + l_ar=`sh $shtool path ar` + if [ ".$l_ar" = . ]; then + echo "openpkg: prerequisite tool \`ar' not found" + exit 1 + fi + fi + echo "l_ar=\"$l_ar\"; export l_ar" >>.buildenv + + # manually make sure ld(1) is available + l_ld=""; export l_ld + [ ".%{?l_ld:set}" = .set ] && l_ld="%{l_ld}" + [ ".%{?use_ld:set}" = .set ] && l_ld="%{use_ld}" + if [ ".$l_ld" = . ]; then + l_ld=`sh $shtool path ld` + if [ ".$l_ld" = . ]; then + echo "openpkg: prerequisite tool \`ld' not found" + exit 1 + fi + fi + echo "l_ld=\"$l_ld\"; export l_ld" >>.buildenv + + # manually make sure strip(1) is available or use a null replacement + l_strip=""; export l_strip + [ ".%{?l_strip:set}" = .set ] && l_strip="%{l_strip}" + [ ".%{?use_strip:set}" = .set ] && l_strip="%{use_strip}" + if [ ".$l_strip" = . ]; then + l_strip=`sh $shtool path strip ls` + if [ ".$l_strip" = . ]; then + echo "openpkg: prerequisite tool \`strip' not found" + exit 1 + fi + fi + echo "l_strip=\"$l_strip\"; export l_strip" >>.buildenv # determine path to aux.usrgrp.sh script usrgrp=`SOURCE aux.usrgrp.sh` @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org