[Frugalware-git] xfcetesting: util.sh / Frcd: drop support for old-style localized strings
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=c7de0fffd34f2c5bf5ae25ee9a7587070d5fdbb8 commit c7de0fffd34f2c5bf5ae25ee9a7587070d5fdbb8 Author: Miklos Vajna Date: Mon Nov 5 22:12:38 2012 +0100 util.sh / Frcd: drop support for old-style localized strings diff --git a/source/include/util.sh b/source/include/util.sh index 762ee5a..df8026c 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1156,7 +1156,6 @@ Frcd() { if [ "$#" -eq 1 ]; then Fmessage "Creating rc.d environment: $1" Fexe /etc/rc.d/rc.$1 - Ffile ../messages/* /etc/rc.d/rc.messages/ else # rc script if [ -z "$_F_rcd_name" ]; then ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: F chown/chmod functions can now work with full file paths containing spaces
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=f9f5bfbdc6cec865f839aa2884d486fc02b0bd49 commit f9f5bfbdc6cec865f839aa2884d486fc02b0bd49 Author: James Buren Date: Mon Jun 25 21:46:10 2012 -0500 util.sh: F chown/chmod functions can now work with full file paths containing spaces diff --git a/source/include/util.sh b/source/include/util.sh index 65b31c3..0a6a514 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -463,7 +463,7 @@ Finstall() { ### Fdirschmod() { Fmessage "Changing directory permissions inside: $1" - find "$Fdestdir"/$1 -type d |xargs chmod $2 || Fdie + find "$Fdestdir"/$1 -type d -print0 |xargs -0 chmod $2 || Fdie } ### @@ -473,7 +473,7 @@ Fdirschmod() { ### Ffileschmod() { Fmessage "Changing file permissions inside: $1" -find "$Fdestdir"/$1 -type f |xargs chmod $2 || Fdie +find "$Fdestdir"/$1 -type f -print0 |xargs -0 chmod $2 || Fdie } ### @@ -482,7 +482,7 @@ Ffileschmod() { ### Fdirschown() { Fmessage "Changing the owner of directories inside: $1" - find "$Fdestdir"/$1 -type d |xargs chown $2:$3 || Fdie + find "$Fdestdir"/$1 -type d -print0 |xargs -0 chown $2:$3 || Fdie } ### @@ -491,7 +491,7 @@ Fdirschown() { ### Ffileschown() { Fmessage "Changing the owner of files inside: $1" - find "$Fdestdir"/$1 -type f |xargs chown $2:$3 || Fdie + find "$Fdestdir"/$1 -type f -print0 |xargs -0 chown $2:$3 || Fdie } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: modify Freplace to work with variable arrays
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=c94decb08dbfd4bc5306713415cef76a82ba9da9 commit c94decb08dbfd4bc5306713415cef76a82ba9da9 Author: James Buren Date: Mon Jun 4 21:27:31 2012 -0500 util.sh: modify Freplace to work with variable arrays diff --git a/source/include/util.sh b/source/include/util.sh index a197e6f..cf874f1 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -674,7 +674,7 @@ Freplace() { for i in "${@:2:$#}"; do for path in $i; do # expand $i if possible Fmessage "Subtituing $1 in file: $path" - eval "__Fsed '@$1@' \"\${$1}\" \"\$path\"" + __Fsed "@$1@" "$(eval echo \${$1[@]})" "$path" done done } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: modify Freplace to work with variable arrays
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=f628a34356e2018a0c9d194411f93a1c4b5965ef commit f628a34356e2018a0c9d194411f93a1c4b5965ef Author: James Buren Date: Mon Jun 4 21:27:31 2012 -0500 util.sh: modify Freplace to work with variable arrays diff --git a/source/include/util.sh b/source/include/util.sh index 7156dd8..cd1f778 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -674,7 +674,7 @@ Freplace() { for i in "${@:2:$#}"; do for path in $i; do # expand $i if possible Fmessage "Subtituing $1 in file: $path" - eval "__Fsed '@$1@' \"\${$1}\" \"\$path\"" + __Fsed "@$1@" "$(eval echo \${$1[@]})" "$path" done done } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=ab39cbcfbdff04c7f511bb9bf662334a8bf2abae commit ab39cbcfbdff04c7f511bb9bf662334a8bf2abae Author: Michel Hermier Date: Wed May 9 08:03:42 2012 +0200 util.sh * Addapt latest build system. * Next step try to automate all this, now that we have multiple build system, answering to the same interface. diff --git a/source/include/util.sh b/source/include/util.sh index 4aa600d..7156dd8 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -818,7 +818,6 @@ Fconfoptstryset() { Fbuildsystem_configure() { # This build system USUALLY produce a Fbuildsystem_make compatible environment - local command="$1" shift @@ -860,7 +859,6 @@ Fbuildsystem_configure() { Fbuildsystem_perl () { # This build system produce a Fbuildsystem_make compatible environment - local command="$1" shift @@ -885,6 +883,26 @@ Fbuildsystem_perl () { esac } +Fbuildsystem_ruby_configure () { + # This build system produce a Fbuildsystem_make compatible environment + local command="$1" + shift + + case "$command" in + 'probe') + test -f configure.rb + return $? + ;; + 'configure') + Fexec ruby configure.rb --prefix="$Fprefix" "$@" + return $? + ;; + *) + return -1 + ;; + esac +} + Fbuildsystem_ruby_extconf () { # This build system produce a Fbuildsystem_make compatible environment local command="$1" @@ -933,6 +951,65 @@ Fbuildsystem_ruby_setup () { esac } +Fbuildsystem_python_setup() { + local command="$1" + shift + + case "$command" in + 'probe') + test -f setup.py + return $? + ;; + 'make') + # does configure and build + Fexec python setup.py build "$@" + return $? + ;; + 'install') + Fexec python setup.py install --prefix "$Fprefix" --root "$Fdestdir" "$@" + return $? + ;; + *) + return -1 + ;; + esac +} + +Fbuildsystem_java_ant () { + local command="$1" + shift + + case "$command" in + 'probe') + test -f build.xml + return $? + ;; + 'make') + if declare -f Fant >/dev/null; then + Fjavacleanup + Fant "$@" || Fdie + else + Fmessage "build.xml found, but missing Finclude java!" + Fdie + fi + ;; + 'install') + if declare -f Fjar >/dev/null; then + for i in ${_F_java_jars[@]} + do + Fjar $i || Fdie + done + else + Fmessage "build.xml found, but missing Finclude java!" + Fdie + fi + ;; + *) + return -1 + ;; + esac +} + ### # * Fconf(): A wrapper to ./configure. It will try to run ./configure, # Makefile.PL, extconf.rb and configure.rb, respectively. It will automatically @@ -954,8 +1031,8 @@ Fconf() { Fbuildsystem_perl 'configure' "$@" || Fdie elif Fbuildsystem_ruby_extconf 'probe' ; then Fbuildsystem_ruby_extconf 'configure' "$@" || Fdie - elif [ -f configure.rb ]; then - Fexec ./configure.rb --prefix="$Fprefix" "$@" || Fdie + elif Fbuildsystem_ruby_configure 'probe' ; then + Fbuildsystem_ruby_configure 'configure' "$@" || Fdie elif Fbuildsystem_ruby_setup 'probe'; then Fbuildsystem_ruby_setup 'configure' "$@" || Fdie fi @@ -970,18 +1047,12 @@ Fmake() { Fmessage "Compiling..." if Fbuildsystem_make 'probe'; then Fbuildsystem_make 'make' || Fdie - elif [ -f setup.py ]; then - python setup.py build "$@" || Fdie # does configure and build + elif Fbuildsystem_python_setup 'probe'; then + Fbuildsystem_python_setup 'make' "$@" || Fdie elif Fbuildsystem_ruby_setup 'probe'; then Fbuildsystem_ruby_setup 'make' "$@" || Fdie - elif [ -f build.xml ]; then - if declare -f Fant >/dev/null; then - Fjavacleanup - Fant "$@" || Fdie - else - Fmessage "build.xml found, but missing Finclude java!" - Fdie - fi + elif Fbuildsystem_java_ant 'probe'; then + Fbuildsystem_ruby_setup 'make' "$@" || Fdie else Fmessage "No Makefile or setup.py found!" Fdie @@ -1015,20 +1086,12 @@ Fmakeinstall() { Fmessage "Installing to the package directory..." if Fbuildsystem_make 'probe'; then Fbuildsystem_make 'install' "$@" || Fdie - elif [ -f setup.py ]; then - Fexec python setup.py install --prefix "$Fprefix" --r
[Frugalware-git] xfcetesting: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=4ee9874d6e80c09461e943194da5e532149052b6 commit 4ee9874d6e80c09461e943194da5e532149052b6 Author: Michel Hermier Date: Thu May 3 12:14:50 2012 +0200 util.sh * Abstract 3 more build system. Only one left in util.sh. diff --git a/source/include/util.sh b/source/include/util.sh index f3df8d7..4aa600d 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -817,6 +817,8 @@ Fconfoptstryset() { } Fbuildsystem_configure() { + # This build system USUALLY produce a Fbuildsystem_make compatible environment + local command="$1" shift @@ -856,6 +858,81 @@ Fbuildsystem_configure() { esac } +Fbuildsystem_perl () { + # This build system produce a Fbuildsystem_make compatible environment + + local command="$1" + shift + + case "$command" in + 'probe') + test -f Makefile.PL + return $? + ;; + 'configure') + if [ -z "$_F_conf_perl_pipefrom" ]; then + Fexec perl Makefile.PL DESTDIR=$Fdestdir "$@" || Fdie + else + $_F_conf_perl_pipefrom | perl Makefile.PL DESTDIR=$Fdestdir "$@" || Fdie + fi + unset _F_conf_perl_pipefrom + Fsed `perl -e 'printf "%vd", $^V'` "current" Makefile + return $? + ;; + *) + return -1 + ;; + esac +} + +Fbuildsystem_ruby_extconf () { + # This build system produce a Fbuildsystem_make compatible environment + local command="$1" + shift + + case "$command" in + 'probe') + test -f extconf.rb + return $? + ;; + 'configure') + Fexec ruby extconf.rb --prefix="$Fprefix" "$@" + return $? + ;; + *) + return -1 + ;; + esac +} + +Fbuildsystem_ruby_setup () { + local command="$1" + shift + + case "$command" in + 'probe') + test -f setup.rb + return $? + ;; + 'configure') + Fexec ruby setup.rb config "$@" + return $? + ;; + 'make') + # Original code used 'setup' directive but setup.rb manual say 'make' have to be checked + Fexec ruby setup.rb make "$@" + return $? + ;; + 'install') + Fexec ruby setup.rb install --prefix=$Fdestdir "$@" + return $? + ;; + *) + return -1 + ;; + esac +} + ### # * Fconf(): A wrapper to ./configure. It will try to run ./configure, # Makefile.PL, extconf.rb and configure.rb, respectively. It will automatically @@ -873,20 +950,14 @@ Fconf() { if Fbuildsystem_configure 'probe'; then Fbuildsystem_configure 'prepare' || Fdie Fbuildsystem_configure 'configure' "$@" || Fdie - elif [ -f Makefile.PL ]; then - if [ -z "$_F_conf_perl_pipefrom" ]; then - Fexec perl Makefile.PL DESTDIR=$Fdestdir "$@" || Fdie - else - $_F_conf_perl_pipefrom | perl Makefile.PL DESTDIR=$Fdestdir "$@" || Fdie - fi - unset _F_conf_perl_pipefrom - Fsed `perl -e 'printf "%vd", $^V'` "current" Makefile - elif [ -f extconf.rb ]; then - Fexec ruby extconf.rb --prefix="$Fprefix" "$@" || Fdie + elif Fbuildsystem_perl 'probe'; then + Fbuildsystem_perl 'configure' "$@" || Fdie + elif Fbuildsystem_ruby_extconf 'probe' ; then + Fbuildsystem_ruby_extconf 'configure' "$@" || Fdie elif [ -f configure.rb ]; then Fexec ./configure.rb --prefix="$Fprefix" "$@" || Fdie - elif [ -f setup.rb ]; then - Fexec ruby setup.rb config "$@" || Fdie + elif Fbuildsystem_ruby_setup 'probe'; then +Fbuildsystem_ruby_setup 'configure' "$@" || Fdie fi } @@ -900,9 +971,9 @@ Fmake() { if Fbuildsystem_make 'probe'; then Fbuildsystem_make 'make' || Fdie elif [ -f setup.py ]; then - python setup.py build "$@" || Fdie - elif [ -f setup.rb ]; then - ruby setup.rb setup "$@" || Fdie + python setup.py build "$@" || Fdie # does configure and build + elif Fbuildsystem_ruby_setup 'probe'; then + Fbuildsystem_ruby_setup 'make' "$@" || Fdie elif [ -f build.xml ]; then if declare -f Fant >/dev/null; then Fjavacleanup @@ -946,8 +1017,8 @@ Fmakeinstall() { Fbuildsystem_make 'install' "$@" || Fdie elif [ -f setup.py ]; then Fexec python setup.py install --prefix "$Fprefix" --root "$Fdestdir" "$@" || Fdie - elif [ -f setup.rb ]; then - Fexec ruby setup.rb install --prefix=$Fdestdir || Fdie + elif Fbuildsystem_ruby_setup 'probe'; then + Fbuildsystem_ruby_setup 'insta
[Frugalware-git] xfcetesting: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=909e865896b30e644668d45f5923c1618b170029 commit 909e865896b30e644668d45f5923c1618b170029 Author: Michel Hermier Date: Wed May 2 22:10:09 2012 +0200 util.sh * Refactor configure and make as build system, as single utility functions. * This is the first patch of a series that will isolate various build systems into functions. The aim is to have a single function convention/API, so we can add easily new build system (Cmake/waf/nant/...) transparently when using Fbuild. And ultimately remove some build system out of util.sh. diff --git a/source/include/util.sh b/source/include/util.sh index fa9e790..f3df8d7 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -761,6 +761,35 @@ Fpatchall() { done } +Fbuildsystem_make() { + local command="$1" + shift + + case "$command" in + 'probe') + test -f GNUmakefile -o -f makefile -o -f Makefile + return $? + ;; + 'make') + Fexec make $_F_make_opts "$@" + return $? + ;; + 'install') + if make -p -q DESTDIR="@FDESTDIR@" "$@" install 2>/dev/null | grep -v 'DESTDIR\s*=' | \ + grep -q "@FDESTDIR@\\|\$DESTDIR\\|\$(DESTDIR)\\|\${DESTDIR}" 2>/dev/null; then + _F_make_opts="$_F_make_opts DESTDIR=$Fdestdir" + else + _F_make_opts="$_F_make_opts prefix=$Fdestdir/$Fprefix" + fi + Fexec make $_F_make_opts "$@" install + return $? + ;; + *) + return -1 + ;; + esac +} + ### # * Fconfoptstryset(): A utility function that try to append an option to # $Fconfopts if $_F_conf_configure supports it and is not already used in @@ -787,19 +816,10 @@ Fconfoptstryset() { return 0 } -### -# * Fconf(): A wrapper to ./configure. It will try to run ./configure, -# Makefile.PL, extconf.rb and configure.rb, respectively. It will automatically -# add the --prefix=$Fprefix (defaults to /usr), --sysconfdir=$Fsysconfdir -# (defaults to /etc) and the --localstatedir=$Flocalstatedir (defaults to /var) -# switches. The two later will be added only if the configure script support -# it. If you want to pre-set a switch (i.e. add a switch only on a certain arch -# or so) append the $Fconfopts variable. Parameter: switch(es) to pass to the -# configure script. -### -Fconf() { - Fcd - Fmessage "Configuring..." +Fbuildsystem_configure() { + local command="$1" + shift + if [ -z "$_F_conf_configure" ]; then _F_conf_configure="./configure" if [ ! -x "$_F_conf_configure" -a -n "$_F_conf_outsource" ]; then @@ -807,11 +827,19 @@ Fconf() { fi fi - if [ ! -e "$_F_conf_configure" ]; then - Fautogen - fi - - if [ -x "$_F_conf_configure" ]; then + case "$command" in + 'probe') + test -x "$_F_conf_configure" -o -f "$_F_conf_configure.ac" -o -f "$_F_conf_configure.in" + return $? + ;; + 'prepare') + if [ ! -e "$_F_conf_configure" ]; then + Fautogen + return $? + fi + return 0 + ;; + 'configure') Fconfoptstryset "prefix" "$Fprefix" Fconfoptstryset "sysconfdir" "$Fsysconfdir" Fconfoptstryset "localstatedir" "$Flocalstatedir" @@ -819,7 +847,32 @@ Fconf() { Fconfoptstryset "infodir" "$Finfodir" Fconfoptstryset "mandir" "$Fmandir" Fconfoptstryset "build" "$Fbuildchost" - Fexec $_F_conf_configure $Fconfopts "$@" || Fdie + Fexec $_F_conf_configure $Fconfopts "$@" + return $? + ;; + *) + return -1 + ;; + esac +} + +### +# * Fconf(): A wrapper to ./configure. It will try to run ./configure, +# Makefile.PL, extconf.rb and configure.rb, respectively. It will automatically +# add the --prefix=$Fprefix (defaults to /usr), --sysconfdir=$Fsysconfdir +# (defaults to /etc) and the --localstatedir=$Flocalstatedir (defaults to /var) +# switches. The two later will be added only if the configure script support +# it. If you want to pre-set a switch (i.e. add a switch only on a certain arch +# or so) append the $Fconfopts variable. Parameter: switch(es) to pass to the +# configure script. +### +Fconf() { + Fcd + Fmessage "Configuring..." + + if Fbuildsystem_configure 'probe'; then + Fbuildsystem_configure 'prepare' || Fdie + Fbuildsystem_configure 'configure' "$@" || Fdie elif [ -f Makefile.PL ]; then if [ -z "$_F_conf_perl_pipefrom" ]; then Fexec perl Makefile.PL DESTDIR=$Fdestdir "$@" || Fdie @@ -844,8 +897,8 @@ Fconf() { Fmake() { Fconf "$@" Fmessage "Compiling..." - if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then - Fexec make $_F_make_opts ||
[Frugalware-git] xfcetesting: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=9b5ae33aa6204d24e28ceb358cc86f44f7bcf2cb commit 9b5ae33aa6204d24e28ceb358cc86f44f7bcf2cb Author: Michel Hermier Date: Wed Nov 2 17:49:15 2011 +0100 util.sh * Add infodir option handling for configure scripts. diff --git a/source/include/util.sh b/source/include/util.sh index 7ecadf0..00011ea 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -92,6 +92,7 @@ Fdestdir="$startdir/pkg" Fprefix="/usr" Fsysconfdir="/etc" Flocalstatedir="/var" +Finfodir="/usr/share/info" Fmandir="/usr/share/man" Fmenudir="/usr/share/applications" Farchs=('i686' 'x86_64' 'ppc' 'arm') @@ -811,6 +812,7 @@ Fconf() { Fconfoptstryset "sysconfdir" "$Fsysconfdir" Fconfoptstryset "localstatedir" "$Flocalstatedir" Fconfoptstryset "docdir" "/usr/share/doc/$pkgname-$pkgver" + Fconfoptstryset "infodir" "$Finfodir" Fconfoptstryset "mandir" "$Fmandir" Fconfoptstryset "build" "$Fbuildchost" Fexec $_F_conf_configure $Fconfopts "$@" || Fdie ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: add arm to Farchs and fix Fbuildchost on arm
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=8a928194d063a9fb0c0fc5130c22ac58496ecfd5 commit 8a928194d063a9fb0c0fc5130c22ac58496ecfd5 Author: Elentir Date: Mon Feb 14 22:24:56 2011 + util.sh: add arm to Farchs and fix Fbuildchost on arm diff --git a/source/include/util.sh b/source/include/util.sh index 73ef930..edec799 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -94,8 +94,12 @@ Fsysconfdir="/etc" Flocalstatedir="/var" Fmandir="/usr/share/man" Fmenudir="/usr/share/applications" -Farchs=('i686' 'x86_64' 'ppc') -Fbuildchost="`arch`-frugalware-linux" +Farchs=('i686' 'x86_64' 'ppc' 'arm') +if [[ "`arch`" == arm* ]]; then + Fbuildchost="arm-frugalware-linux-gnueabi" +else + Fbuildchost="`arch`-frugalware-linux" +fi Fconfopts="" ## Move to makepkg.conf for Kalgan+1 export LDFLAGS="-Wl,--hash-style=both" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=1344af058823a74a0c591656045a035aca34f556 commit 1344af058823a74a0c591656045a035aca34f556 Author: Michel Hermier Date: Sun Jan 23 22:27:51 2011 +0100 util.sh * Fix some style/encoding problems. diff --git a/source/include/util.sh b/source/include/util.sh index 2f6b357..73ef930 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -135,8 +135,7 @@ Fcpvar() { # * Fuse(): Checks a use variable. Parameter: a use variable value or the use # variable name. Example: Fuse DEVEL and Fuse $USE_DEVEL are equivalent. ### -Fuse() -{ +Fuse() { local use Fcpvar use "USE_$1" if [ "$use" = "n" ]; then @@ -1218,7 +1217,7 @@ Flastdir() { if [ -z "$1" ]; then Flastarchive '/' else - #Â The trailing '/' in the url is here to avoid a redirection + # The trailing '/' in the url is here to avoid a redirection # bug in Fwcat. Flastarchive "$1/" '/' fi ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=f1b199c5260604e625f9d2f3b435c978b0f20427 commit f1b199c5260604e625f9d2f3b435c978b0f20427 Author: Michel Hermier Date: Sun Jan 23 08:55:14 2011 +0100 util.sh * Introduce Flastdir and Flastverdir. While Flastdir checks version dir with regular archive name scheme ('/bar/foo-1.2.3/'), Flastverdir only checks for version numbers only directory ('/foo/1.2.3/') diff --git a/source/include/util.sh b/source/include/util.sh index 646a484..2f6b357 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1211,6 +1211,28 @@ Flastarchive() { } ### +# * Flastdir(): A convenience function to Flastarchive for directories. +# Parameters: 1) url (optional) see Flastarchive +### +Flastdir() { + if [ -z "$1" ]; then + Flastarchive '/' + else + #Â The trailing '/' in the url is here to avoid a redirection + # bug in Fwcat. + Flastarchive "$1/" '/' + fi +} + +### +# * Flastverdir(): A convenience function to Flastdir for version only +# directories. Parameters: 1) url (optional) see Flastdir +### +Flastverdir() { + pkgname='' Fpkgversep='' _F_archive_name='' Flastdir "$1" +} + +### # * Flasttar(): A convenience function to Flastarchive for all the known tar # ball extension. Parameters: 1) url (optional) see Flastarchive ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=e7ddf7ba91317f3c113e527653b2e8963729ea21 commit e7ddf7ba91317f3c113e527653b2e8963729ea21 Author: Michel Hermier Date: Sat Jan 22 15:10:21 2011 +0100 util.sh * Don't overwrite _F_kde_folder if allready set. * Use _F_kde_pkgver in dir name instead of _F_kde_ver (follow pkg version convention) diff --git a/source/include/kde.sh b/source/include/kde.sh index 4d6..5a343c8 100644 --- a/source/include/kde.sh +++ b/source/include/kde.sh @@ -64,14 +64,16 @@ if [ -z "$_F_kde_mirror" ]; then _F_kde_mirror="ftp://ftp.kde.org/pub/kde"; fi -if [ -z "$_F_kde_unstable" ]; then - _F_kde_folder="stable" -else - _F_kde_folder="unstable" +if [ -z "$_F_kde_folder" ]; then + if [ -z "$_F_kde_unstable" ]; then + _F_kde_folder="stable" + else + _F_kde_folder="unstable" + fi fi if [ -z "$_F_kde_dirname" ]; then - _F_kde_dirname="$_F_kde_folder/$_F_kde_ver/src" + _F_kde_dirname="$_F_kde_folder/$_F_kde_pkgver/src" fi if [ -n "$_F_kde_final" ]; then ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: Introduce _F_make_opts.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=3bddbde37bb08cf72016389b7b6d24d7497aa1cd commit 3bddbde37bb08cf72016389b7b6d24d7497aa1cd Author: Michel Hermier Date: Thu Jan 13 00:24:15 2011 +0100 util.sh: Introduce _F_make_opts. * This new variable will allow to pass extra arguments to the make invocations. diff --git a/source/include/util.sh b/source/include/util.sh index c1de652..c606223 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -55,6 +55,8 @@ # DE like "XFCE;" for Xfce, "GNOME;" for Gnome, etc. # * _F_conf_notry: Fconf will try to use prefix, mandir and similar # parameters by default. You can disable the try of a parameter here. +# * _F_make_opts (defaults to empty): extra make arguments used both with Fmake +# and Fmakeinstall. ### # Copyright (C) 2005-2006 Bence Nagy @@ -834,7 +836,7 @@ Fmake() { Fconf "$@" Fmessage "Compiling..." if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then - make || Fdie + Fexec make $_F_make_opts || Fdie elif [ -f setup.py ]; then python setup.py build "$@" || Fdie elif [ -f setup.rb ]; then @@ -881,10 +883,11 @@ Fmakeinstall() { if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then if make -p -q DESTDIR="$Fdestdir" "$@" install 2>/dev/null | grep -v 'DESTDIR\s*=' | \ grep -q "$Fdestdir\\|\$DESTDIR\\|\$(DESTDIR)\\|\${DESTDIR}" 2>/dev/null; then - Fexec make DESTDIR="$Fdestdir" "$@" install || Fdie + _F_make_opts="$_F_make_opts DESTDIR=\"$Fdestdir\"" else - Fexec make prefix="$Fdestdir"/"$Fprefix" "$@" install || Fdie + _F_make_opts="$_F_make_opts prefix=\"$Fdestdir/$Fprefix\"" fi + Fexec make $_F_make_opts "$@" install || Fdie elif [ -f setup.py ]; then Fexec python setup.py install --prefix "$Fprefix" --root "$Fdestdir" "$@" || Fdie elif [ -f setup.rb ]; then ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: Introduce Flowerstr and Fupperstr.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=698ac864bb997e5f3b76b46bae8447cc899372ad commit 698ac864bb997e5f3b76b46bae8447cc899372ad Author: Michel Hermier Date: Wed Jan 5 22:01:14 2011 +0100 util.sh: Introduce Flowerstr and Fupperstr. * Introduce this facility to reduce duplication over util.sh. NOTE: we could have used the bash sytax ${foo,,} and ${foo^^} to achieve the same thing, but this way is more portable. diff --git a/source/include/util.sh b/source/include/util.sh index 57ad90b..8b4b52f 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -152,6 +152,20 @@ Fuse() } ### +# * Flowerstr(): Lower a string. Parameters: The string to lower. +### +Flowerstr() { + echo -nE "$@"|tr '[:upper:]' '[:lower:]' +} + +### +# *Fupperstr(): Upper a string. Parameters: The string to upper. +### +Fupperstr() { + echo -nE "$@"|tr '[:lower:]' '[:upper:]' +} + +### # * __Faddsubpkg(): Internal usage only. Registers one new subpkg per call. # Takes any number of parameters. Each parameter must be in the form of # "key:value". The key is what the variable would be called if it were a @@ -1437,11 +1451,9 @@ Fsplit() ### check_option() { local i - for i in ${options[@]}; do - local uc=`echo $i | tr '[:lower:]' '[:upper:]'` - local lc=`echo $i | tr '[:upper:]' '[:lower:]'` - if [ "$uc" = "$1" -o "$lc" = "$1" ]; then - echo $1 + for i in "${options[@]}"; do + if [ `Flowerstr "$i"` = "$1" -o `Fupperstr "$i"` = "$1" ]; then + echo -nE "$1" return fi done @@ -1457,11 +1469,11 @@ check_option() { Fmsgfmt() { local llang mofile pofile slang - if echo $2|grep -q _ ; then + if echo -nE "$2"|grep -q _ ; then llang="$2" slang=`echo $llang|cut -d _ -f 1` else - llang=${2}_`echo $2|tr [:lower:] [:upper:]` + llang="${2}_`Fupperstr \"$2\"`" slang="$2" fi @@ -1479,10 +1491,9 @@ Fmsgfmt() { # Fextract pacman.tar.gz. ### Fextract() { - local cmd file tmp + local cmd file file="${1}" - tmp="$(echo "${file}" | tr 'A-Z' 'a-z')" - case "${tmp}" in + case `Flowerstr "$file"` in *.tar.bz2|*.tbz2) cmd="tar $_F_extract_taropts --use-compress-program=bzip2 -xf $file" ;; *.tar.gz|*.tar.z|*.tgz) ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: Introduce _F_archive_ver.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=bce97e9d6a29f5cc0b61f4f82e7de263693bf1e1 commit bce97e9d6a29f5cc0b61f4f82e7de263693bf1e1 Author: Michel Hermier Date: Wed Jan 5 21:36:09 2011 +0100 util.sh: Introduce _F_archive_ver. * Introduce this facility in the hoppe it help reduce the ${pkgver/-/_} madness. Also, one can do: pkgver=`Fsanitizeversion "$_F_archive_ver"` to automagically generate pkgver from _F_archive_ver. diff --git a/source/include/util.sh b/source/include/util.sh index 2c90780..57ad90b 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -24,6 +24,7 @@ # # == OPTIONS # * _F_archive_name (defaults to $pkgname) +# * _F_archive_ver (defaults to $pkgver$pkgextraver) # * _F_archive_prefix (defaults to "") # * _F_archive_nolinksonly (defaults to no, so that only links are proceeded by # default) @@ -32,7 +33,7 @@ # searching for the version # * _F_archive_grepv (defaults to empty): grep -v for a regexp before # searching for the version -# * _F_cd_path (defaults to $_F_archive_name$Fpkgversep$pkgver$pkgextraver) +# * _F_cd_path (defaults to $_F_archive_name$Fpkgversep$_F_archive_ver) # * _F_conf_configure (defaults to ./configure) # * _F_conf_perl_pipefrom: if set, pipe the output of this command in Fconf() # for perl packages @@ -247,8 +248,11 @@ Fcd() { if [ -z "$_F_archive_name" ]; then _F_archive_name="$pkgname" fi + if [ -z "$_F_archive_ver" ]; then + _F_archive_ver="$pkgver$pkgextraver" + fi if [ -z "$_F_cd_path" ]; then - _F_cd_path="$_F_archive_name$Fpkgversep$pkgver$pkgextraver" + _F_cd_path="$_F_archive_name$Fpkgversep$_F_archive_ver" fi if [ "$Fsrcdir" = `pwd` ]; then ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: Add Fcpvar and make Fuse accept use variable name.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=2b292c9ef6497603e4bfca3f3ddd6839e0e2cc5c commit 2b292c9ef6497603e4bfca3f3ddd6839e0e2cc5c Author: Michel Hermier Date: Wed Jan 5 14:47:21 2011 +0100 util.sh: Add Fcpvar and make Fuse accept use variable name. diff --git a/source/include/util.sh b/source/include/util.sh index 8e0c0a0..2c90780 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -118,17 +118,34 @@ Fdie() { } ### -# * Fuse(): Checks a use variable. Parameter: a use variable. Example: Fuse -# $USE_DEVEL. +# * Fcpvar(): Copy a variable to another by name. Parameters: 1) Destination +# variable name. 2) Source variable name. Example: Fcpvar use USE_$FOO +# +# NOTE: This is a shortcut to tmp=a$b; c=${!tmp}, Fcpvar can do this in one go +# (and even 'c' can be a variable). +### +Fcpvar() { + eval "$1=(\"\${$2[@]}\")" +} + +### +# * Fuse(): Checks a use variable. Parameter: a use variable value or the use +# variable name. Example: Fuse DEVEL and Fuse $USE_DEVEL are equivalent. ### Fuse() { - if [ "$1" = "n" ]; then + local use + Fcpvar use "USE_$1" + if [ "$use" = "n" ]; then + return 1 + elif [ "$use" = "y" ]; then + return 0 + elif [ "$1" = "n" ]; then return 1 elif [ "$1" = "y" ]; then return 0 else - Fmessage "Unknown use variable!" + Fmessage "Unknown use variable $1!" Fdie fi } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] xfcetesting: util.sh: Move Fuse to the top with other low level functions.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=4fb3066e48b14ffc960fd635fd3d116d21db03f8 commit 4fb3066e48b14ffc960fd635fd3d116d21db03f8 Author: Michel Hermier Date: Mon Jan 3 13:17:12 2011 +0100 util.sh: Move Fuse to the top with other low level functions. diff --git a/source/include/util.sh b/source/include/util.sh index c2beb71..8e0c0a0 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -118,6 +118,22 @@ Fdie() { } ### +# * Fuse(): Checks a use variable. Parameter: a use variable. Example: Fuse +# $USE_DEVEL. +### +Fuse() +{ + if [ "$1" = "n" ]; then + return 1 + elif [ "$1" = "y" ]; then + return 0 + else + Fmessage "Unknown use variable!" + Fdie + fi +} + +### # * __Faddsubpkg(): Internal usage only. Registers one new subpkg per call. # Takes any number of parameters. Each parameter must be in the form of # "key:value". The key is what the variable would be called if it were a @@ -1393,22 +1409,6 @@ Fsplit() done } -## -# * Fuse(): Checks a use variable. Parameter: a use variable. Example: Fuse -# $USE_DEVEL. -## -Fuse() -{ - if [ "$1" = "n" ]; then - return 1 - elif [ "$1" = "y" ]; then - return 0 - else - Fmessage "Unknown use variable!" - Fdie - fi -} - ### # * check_option(): Check if a logical flag is defined in options() or not. # Parameter: name of the logical flag. Example: if [ "`check_option DEVEL`" ]; ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git