[Frugalware-git] frugalware-current: util.sh: disable __is_deprecated() for now
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=da5f282f35c248f0e49cec579161f75d4fef9083 commit da5f282f35c248f0e49cec579161f75d4fef9083 Author: crazy Date: Sun Nov 26 02:25:25 2017 +0100 util.sh: disable __is_deprecated() for now diff --git a/source/include/util.sh b/source/include/util.sh index eb44d7d..1fc9db0 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -131,9 +131,9 @@ Fdie() { } ## internal -__is_deprecated() { - warning "Function ${FUNCNAME[1]}() is deprecated , port your package away from it." -} +#__is_deprecated() { +# warning "Function ${FUNCNAME[1]}() is deprecated , port your package away from it." +#} ### # * Fcpvar(): Copy a variable to another by name. Parameters: 1) Destination @@ -238,7 +238,7 @@ __Faddsubpkg() { ### Faddsubpkg() { - __is_deprecated + #__is_deprecated local g a if [ "$#" -lt 3 ]; then ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh added __is_deprecated() * new internal function, can be used to deprecate other functions
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=fab02120d5290ba7a9153b2453d3099b6962159d commit fab02120d5290ba7a9153b2453d3099b6962159d Author: crazy Date: Sat May 20 13:12:52 2017 +0200 util.sh added __is_deprecated() * new internal function, can be used to deprecate other functions diff --git a/source/include/util.sh b/source/include/util.sh index f008c45..72208b2 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -130,6 +130,11 @@ Fdie() { exit 2 } +## internal +__is_deprecated() { + warning "Function ${FUNCNAME[1]}() is deprecated , port your package away from it." +} + ### # * Fcpvar(): Copy a variable to another by name. Parameters: 1) Destination # variable name. 2) Source variable name. Example: Fcpvar use USE_$FOO ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh * added helper function for perl .. so we can use that without Fmake* too * perl-* with custom build need Ffix_perl at the end of the FB
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=3b66b65eb3fdc10edd12e8313fc0e2de11ed671d commit 3b66b65eb3fdc10edd12e8313fc0e2de11ed671d Author: crazy Date: Wed Jun 1 13:39:39 2016 +0200 util.sh * added helper function for perl .. so we can use that without Fmake* too * perl-* with custom build need Ffix_perl at the end of the FB diff --git a/source/include/util.sh b/source/include/util.sh index 0c90dce..04e4716 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1167,6 +1167,26 @@ Ffix_la_files() { # found, then installs the init script, too. Parameter(s) are passed to # make/python. ### +Ffix_perl() { + if [ -d $Fdestdir/usr/lib/perl5/*.*.* ]; then +Fmv '/usr/lib/perl5/*.*.*' /usr/lib/perl5/current +fi +if [ -d $Fdestdir/usr/lib/perl5 ]; then +find $Fdestdir/usr/lib/perl5 -name perllocal.pod -exec rm {} \; +find $Fdestdir/usr/lib/perl5 -name .packlist -exec rm {} \; +fi +if [ -e $Fdestdir/usr/lib/perl5/site_perl/*.*.* ]; then +Fmv '/usr/lib/perl5/site_perl/*.*.*' /usr/lib/perl5/site_perl/current +fi +if [ -d $Fdestdir/usr/lib/perl5/site_perl ]; then +find $Fdestdir/usr/lib/perl5/site_perl -name perllocal.pod -exec rm {} \; +find $Fdestdir/usr/lib/perl5/site_perl -name .packlist -exec rm {} \; +rmdir -p --ignore-fail-on-non-empty \ +$Fdestdir/usr/lib/perl5/site_perl/current/*/auto/{*,*/*} \ +&>/dev/null +fi +} + Fmakeinstall() { Fmessage "Installing to the package directory..." if Fbuildsystem_make 'probe'; then @@ -1187,23 +1207,8 @@ Fmakeinstall() { if [ -e $Fdestdir/usr/share/info/dir ]; then Frm /usr/share/info/dir fi - if [ -d $Fdestdir/usr/lib/perl5/*.*.* ]; then - Fmv '/usr/lib/perl5/*.*.*' /usr/lib/perl5/current - fi - if [ -d $Fdestdir/usr/lib/perl5 ]; then - find $Fdestdir/usr/lib/perl5 -name perllocal.pod -exec rm {} \; - find $Fdestdir/usr/lib/perl5 -name .packlist -exec rm {} \; - fi - if [ -e $Fdestdir/usr/lib/perl5/site_perl/*.*.* ]; then - Fmv '/usr/lib/perl5/site_perl/*.*.*' /usr/lib/perl5/site_perl/current - fi - if [ -d $Fdestdir/usr/lib/perl5/site_perl ]; then - find $Fdestdir/usr/lib/perl5/site_perl -name perllocal.pod -exec rm {} \; - find $Fdestdir/usr/lib/perl5/site_perl -name .packlist -exec rm {} \; - rmdir -p --ignore-fail-on-non-empty \ - $Fdestdir/usr/lib/perl5/site_perl/current/*/auto/{*,*/*} \ - &>/dev/null - fi + + Ffix_perl # 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] frugalware-current: util.sh - remove arm from Farchs
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=3c82b76aa4a837cb68ad44fdec919f03b4156a42 commit 3c82b76aa4a837cb68ad44fdec919f03b4156a42 Author: crazy Date: Mon Apr 25 02:19:35 2016 +0200 util.sh - remove arm from Farchs diff --git a/source/include/util.sh b/source/include/util.sh index ef4ee71..0c90dce 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -95,12 +95,8 @@ Flocalstatedir="/var" Finfodir="/usr/share/info" Fmandir="/usr/share/man" Fmenudir="/usr/share/applications" -Farchs=('i686' 'x86_64' 'arm') -if [[ "`arch`" == arm* ]]; then - Fbuildchost="arm-frugalware-linux-gnueabi" -else - Fbuildchost="`arch`-frugalware-linux" -fi +Farchs=('i686' 'x86_64') +Fbuildchost="`arch`-frugalware-linux" Fconfopts="" _F_make_opts="V=1" unset LANG LC_ALL ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: don't hardcode enable-silent-rules
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=046e61848c9c1acc830616a136b03f51a01c9da7 commit 046e61848c9c1acc830616a136b03f51a01c9da7 Author: Miklos Vajna Date: Fri Nov 27 13:32:45 2015 +0100 util.sh: don't hardcode enable-silent-rules autoconf has this quite useful switch called --enable-option-checking=fatal that makes the build break if some option would be ignored -- it helps to detect typos. But when using that, enable-silent-rules should be detected properly, not passed unconditionally. (With this the libreoffice build no longer aborts in configure.) diff --git a/source/include/util.sh b/source/include/util.sh index a2c691b..4a71750 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -856,7 +856,7 @@ Fbuildsystem_configure() { ## when apps using enabled silence rules on ./configure.. ## we really want to know what is going on. ## don't ask me how to do that for perl/ruby or other stuff -- crazy -- - Fconfopts+=" --disable-silent-rules" + Fconfoptstryset "enable-silent-rules" "no" Fexec $_F_conf_configure $Fconfopts "$@" return $? ;; ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh - Fbuildsystem_configure() * set --disable-silent-rules by default when using autotools. * we already set make V=1 but we need disable the silent rules on
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=e7ace3c887c29a7cf7750924730ac57980382c1f commit e7ace3c887c29a7cf7750924730ac57980382c1f Author: crazy Date: Tue Nov 24 02:08:46 2015 +0100 util.sh - Fbuildsystem_configure() * set --disable-silent-rules by default when using autotools. * we already set make V=1 but we need disable the silent rules on ./configure also diff --git a/source/include/util.sh b/source/include/util.sh index 652b0be..a2c691b 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -851,6 +851,12 @@ Fbuildsystem_configure() { Fconfoptstryset "infodir" "$Finfodir" Fconfoptstryset "mandir" "$Fmandir" Fconfoptstryset "build" "$Fbuildchost" + ## try to disable silent rules + ## we already set V=1 by default but this isn't going to work + ## when apps using enabled silence rules on ./configure.. + ## we really want to know what is going on. + ## don't ask me how to do that for perl/ruby or other stuff -- crazy -- + Fconfopts+=" --disable-silent-rules" Fexec $_F_conf_configure $Fconfopts "$@" return $? ;; ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh - added some missing local's .. more to be investigate
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=39965a9cf75fec08ff64925db8ec4e591e2e52a1 commit 39965a9cf75fec08ff64925db8ec4e591e2e52a1 Author: crazy Date: Sat Nov 21 23:03:51 2015 +0100 util.sh - added some missing local's .. more to be investigate diff --git a/source/include/util.sh b/source/include/util.sh index 23b4012..652b0be 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -177,9 +177,8 @@ Fupperstr() { # regular package. ### __Faddsubpkg() { - local key - local value - local n + local key value n i + n=${#subpkgs[@]} for i in "$@"; do key="$(echo "$i" | cut -d ':' -f 1)" @@ -227,8 +226,9 @@ __Faddsubpkg() { # 14) archs ### Faddsubpkg() { - local g - local a + + local g a + if [ "$#" -lt 3 ]; then Fmessage "Faddsubpkg requires at least 3 parameters." Fdie @@ -998,6 +998,7 @@ Fbuildsystem_java_ant () { ;; 'install') if declare -f Fjar >/dev/null; then + local i for i in ${_F_java_jars[@]} do Fjar $i || Fdie ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh - removed F_asneeded_hook , does nothing
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=0d149b5839dfa8d8e5fb0cb2ba344194c00bb17d commit 0d149b5839dfa8d8e5fb0cb2ba344194c00bb17d Author: crazy Date: Thu Oct 29 13:25:29 2015 +0100 util.sh - removed F_asneeded_hook , does nothing diff --git a/source/include/util.sh b/source/include/util.sh index 6a00637..23b4012 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1808,20 +1808,6 @@ Fextract() { fi } -_P_makepkg_prebuild_hooks+=(F_asneeded_hook) -F_asneeded_hook () { - if [ "`check_option NOASNEEDED`" ]; then - msg "Using --no-as-needed in LDFLAGS" - LDFLAGS+=" -Wl,--no-as-needed" - else - if [ "`check_option ASNEEDED`" ]; then - msg "Using --as-needed in LDFLAGS" - LDFLAGS+=" -Wl,--as-needed" - fi - fi - export LDFLAGS -} - _P_makepkg_postbuild_hooks+=(F_makepkg_postbuild_compat_hook) F_makepkg_postbuild_compat_hook () { cd $startdir ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh - set make to verbose * since a lot apps now using quiet make or some custom * build systems , we need make V=1 for Fmake/Fmakeinstall so we can see : 1) e
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=8c7c493de65beeb86fd1c011128cdec928ea7813 commit 8c7c493de65beeb86fd1c011128cdec928ea7813 Author: crazy Date: Thu Oct 29 13:11:29 2015 +0100 util.sh - set make to verbose * since a lot apps now using quiet make or some custom * build systems , we need make V=1 for Fmake/Fmakeinstall so we can see : 1) errors/warning 2) some checks like for optimization will work again diff --git a/source/include/util.sh b/source/include/util.sh index 48c1bbb..6a00637 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -55,7 +55,7 @@ # 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 +# * _F_make_opts (defaults V=1 , verbose ): extra make arguments used both with Fmake # and Fmakeinstall. ### @@ -102,7 +102,7 @@ else Fbuildchost="`arch`-frugalware-linux" fi Fconfopts="" - +_F_make_opts="V=1" unset LANG LC_ALL ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh - remove LDFAGS workaround , in makepkg.conf already
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=c56c81bd75c222057ca617d7d251bfb792b04ed8 commit c56c81bd75c222057ca617d7d251bfb792b04ed8 Author: crazy Date: Thu Oct 29 13:02:29 2015 +0100 util.sh - remove LDFAGS workaround , in makepkg.conf already diff --git a/source/include/util.sh b/source/include/util.sh index 6151732..48c1bbb 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -102,8 +102,7 @@ else Fbuildchost="`arch`-frugalware-linux" fi Fconfopts="" -## Move to makepkg.conf for Kalgan+1 -export LDFLAGS="-Wl,--hash-style=both" + unset LANG LC_ALL ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: Revert previous regex changes cause problem in chkworld, remove regexp duplication in Flastarchive.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=d9e0bc6f693298fce3e896884cbfec659700b068 commit d9e0bc6f693298fce3e896884cbfec659700b068 Author: Michel Hermier Date: Sun Jun 15 18:39:55 2014 +0200 util.sh: Revert previous regex changes cause problem in chkworld, remove regexp duplication in Flastarchive. diff --git a/source/include/util.sh b/source/include/util.sh index 351df08..fb97fae 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1417,7 +1417,7 @@ Flastarchive() { local filter lynx="lynx -dump" if [ -z "$_F_archive_nolinksonly" ]; then - lynx="$lynx -listonly" + lynx+=" -listonly" fi if [ -n "$_F_archive_grep" ]; then @@ -1429,11 +1429,13 @@ Flastarchive() { # eval "$lynx \"$1\" $filter" | Flastarchive "$2" # possible optimisation Fwcat "$1" | eval "$lynx -stdin $filter" | Flastarchive "$2" else + local _Flastarchive_regex="s:.*/$_F_archive_name$Fpkgversep\([^/]*\)\($1\)[^/]*$:\1:p" + if [ -z "$_F_archive_nosort" ]; then - sed -n "s:.*/$_F_archive_name$Fpkgversep\(.*\)\($1\).*:\1:p" \ + sed -n "$_Flastarchive_regex" \ | Fsort | tail -n1 | Fsanitizeversion else - sed -n "s:.*/$_F_archive_name$Fpkgversep\(.*\)\($1\).*:\1:p" \ + sed -n "$_Flastarchive_regex" \ | tail -n1 | Fsanitizeversion fi fi @@ -1444,7 +1446,7 @@ Flastarchive() { # Parameters: 1) url (optional) see Flastarchive ### Flastdir() { - local _Flastdir_regex='/\{0,1\}' + local _Flastdir_regex='/' if [ -z "$1" ]; then Flastarchive "$_Flastdir_regex" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: Make Flastdir also accept non '/' terminated urls (in case Fwcat use lynx instead of wget).
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=e6edce4f4927e93e37be7b02b0ced32259936535 commit e6edce4f4927e93e37be7b02b0ced32259936535 Author: Michel Hermier Date: Sat Jun 14 10:42:07 2014 +0200 util.sh: Make Flastdir also accept non '/' terminated urls (in case Fwcat use lynx instead of wget). diff --git a/source/include/util.sh b/source/include/util.sh index c842068..351df08 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1444,12 +1444,14 @@ Flastarchive() { # Parameters: 1) url (optional) see Flastarchive ### Flastdir() { + local _Flastdir_regex='/\{0,1\}' + if [ -z "$1" ]; then - Flastarchive '/' + Flastarchive "$_Flastdir_regex" else # The trailing '/' in the url is here to avoid a redirection # bug in Fwcat. - Flastarchive "$1/" '/' + Flastarchive "$1/" "$_Flastdir_regex" fi } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: fix java_ant Fbuild code. it was trying to use ruby system instead.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=50c6f91dbc2362846f757f2084e55860a7feb177 commit 50c6f91dbc2362846f757f2084e55860a7feb177 Author: James Buren Date: Tue Feb 4 21:51:19 2014 -0600 util.sh: fix java_ant Fbuild code. it was trying to use ruby system instead. diff --git a/source/include/util.sh b/source/include/util.sh index 7da4473..c842068 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1052,7 +1052,7 @@ Fmake() { elif Fbuildsystem_ruby_setup 'probe'; then Fbuildsystem_ruby_setup 'make' "$@" || Fdie elif Fbuildsystem_java_ant 'probe'; then - Fbuildsystem_ruby_setup 'make' "$@" || Fdie + Fbuildsystem_java_ant 'make' "$@" || Fdie else Fmessage "No Makefile or setup.py found!" Fdie @@ -1091,7 +1091,7 @@ Fmakeinstall() { elif Fbuildsystem_ruby_setup 'probe'; then Fbuildsystem_ruby_setup 'install' "$@" || Fdie elif Fbuildsystem_java_ant 'probe'; then - Fbuildsystem_ruby_setup 'install' "$@" || Fdie + Fbuildsystem_java_ant 'install' "$@" || Fdie else Fmessage "No Makefile or setup.py found!" Fdie ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: Make __Fsed return an error instead of killing the build when file is absent.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ac60cedabffa28146ee1b72527ebfa23cdf75f01 commit ac60cedabffa28146ee1b72527ebfa23cdf75f01 Author: Michel Hermier Date: Mon Jan 20 10:47:55 2014 +0100 util.sh: Make __Fsed return an error instead of killing the build when file is absent. diff --git a/source/include/util.sh b/source/include/util.sh index 96519d9..7da4473 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -639,11 +639,11 @@ Fln() { __Fsed() { if [ ! -e "$3" ]; then error "File $3 not found." - Fdie + return 1 fi if [ ! -f "$3" ]; then error "File $3 is not a regular file." - Fdie + return 1 fi sed -i -e "s|$1|$2|g" "$3" || Fdie } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=6b764e1d4e98ec2424a4b84130c3b59421b5cdb4 commit 6b764e1d4e98ec2424a4b84130c3b59421b5cdb4 Author: Michel Hermier Date: Fri Feb 22 12:36:17 2013 +0100 util.sh * Import asneeded option handling to a _P_makepkg_prebuild_hook (see 1d372ab1a0da9215937fc6c6e1d1cfe35a2a1312 in makepkg) diff --git a/source/include/util.sh b/source/include/util.sh index 0ced55f..69318a4 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1801,6 +1801,20 @@ Fextract() { fi } +_P_makepkg_prebuild_hooks+=(F_asneeded_hook) +F_asneeded_hook () { + if [ "`check_option NOASNEEDED`" ]; then + msg "Using --no-as-needed in LDFLAGS" + LDFLAGS+=" -Wl,--no-as-needed" + else + if [ "`check_option ASNEEDED`" ]; then + msg "Using --as-needed in LDFLAGS" + LDFLAGS+=" -Wl,--as-needed" + fi + fi + export LDFLAGS +} + _P_makepkg_postbuild_hooks+=(F_makepkg_postbuild_compat_hook) F_makepkg_postbuild_compat_hook () { cd $startdir ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=358fb7da547f471822ce95eac0bafddc7f9d986b commit 358fb7da547f471822ce95eac0bafddc7f9d986b Author: Michel Hermier Date: Fri Feb 22 12:09:13 2013 +0100 util.sh * Import some fixes from pacman-g2/script/makepkg (see commit 6c90c804fce51770567e5e1f364368d9c59b92a5) diff --git a/source/include/util.sh b/source/include/util.sh index df8026c..0ced55f 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1800,3 +1800,143 @@ Fextract() { fi fi } + +_P_makepkg_postbuild_hooks+=(F_makepkg_postbuild_compat_hook) +F_makepkg_postbuild_compat_hook () { +cd $startdir +# unwanted files +msg "Removing unwanted files..." +extra= +ls pkg.* &>/dev/null && extra=pkg.*/usr/lib/perl? +for f in `find pkg/usr/lib/perl? $extra -type f 2> /dev/null` ; do + case "$f" in + */.packlist|*/perllocal.pod) + rm -f "$f" + rmdir -p --ignore-fail-on-non-empty `dirname $f` 2> /dev/null + ;; + esac +done +extra= +ls pkg.* &>/dev/null && extra=pkg.* +rm -f {pkg,pkg.*}/{usr{,/local,/share},opt/*}/info/dir 2> /dev/null +for f in `find pkg $extra -type f -name encodings.dir -o -type f -name fonts.dir -o -type f -name fonts.scale` ; do + msg2 "`$ECHO $f | sed 's|pkg[^/]\+||'`" + rm -f "$f" +done + +# documentation +msg "Preparing package documentation..." +if [ ! "`check_option NODOCS`" -a "$NODOCS" = "0" ]; then + mkdir -p pkg/usr/share/doc/$pkgname-$pkgver + find src -maxdepth 2 -size +0b \( \ + -name ANNOUNCE \ + -or -name AUTHORS \ + -or -name '*BUGS*' \ + -or -name CHANGES \ + -or -name CONFIGURATION \ + -or -name '*COPYING*' \ + -or -name '*COPYRIGHT*' \ + -or -name CREDITS \ + -or -name ChangeLog \ + -or -name Changelog \ + -or -name CHANGELOG \ + -or -name CONTRIBUTORS \ + -or -name '*FAQ*' \ + -or -name FEATURES \ + -or -name FILES \ + -or -name HACKING \ + -or -name History \ + -or -name HISTORY \ + -or -name 'INSTALL*' \ + -or -name LICENSE \ + -or -name LSM \ + -or -name MANIFEST \ + -or -name NEWS \ + -or -name '*README*' \ + -or -name '*Readme*' \ + -or -name SITES \ + -or -name '*RELEASE*' \ + -or -name RELNOTES \ + -or -name THANKS \ + -or -name TIPS \ + -or -name TODO \ + -or -name VERSION \ + -or -name 'CONFIGURATION*' \ + -or -name GPLLicense \ + \) -exec install -pm 644 '{}' pkg/usr/share/doc/$pkgname-$pkgver/ \; +fi +for d in $startdir/{pkg,pkg.*} +do + [ ! -d $d ] && continue + if [ -d $d/usr/doc ]; then + if [ ! "`check_option NODOCS`" -a "$NODOCS" = "0" ]; then + mkdir -p $d/usr/share/doc/$pkgname-$pkgver + cp -a $d/usr/doc/* $d/usr/share/doc/$pkgname-$pkgver + fi + rm -rf $d/usr/doc + fi + + # remove /usr/share/doc/$pkgname-$pkgver directory if empty + if [ -d $d/usr/share/doc/$pkgname-$pkgver ]; then + rmdir -p --ignore-fail-on-non-empty $d/usr/share/doc/$pkgname-$pkgver 2> /dev/null + mkdir -p pkg + fi + + # move /usr/info files to /usr/share/info + if [ -d $d/usr/info ]; then + mkdir -p $d/usr/share/info + cp -a $d/usr/info/* $d/usr/share/info/ + rm -rf $d/usr/info + fi + + # move /usr/man files to /usr/share/man + if [ -d $d/usr/man ]; then + mkdir -p $d/usr/share/man + cp -a $d/usr/man/* $d/usr/share/man/ + rm -rf $d/usr/man + fi + + if [ -d "$d/usr/share/icons/hicolor" ]; then + if [ -z "$_F_gnome_iconcache" ]; then + warning "Package $pkgname contains hicolor icons but _F_gnome_iconcache is not set" + fi + fi +done + +# compress info and manual pages +msg "Compressing info and manual pages..." +find $startdir/{pkg,pkg.*}/{usr{,/local,/share},opt/*}/{info,man} -type f 2>/dev/null | while read i ; do + ext="${i##*.}" + fn="${i##*/}" + if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then + # update symlinks to this manpage + find $startdir/{pkg,pkg.*}/{usr{,/local,/share},opt/*}/man -lname "$fn" 2> /dev/null | while read ln ; do + rm -f "$ln" + ln -sf "${fn}.gz" "${ln}.gz" + done + # compress the original + gzip -9 "$i" + fi +done + +# check symbolic links
[Frugalware-git] frugalware-current: util.sh / Frcd: drop support for old-style localized strings
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: 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=frugalware-current.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] frugalware-current: util.sh: modify Freplace to work with variable arrays
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: util.sh: modify Freplace to work with variable arrays
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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 "$Fpref
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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_o
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=b9045e4110f4cc6db16b0748f6e46d9ab6a10196 commit b9045e4110f4cc6db16b0748f6e46d9ab6a10196 Author: Michel Hermier Date: Mon Apr 9 09:02:03 2012 +0200 util.sh * Introduce Fsanitizename. It will produce a pkgname compatible name from a real package name (lower case, replace white space with _). diff --git a/source/include/util.sh b/source/include/util.sh index fa592ba..fa9e790 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1175,9 +1175,22 @@ Fautogen() { } ### +# * Fsanitizename: Clear/fix some common package name string common problems on +# an automated package name retrival/usage (remove duplicate name assignation in +# scripts). Parameters: 1) name (optional) to clean, else stdin if not present. +### +Fsanitizename() { + if [ $# -gt 0 ]; then + echo "$1" | Fsanitizename + else + sed "s/\(.*\)/\L\1/g;s/ /_/g" + fi +} + +### # * Fsanitizeversion: Clear/fix some common version string common problems on -# an automatized version output (also remove pkgextraver ending). Parameters: -# 1) version (optional) to clean, else stdin if not present +# an automated version output (also remove pkgextraver ending). Parameters: +# 1) version (optional) to clean, else stdin if not present. ### Fsanitizeversion() { if [ $# -gt 0 ]; then ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=938bac75662558e54c475b2f197494a1c5a6b296 commit 938bac75662558e54c475b2f197494a1c5a6b296 Author: Michel Hermier Date: Sat Mar 24 14:42:53 2012 +0100 util.sh * Replace @DESTDIR@ with @FDESTDIR@ to avoid potential problems with autotools substitutions (if any). diff --git a/source/include/util.sh b/source/include/util.sh index e5b84eb..fa592ba 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -890,8 +890,8 @@ Fnant() { Fmakeinstall() { Fmessage "Installing to the package directory..." if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then - if make -p -q DESTDIR="@DESTDIR@" "$@" install 2>/dev/null | grep -v 'DESTDIR\s*=' | \ - grep -q "@DESTDIR@\\|\$DESTDIR\\|\$(DESTDIR)\\|\${DESTDIR}" 2>/dev/null; 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 _F_make_opts="$_F_make_opts DESTDIR=$Fdestdir" else _F_make_opts="$_F_make_opts prefix=$Fdestdir/$Fprefix" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=15d945416d289c4aae9686010103e7e03ff8e08c commit 15d945416d289c4aae9686010103e7e03ff8e08c Author: Michel Hermier Date: Sat Mar 24 14:35:51 2012 +0100 util.sh * Use @DESTDIR@ in Fmakeinstall instead of $Fdestdir as test target. Use this fake target to avoid some false positives if Fmakeinstall use $Fdestdir. diff --git a/source/include/util.sh b/source/include/util.sh index 4efdbb6..e5b84eb 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -890,8 +890,8 @@ Fnant() { Fmakeinstall() { Fmessage "Installing to the package directory..." 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 + if make -p -q DESTDIR="@DESTDIR@" "$@" install 2>/dev/null | grep -v 'DESTDIR\s*=' | \ + grep -q "@DESTDIR@\\|\$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" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: Flastarchive filters.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=f25daa5ff78dee8871fa233bf72e8c0e490c1065 commit f25daa5ff78dee8871fa233bf72e8c0e490c1065 Author: Michel Hermier Date: Wed Feb 29 18:59:39 2012 +0100 util.sh: Flastarchive filters. * Create some common filters arguments for lastarchive so that Fincluded scripts can use them to do some compositions with them (will be used soon) diff --git a/source/include/util.sh b/source/include/util.sh index 303a739..6c7f969 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1201,6 +1201,9 @@ Fwcat() { lynx -source "$1" 2>/dev/null && return } +Flasttar_filter='\.tar\(\.gz\|\.bz2\)\?\|\.tgz' +Flastzip_filter='\.zip' + ### # * Flastarchive: Extracts last archive version from a page. Parameters: 1) # url (optional) of the page, else stdin if not present 2) extension_filter @@ -1270,7 +1273,7 @@ Flastverdir() { # ball extension. Parameters: 1) url (optional) see Flastarchive ### Flasttar() { - Flastarchive "$1" '\.tar\(\.gz\|\.bz2\)\?\|\.tgz' + Flastarchive "$1" "$Flasttar_filter" } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: Fautogen
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ec8706c17300ea02f22e83aa87ad270a5c8994ba commit ec8706c17300ea02f22e83aa87ad270a5c8994ba Author: Michel Hermier Date: Wed Feb 29 18:50:22 2012 +0100 util.sh: Fautogen * Introduce Fautogen that attempts to call autogen scripts or our internal autotools generation sequence. * Modify Fconf so it call Fautogen when _F_conf_configure is missing. (bug me if it introduce some errors for you) diff --git a/source/include/util.sh b/source/include/util.sh index 50acf44..303a739 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -807,7 +807,11 @@ Fconf() { fi fi - if [ -x $_F_conf_configure ]; then + if [ ! -e "$_F_conf_configure" ]; then + Fautogen + fi + + if [ -x "$_F_conf_configure" ]; then Fconfoptstryset "prefix" "$Fprefix" Fconfoptstryset "sysconfdir" "$Fsysconfdir" Fconfoptstryset "localstatedir" "$Flocalstatedir" @@ -1151,6 +1155,26 @@ Fautoreconf() { } ### +# * Fautogen(): Try to run autogen scripts else run Fautoconfize if not found. +### +Fautogen() { + local autogen old_pwd="$(pwd)" + + cd "$(dirname "$_F_conf_configure")" || return + if [ -f "./configure.ac" -o -f "./configure.in" ]; then + for autogen in './autogen.sh'; do + if [ -f "$autogen" ]; then + Fexec "$autogen" + cd "$old_pwd" + return + fi + done + Fautoconfize + fi + cd "$old_pwd" +} + +### # * Fsanitizeversion: Clear/fix some common version string common problems on # an automatized version output (also remove pkgextraver ending). Parameters: # 1) version (optional) to clean, else stdin if not present ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: util.sh: Introduce _F_make_opts.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: util.sh: Introduce Flowerstr and Fupperstr.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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 ${optio...@]}; 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 "${optio...@]}"; 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] frugalware-current: util.sh: Introduce _F_archive_ver.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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] frugalware-current: util.sh: Add Fcpvar and make Fuse accept use variable name.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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=(\"\${...@]}\")" +} + +### +# * 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] frugalware-current: util.sh: Move Fuse to the top with other low level functions.
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.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
[Frugalware-git] frugalware-current: util.sh: Move Ftreecmp and Fcleandestdir back to util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=8e5bde2b57798cfc2720e04b68eadbfac523f6e7 commit 8e5bde2b57798cfc2720e04b68eadbfac523f6e7 Author: Michel Hermier Date: Wed Dec 29 23:02:03 2010 +0100 util.sh: Move Ftreecmp and Fcleandestdir back to util.sh * We have 2 users for this function qt4 package and kde.sh. So vmiklos was confused and said me to move it to kde.sh wrongly in the past ;) diff --git a/source/include/kde.sh b/source/include/kde.sh index 75d14de..ffcdcbb 100644 --- a/source/include/kde.sh +++ b/source/include/kde.sh @@ -158,60 +158,6 @@ _F_cmake_confopts="$_F_cmake_confopts \ -DICON_INSTALL_DIR=/usr/share/kde/icons \ -DKDE_DISTRIBUTION_TEXT='Frugalware Linux'" - -### -# == PROVIDED FUNCTIONS -# * Ftreecmp(): Compare 2 tree and do an action on a compare result. Parameters: -# 1) Fist tree 2) Second tree 3) Action to perform on compared item. The item -# is an inode item (relative to both tree) prefixed with '-', '=' or '+' -# depending if it deleted, still present or added in the comparison from the -# first tree to the second tree. -### -Ftreecmp() { - local line old=$(mktemp) new=$(mktemp) - if [ ! -d "$1" -o ! -d "$2" ]; then - Fmessage "$1 or $2 is not a directory" - Fdie - fi - if [ -z "$3" ]; then - Fmessage "Comparison function is empty" - Fdie - fi - (cd "$1" && find $_F_treecmp_findopts | sort) > $old - (cd "$2" && find $_F_treecmp_findopts | sort) > $new - diff --new-line-format='+%L' --old-line-format='-%L' \ - --unchanged-line-format='=%L' $old $new \ - | while read line - do - "$3" "$line" "$1" "$2" - done - rm $old $new -} - -### -# * __Ftreecmp_cleandestdir: Internal -### -__Ftreecmp_cleandestdir() { - case "$1" in - =*) Frm "${1//=/}" ;; - esac -} - -### -# * Fcleandestdir(): Clean the $Fdestdir from subpackages files, to make -# them conflict less. Parameters: The subpackages to use. -### -Fcleandestdir() { - local i subdestdir - for i in "$@" - do - Fmessage "Removing conflicting files with $i subpackage." - subdestdir="`Fsubdestdir "$i"`" - _F_treecmp_findopts='! -type d' \ - Ftreecmp "$Fdestdir" "$subdestdir" __Ftreecmp_cleandestdir - done -} - # stolen from makepkg ;)) __kde_in_array() { @@ -241,6 +187,7 @@ __KDE_pre_build_check() } ### +# == PROVIDED FUNCTIONS # * KDE_project_install: Install a specific package. Parameters: 1) Name of the # project (Must also be the name of a directory). ### diff --git a/source/include/util.sh b/source/include/util.sh index c2a841e..c2beb71 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1312,6 +1312,58 @@ Fwrapper() } ### +# * Ftreecmp(): Compare 2 tree and do an action on a compare result. Parameters: +# 1) Fist tree 2) Second tree 3) Action to perform on compared item. The item +# is an inode item (relative to both tree) prefixed with '-', '=' or '+' +# depending if it deleted, still present or added in the comparison from the +# first tree to the second tree. +### +Ftreecmp() { + local line old=$(mktemp) new=$(mktemp) + if [ ! -d "$1" -o ! -d "$2" ]; then + Fmessage "$1 or $2 is not a directory" + Fdie + fi + if [ -z "$3" ]; then + Fmessage "Comparison function is empty" + Fdie + fi + (cd "$1" && find $_F_treecmp_findopts | sort) > $old + (cd "$2" && find $_F_treecmp_findopts | sort) > $new + diff --new-line-format='+%L' --old-line-format='-%L' \ + --unchanged-line-format='=%L' $old $new \ + | while read line + do + "$3" "$line" "$1" "$2" + done + rm $old $new +} + +### +# * __Ftreecmp_cleandestdir: Internal +### +__Ftreecmp_cleandestdir() { + case "$1" in + =*) Frm "${1//=/}" ;; + esac +} + +### +# * Fcleandestdir(): Clean the $Fdestdir from subpackages files, to make +# them conflict less. Parameters: The subpackages to use. +### +Fcleandestdir() { + local i subdestdir + for i in "$@" + do + Fmessage "Removing conflicting files with $i subpackage." + subdestdir="`Fsubdestdir "$i"`" + _F_treecmp_findopts='! -type d' \ + Ftreecmp "$Fdestdir" "$subdestdir" __Ftreecmp_cleandestdir + done +} + +### # * Fsplit(): Moves a file pattern to a subpackage. Parameters: 1) name of the # subpackage 2) pattern of the files to move. Example: Fsplit libmysql /usr/lib. # ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh * fix variable usage in Faddsubpkg * change delimiter in __Faddsubpkg from '=' to ':'
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ca34b34dd081ec7ff2e804a930def114f04ab71b commit ca34b34dd081ec7ff2e804a930def114f04ab71b Author: James Buren Date: Tue Dec 21 15:36:39 2010 -0600 util.sh * fix variable usage in Faddsubpkg * change delimiter in __Faddsubpkg from '=' to ':' diff --git a/source/include/util.sh b/source/include/util.sh index 9b4ee31..c2a841e 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -120,7 +120,7 @@ Fdie() { ### # * __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 +# "key:value". The key is what the variable would be called if it were a # regular package. ### __Faddsubpkg() { @@ -129,8 +129,8 @@ __Faddsubpkg() { local n n=${#subpk...@]} for i in "$@"; do - key="$(echo "$i" | cut -d '=' -f 1)" - value="$(echo "$i" | cut -d '=' -f 2)" + key="$(echo "$i" | cut -d ':' -f 1)" + value="$(echo "$i" | cut -d ':' -f 2)" [ -z "$key" ] && continue case "$key" in pkgname) subpkgs[$n]="$value";; @@ -180,20 +180,20 @@ Faddsubpkg() { Fmessage "Faddsubpkg requires at least 3 parameters." Fdie fi - if [ -n "$13" ]; then - g="$13" + if [ -n "${13}" ]; then + g="${13}" else g="${grou...@]}" fi - if [ -n "$14" ]; then - a="$14" + if [ -n "${14}" ]; then + a="${14}" else a="${arc...@]}" fi - __Faddsubpkg "pkgname=$1" "pkgdesc=$2" "depends=$3" "rodepends=$4" \ -"replaces=$5" "removes=$6" "conflicts=$7" "provides=$8" \ -"license=$9" "backup=$10" "install=$11" "options=$12" \ -"groups=$g" "archs=$a" + __Faddsubpkg "pkgname:${1}" "pkgdesc:${2}" "depends:${3}" "rodepends:${4}" \ +"replaces:${5}" "removes:${6}" "conflicts:${7}" "provides:${8}" \ +"license:${9}" "backup:${10}" "install:${11}" "options:${12}" \ +"groups:${g}" "archs:${a}" } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh * convert Fregistersubpkg to internal function * Faddsubpkg now accepts parameters for all subpkg options but * pkgdesc_localized
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=9ebf0cf5c7265a71b99ab72283a6c29f6e5fdad1 commit 9ebf0cf5c7265a71b99ab72283a6c29f6e5fdad1 Author: James Buren Date: Tue Dec 21 13:38:49 2010 -0600 util.sh * convert Fregistersubpkg to internal function * Faddsubpkg now accepts parameters for all subpkg options but * pkgdesc_localized diff --git a/source/include/util.sh b/source/include/util.sh index 4acc9cd..9b4ee31 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -118,11 +118,12 @@ Fdie() { } ### -# * Fregistersubpkg(): 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 regular package. +# * __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 +# regular package. ### -Fregistersubpkg() { +__Faddsubpkg() { local key local value local n @@ -152,40 +153,47 @@ Fregistersubpkg() { } ### -# * Faddsubpkg(): Simple to use frontend for Fregistersubpkg, but limited. -# Takes up to 6 parameters, which are: -# 1) pkgname (required) -# 2) pkgdesc (required) -# 3) depends (required) -# 4) rodepends (optional) -# 5) groups(optional) -# 6) archs (optional) +# * Faddsubpkg(): Adds one subpkg to the list. Appended parameters are the +# corresponding values. Up to 14 parameters are used to define each entry. You +# must pass all previous parameters if you are to access the later ones. If you +# do not need parameter, simply pass an empty string, or leave it out if you do +# not need the later parameters. The order is as follows: +# 1) pkgname (required) +# 2) pkgdesc (required) +# 3) depends (required) +# 4) rodepends +# 5) replaces +# 6) removes +# 7) conflicts +# 8) provides +# 9) license +# 10) backup +# 11) install +# 12) options +# 13) groups +# 14) archs ### Faddsubpkg() { + local g local a - local b - local c if [ "$#" -lt 3 ]; then Fmessage "Faddsubpkg requires at least 3 parameters." Fdie fi - if [ -n "$4" ]; then - a="$4" + if [ -n "$13" ]; then + g="$13" else - a='' + g="${grou...@]}" fi - if [ -n "$5" ]; then - b="$5" + if [ -n "$14" ]; then + a="$14" else - b="${grou...@]}" + a="${arc...@]}" fi - if [ -n "$6" ]; then - c="$6" - else - c="${arc...@]}" - fi - Fregistersubpkg "pkgname=$1" "pkgdesc=$2" "depends=$3" \ - "rodepends=$a" "groups=$b" "archs=$c" + __Faddsubpkg "pkgname=$1" "pkgdesc=$2" "depends=$3" "rodepends=$4" \ +"replaces=$5" "removes=$6" "conflicts=$7" "provides=$8" \ +"license=$9" "backup=$10" "install=$11" "options=$12" \ +"groups=$g" "archs=$a" } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh * add Fregistersubpkg * add Faddsubpkg * (new functions for assisting with PITA subpkg management)
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=c103543b0fa116c2b0d093971c8ce38caeb0510c commit c103543b0fa116c2b0d093971c8ce38caeb0510c Author: James Buren Date: Tue Dec 21 12:46:46 2010 -0600 util.sh * add Fregistersubpkg * add Faddsubpkg * (new functions for assisting with PITA subpkg management) diff --git a/source/include/util.sh b/source/include/util.sh index b9ffaab..4acc9cd 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -118,6 +118,77 @@ Fdie() { } ### +# * Fregistersubpkg(): 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 regular package. +### +Fregistersubpkg() { + local key + local value + local n + n=${#subpk...@]} + for i in "$@"; do + key="$(echo "$i" | cut -d '=' -f 1)" + value="$(echo "$i" | cut -d '=' -f 2)" + [ -z "$key" ] && continue + case "$key" in + pkgname) subpkgs[$n]="$value";; + pkgdesc) subdescs[$n]="$value" ;; + pkgdesc_localized) subdescs_localized[$n]="$value" ;; + license) sublicense[$n]="$value" ;; + replaces) subreplaces[$n]="$value";; + groups)subgroups[$n]="$value" ;; + depends) subdepends[$n]="$value" ;; + rodepends) subrodepends[$n]="$value" ;; + removes) subremoves[$n]="$value" ;; + conflicts) subconflicts[$n]="$value" ;; + provides) subprovides[$n]="$value";; + backup)subbackup[$n]="$value" ;; + install) subinstall[$n]="$value" ;; + options) suboptions[$n]="$value" ;; + archs) subarchs[$n]="$value" ;; + esac + done +} + +### +# * Faddsubpkg(): Simple to use frontend for Fregistersubpkg, but limited. +# Takes up to 6 parameters, which are: +# 1) pkgname (required) +# 2) pkgdesc (required) +# 3) depends (required) +# 4) rodepends (optional) +# 5) groups(optional) +# 6) archs (optional) +### +Faddsubpkg() { + local a + local b + local c + if [ "$#" -lt 3 ]; then + Fmessage "Faddsubpkg requires at least 3 parameters." + Fdie + fi + if [ -n "$4" ]; then + a="$4" + else + a='' + fi + if [ -n "$5" ]; then + b="$5" + else + b="${grou...@]}" + fi + if [ -n "$6" ]; then + c="$6" + else + c="${arc...@]}" + fi + Fregistersubpkg "pkgname=$1" "pkgdesc=$2" "depends=$3" \ + "rodepends=$a" "groups=$b" "archs=$c" +} + +### # * Fexec(): Display and execute the command line passed as parameter. Note that #Â it cannot be used in a pipe context. Parameters: the command line to execute. ### @@ -497,7 +568,7 @@ Fln() { } ### -# * __Fsed(): Private implementation of Fsed and Freplace. Parameters: +# * __Fsed(): Private implementation of Fsed and Freplace. Parameters: # 1) regexp (see man sed!) 2) replacement 3) file to edit in place. ### __Fsed() { @@ -528,7 +599,7 @@ Fsed() { } ### -# * Freplace(): Do some parameter substitution on file(s). The parameters +# * Freplace(): Do some parameter substitution on file(s). The parameters # should be escaped using the "@parameter@" syntax. Parameters: # 1) Variable to substituate 2) file(s) where the substitution happens. ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=b2ebc15c29907a7c65f37bfceb8c54b7a5b04029 commit b2ebc15c29907a7c65f37bfceb8c54b7a5b04029 Author: Michel Hermier Date: Fri Dec 3 00:30:00 2010 +0100 util.sh * autotools provide a docdir rule for documentation. Use it when available. diff --git a/source/include/util.sh b/source/include/util.sh index d8f97f5..b9ffaab 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -675,6 +675,7 @@ Fconf() { Fconfoptstryset "prefix" "$Fprefix" Fconfoptstryset "sysconfdir" "$Fsysconfdir" Fconfoptstryset "localstatedir" "$Flocalstatedir" + Fconfoptstryset "docdir" "/usr/share/doc/$pkgname-$pkgver" 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] frugalware-current: util.sh: add and document _F_conf_notry
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=34d67f2899495f832ce0b74b0ed060e9f6bdbc0d commit 34d67f2899495f832ce0b74b0ed060e9f6bdbc0d Author: Miklos Vajna Date: Sun Nov 21 18:28:05 2010 +0100 util.sh: add and document _F_conf_notry diff --git a/source/include/util.sh b/source/include/util.sh index 4852005..d0a2121 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -52,6 +52,8 @@ # * _F_desktop_mime (no default, optional): Mimetypes # * _F_desktop_show_in: Whether the icon should be showed in only a particular # 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. ### # Copyright (C) 2005-2006 Bence Nagy @@ -638,12 +640,14 @@ Fconfoptstryset() { return 1 fi - # check if it was not allready set in $Fconfopts + # check if it was not already set in $Fconfopts if echo "$Fconfopts" | grep -q -- "--$1=" - ; then return 2 fi - Fconfopts="$Fconfopts --$1=$2" + if ! echo $1 |grep -q $_F_conf_notry; then + Fconfopts="$Fconfopts --$1=$2" + fi return 0 } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=e64909c703d5e504371587325d428f240daf768f commit e64909c703d5e504371587325d428f240daf768f Author: Michel Hermier Date: Thu Jul 22 11:24:44 2010 +0200 util.sh * Cosmetic change, reorder tar archives alphabetically. diff --git a/source/include/util.sh b/source/include/util.sh index 84e8bf4..e47d514 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1326,10 +1326,10 @@ Fextract() { file="${1}" tmp="$(echo "${file}" | tr 'A-Z' 'a-z')" case "${tmp}" in - *.tar.gz|*.tar.z|*.tgz) - cmd="tar $_F_extract_taropts --use-compress-program=gzip -xf $file" ;; *.tar.bz2|*.tbz2) cmd="tar $_F_extract_taropts --use-compress-program=bzip2 -xf $file" ;; + *.tar.gz|*.tar.z|*.tgz) + cmd="tar $_F_extract_taropts --use-compress-program=gzip -xf $file" ;; *.tar.lzma) cmd="tar $_F_extract_taropts --use-compress-program=lzma -xf $file" ;; *.tar.xz) ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=586aca201fdf6df61270d0d257d113f2bd053b71 commit 586aca201fdf6df61270d0d257d113f2bd053b71 Author: Michel Hermier Date: Tue Jul 20 18:50:25 2010 +0200 util.sh * Dumping the make database with the same install argument might help to detect DESTDIR usage. diff --git a/source/include/util.sh b/source/include/util.sh index 4eebcf8..84e8bf4 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -744,7 +744,7 @@ Fnant() { Fmakeinstall() { Fmessage "Installing to the package directory..." if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then - if make -p -q DESTDIR="$Fdestdir" 2>/dev/null | grep -v 'DESTDIR\s*=' | \ + 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 else ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=9205356085113dc56ed4cdc645ccc967cad745ff commit 9205356085113dc56ed4cdc645ccc967cad745ff Author: Michel Hermier Date: Mon Jul 19 07:25:37 2010 +0200 util.sh * Yet another fix to Fmakeinstall. I forgot that specifying "DESTDIR=foo" will populate the make rule database. Lets grep -v the database output to remove DESTDIR assignations rules and add search for DESTDIR usage in rules. diff --git a/source/include/util.sh b/source/include/util.sh index bb866b5..4eebcf8 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -744,7 +744,8 @@ Fnant() { Fmakeinstall() { Fmessage "Installing to the package directory..." if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then - if make -p -q DESTDIR="$Fdestdir" 2>/dev/null | grep -q "$Fdestdir" 2>/dev/null; then + if make -p -q DESTDIR="$Fdestdir" 2>/dev/null | grep -v 'DESTDIR\s*=' | \ + grep -q "$Fdestdir\\|\$DESTDIR\\|\$(DESTDIR)\\|\${DESTDIR}" 2>/dev/null; then Fexec make DESTDIR="$Fdestdir" "$@" install || Fdie else Fexec make prefix="$Fdestdir"/"$Fprefix" "$@" install || Fdie ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=767158685735d1ab7279f1bcb30988d61cd8bed0 commit 767158685735d1ab7279f1bcb30988d61cd8bed0 Author: Michel Hermier Date: Sun Jul 18 12:08:56 2010 +0200 util.sh * Fix Fmakeinstall with DESTDIR common rule. Specifying DESTDIR=$Fdestdir will make $Fdestdir visible when dumping the database, and since $Fdestdir is very likely to be unique, we can simply grep for it. diff --git a/source/include/util.sh b/source/include/util.sh index 0bc6ee7..bb866b5 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -744,7 +744,7 @@ Fnant() { Fmakeinstall() { Fmessage "Installing to the package directory..." if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then - if make -p -q 2>/dev/null | grep -q '$\((\|{\)DESTDIR\()\|}\)' 2>/dev/null; then + if make -p -q DESTDIR="$Fdestdir" 2>/dev/null | grep -q "$Fdestdir" 2>/dev/null; then Fexec make DESTDIR="$Fdestdir" "$@" install || Fdie else Fexec make prefix="$Fdestdir"/"$Fprefix" "$@" install || Fdie ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=0224af3a4aaf255a8bbc87dc4cf46a32d38227e5 commit 0224af3a4aaf255a8bbc87dc4cf46a32d38227e5 Author: Michel Hermier Date: Thu Jul 8 08:52:28 2010 +0200 util.sh * Flastarchive change '|' to ':' subtitution character. Using '|' was a bad idea since it conflicts with the alternate matching operator. AFAIK ':' is not used as a matching operator and is very unlikely to happen as a path character, so it might be the saffiest in the end. diff --git a/source/include/util.sh b/source/include/util.sh index 6c1c62d..48dfc8c 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1062,10 +1062,10 @@ Flastarchive() { Fwcat "$1" | eval "$lynx -stdin $filter" | Flastarchive "$2" else if [ -z "$_F_archive_nosort" ]; then - sed -n "s|.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*|\1|p" \ + sed -n "s:.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*:\1:p" \ | Fsort | tail -n1 | Fsanitizeversion else - sed -n "s|.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*|\1|p" \ + sed -n "s:.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*:\1:p" \ | tail -n1 | Fsanitizeversion fi fi ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=c5b576400adb3fd90fe13e45b404740acf1cd44d commit c5b576400adb3fd90fe13e45b404740acf1cd44d Author: Michel Hermier Date: Wed Jul 7 14:59:24 2010 +0200 util.sh * Flastarchive use '|' instead of '/' for sed commands, might simplify some situations. diff --git a/source/include/util.sh b/source/include/util.sh index 68ed1f1..6c1c62d 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1062,10 +1062,10 @@ Flastarchive() { Fwcat "$1" | eval "$lynx -stdin $filter" | Flastarchive "$2" else if [ -z "$_F_archive_nosort" ]; then - sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" \ + sed -n "s|.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*|\1|p" \ | Fsort | tail -n1 | Fsanitizeversion else - sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" \ + sed -n "s|.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*|\1|p" \ | tail -n1 | Fsanitizeversion fi fi ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=a317678e84b75cb744ff5ad3bd7b21b8346fb03e commit a317678e84b75cb744ff5ad3bd7b21b8346fb03e Author: Michel Hermier Date: Wed Jul 7 14:56:41 2010 +0200 util.sh * Fmakeinstall: detect the DESTDIR variable presence in Makefiles by dumping the makedatabase. Should be a quite more slower, but much more reliable. diff --git a/source/include/util.sh b/source/include/util.sh index e2f0ca8..68ed1f1 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -744,7 +744,7 @@ Fnant() { Fmakeinstall() { Fmessage "Installing to the package directory..." if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then - if grep -q DESTDIR GNUmakefile makefile Makefile 2>/dev/null; then + if make -p -q 2>/dev/null | grep -q '$(DESTDIR)' 2>/dev/null; then Fexec make DESTDIR="$Fdestdir" "$@" install || Fdie else Fexec make prefix="$Fdestdir"/"$Fprefix" "$@" install || Fdie ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: return the exit code in Fexec
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=690fdd175efdff9ae5514a4e3bb4ddd74beb8749 commit 690fdd175efdff9ae5514a4e3bb4ddd74beb8749 Author: Miklos Vajna Date: Mon Jun 14 00:31:23 2010 +0200 util.sh: return the exit code in Fexec - to not break existing users, do not die on non-zero exit code, just return it - new users can still die on that non-zero return value diff --git a/source/include/util.sh b/source/include/util.sh index 15b462e..e828c1c 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -122,6 +122,7 @@ Fdie() { Fexec() { Fmessage "$*" "$@" + return $? } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: restore old default in __Fpatch
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=b031dffa63dfe01036deffcc5dce7500f8fd080c commit b031dffa63dfe01036deffcc5dce7500f8fd080c Author: Miklos Vajna Date: Sat May 29 15:12:30 2010 +0200 util.sh: restore old default in __Fpatch it was -p1 then commit bf2be8e8862dde0d92d2fce8b65dfc5bc1f8a252 unintentionally changed it to 0, now fix this bug. diff --git a/source/include/util.sh b/source/include/util.sh index c46a921..91fa692 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -604,20 +604,20 @@ Fcleandestdir() { } ### -# * __Fpatch(): Internal. Apply a patch with -p0 (or -p1 if -p0 fails). +# * __Fpatch(): Internal. Apply a patch with -p1 (or -p0 if -p1 fails). # Parameter: Patch to apply. ### __Fpatch() { - local level="0" - if ! patch -Np0 --dry-run -i "$Fsrcdir/$1" >/dev/null; then - if ! patch -Np1 --dry-run -i "$Fsrcdir/$1"; then + local level="1" + if ! patch -Np1 --dry-run -i "$Fsrcdir/$1" >/dev/null; then + if ! patch -Np0 --dry-run -i "$Fsrcdir/$1"; then return 1 fi - level="1" + level="0" fi - # if we are here, the patch applied with -p1, so it's no good + # if we are here, the patch applied with -p0, so it's no good # showing the output again - if [ "$level" = 1 ]; then + if [ "$level" = 0 ]; then patch -Np$level --no-backup-if-mismatch -i "$Fsrcdir/$1" >/dev/null || Fdie else patch -Np$level --no-backup-if-mismatch -i "$Fsrcdir/$1" || Fdie ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: drop unused variable in Fpatch
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=422e27e013e7a4b963598ca632f01dc6bef83392 commit 422e27e013e7a4b963598ca632f01dc6bef83392 Author: Miklos Vajna Date: Sat May 29 15:12:12 2010 +0200 util.sh: drop unused variable in Fpatch diff --git a/source/include/util.sh b/source/include/util.sh index 00714ae..c46a921 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -631,7 +631,7 @@ __Fpatch() { ### Fpatch() { Fcd - local i level="1" + local i Fmessage "Using patch: $1" if [ -n "`echo "$1" | grep '\.gz$'`" ]; then i=`basename "$1" .gz` ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ad2e55af2c2596b234e28d22bdbee2132aef9063 commit ad2e55af2c2596b234e28d22bdbee2132aef9063 Author: Michel Hermier Date: Tue May 11 00:30:47 2010 +0200 util.sh * Fix Flastarchive for empty first empty optional arguments. diff --git a/source/include/util.sh b/source/include/util.sh index 68658fc..00714ae 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1090,6 +1090,12 @@ Flastarchive() { _F_archive_name="$pkgname" fi + if [ -z "$1" ]; then + # If first parameter is empty, ignore it since it is optional + # Required by Flasttar/Flasttgz/Flasttarbz2 + shift + fi + if [ $# -gt 1 ]; then local filter lynx="lynx -dump" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=c909e1f2c101beb5e93facf9233534263d7793f8 commit c909e1f2c101beb5e93facf9233534263d7793f8 Author: Michel Hermier Date: Tue Apr 27 20:34:52 2010 +0200 util.sh * Add obviously potentially missing double quote. diff --git a/source/include/util.sh b/source/include/util.sh index 74a026e..68658fc 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1121,7 +1121,7 @@ Flastarchive() { # ball extension. Parameters: 1) url (optional) see Flastarchive ### Flasttar() { - Flastarchive $1 '\.tar\(\.gz\|\.bz2\)\?\|\.tgz' + Flastarchive "$1" '\.tar\(\.gz\|\.bz2\)\?\|\.tgz' } ### @@ -1131,7 +1131,7 @@ Flasttar() { # NOTE: this function is obsolete, use Flasttar instead. ### Flasttgz() { - Flastarchive $1 '\.tgz' + Flastarchive "$1" '\.tgz' } ### @@ -1141,7 +1141,7 @@ Flasttgz() { # NOTE: this function is obsolete, use Flasttar instead. ### Flasttarbz2() { - Flastarchive $1 '\.tar\.bz2' + Flastarchive "$1" '\.tar\.bz2' } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=a4eb1ead7cd4de5dae8c23bfc97f2a89cb8cb5d8 commit a4eb1ead7cd4de5dae8c23bfc97f2a89cb8cb5d8 Author: Michel Hermier Date: Tue Apr 27 20:23:37 2010 +0200 util.sh * Allow late expand in Fsed and Freplace (Required by some packages) diff --git a/source/include/util.sh b/source/include/util.sh index 69aa21e..74a026e 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -514,11 +514,13 @@ __Fsed() { # replacement 3) file(s) to edit in place. ### Fsed() { - local i + local i path Fcd for i in "${@:3:$#}"; do - Fmessage "Using sed with file: $i" - __Fsed "$1" "$2" "$i" + for path in $i; do # expand $i if possible + Fmessage "Using sed with file: $path" + __Fsed "$1" "$2" "$path" + done done } @@ -528,11 +530,13 @@ Fsed() { # 1) Variable to substituate 2) file(s) where the substitution happens. ### Freplace() { - local i + local i path Fcd for i in "${@:2:$#}"; do - Fmessage "Subtituing $1 in file: $i" - eval "__Fsed '@$1@' \"\${$1}\" \"\$i\"" + for path in $i; do # expand $i if possible + Fmessage "Subtituing $1 in file: $path" + eval "__Fsed '@$1@' \"\${$1}\" \"\$path\"" + done done } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=816b7b31d62b58a781a82df00094b4e407e83236 commit 816b7b31d62b58a781a82df00094b4e407e83236 Author: Michel Hermier Date: Tue Apr 27 20:10:43 2010 +0200 util.sh * Fix obvious typos. diff --git a/source/include/util.sh b/source/include/util.sh index 74545d9..69aa21e 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -254,7 +254,7 @@ Fmv() { ### # * Fsubmv(): Move a file under the subpkg Fdestdir. Parameters: 1) name of the -# subpackage 2) name of the file 2) destination +# subpackage 2) name of the file 3) destination ### Fsubmv() { @@ -498,12 +498,12 @@ Fln() { # 1) regexp (see man sed!) 2) replacement 3) file to edit in place. ### __Fsed() { - if [ ! -e $i ]; then - error "File $i not found." + if [ ! -e "$3" ]; then + error "File $3 not found." Fdie fi - if [ ! -f $i ]; then - error "File $i is not a regular file." + if [ ! -f "$3" ]; then + error "File $3 is not a regular file." Fdie fi sed -i -e "s|$1|$2|g" "$3" || Fdie ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh * add support for xz and xz compressed tar archives to Fextract * fix lzma extraction support in Fextract
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ace4ad34fa210f6fc3d2cfc2f7d7766f5e494872 commit ace4ad34fa210f6fc3d2cfc2f7d7766f5e494872 Author: James Buren Date: Sun Apr 25 18:21:19 2010 -0500 util.sh * add support for xz and xz compressed tar archives to Fextract * fix lzma extraction support in Fextract diff --git a/source/include/util.sh b/source/include/util.sh index d9b8b7b..4c02ab0 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1402,6 +1402,8 @@ Fextract() { cmd="tar $_F_extract_taropts --use-compress-program=bzip2 -xf $file" ;; *.tar.lzma) cmd="tar $_F_extract_taropts --use-compress-program=lzma -xf $file" ;; + *.tar.xz) + cmd="tar $_F_extract_taropts --use-compress-program=xz -xf $file" ;; *.tar) cmd="tar $_F_extract_taropts -xf $file" ;; *.zip|*.xpi) @@ -1416,7 +1418,9 @@ Fextract() { *.bz2) cmd="bunzip2 -f $file" ;; *.lzma) - cmd="lzma -f $file" ;; + cmd="unlzma -f $file" ;; + *.xz) + cmd="unxz -f $file" ;; *.7z) cmd="7z x $file" ;; *) ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh * extend Fextract to handle *.tar.lzma and *.lzma
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=78e86316c0d22bb8b1f4d5fdd3713a99647436c7 commit 78e86316c0d22bb8b1f4d5fdd3713a99647436c7 Author: James Buren Date: Thu Apr 22 17:23:16 2010 -0500 util.sh * extend Fextract to handle *.tar.lzma and *.lzma diff --git a/source/include/util.sh b/source/include/util.sh index 6468eba..ae6fb4b 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1370,6 +1370,8 @@ Fextract() { cmd="tar $_F_extract_taropts --use-compress-program=gzip -xf $file" ;; *.tar.bz2|*.tbz2) cmd="tar $_F_extract_taropts --use-compress-program=bzip2 -xf $file" ;; + *.tar.lzma) + cmd="tar $_F_extract_taropts --use-compress-program=lzma -xf $file" ;; *.tar) cmd="tar $_F_extract_taropts -xf $file" ;; *.zip|*.xpi) @@ -1383,6 +1385,8 @@ Fextract() { cmd="gunzip -f $file" ;; *.bz2) cmd="bunzip2 -f $file" ;; + *.lzma) + cmd="lzma -f $file" ;; *.7z) cmd="7z x $file" ;; *) ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=5b253b83850969839a2403eed7413a1ea40a35e3 commit 5b253b83850969839a2403eed7413a1ea40a35e3 Author: Michel Hermier Date: Wed Apr 14 14:43:32 2010 +0200 util.sh * In case of broken dir url wget dies, Lets try lynx to handle the case. * Flastarchive core reorganisation, and allow _grep and _grepv options, to be used in a single invocation. diff --git a/source/include/util.sh b/source/include/util.sh index 922e166..6468eba 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1066,8 +1066,14 @@ Fsanitizeversion() { # * Fwcat: Extracts a page to stdout. Parameters: 1) url of the page. ### Fwcat() { + # NOTE: wget is first because it handle https, while lynx don't support + # it without user interaction. # Note "-e robots=off" disable robots.txt grabbing - wget -O - -q --no-check-certificate "$1" + wget -O - -q --no-check-certificate "$1" && return + + # Use lynx in case wget failed since it support "broken" directory url. + # eg. when http://foo.com/bar instead of http://foo.com/bar/ + lynx -source "$1" 2>/dev/null && return } ### @@ -1076,26 +1082,25 @@ Fwcat() { # for the archive type ### Flastarchive() { - local lynx="lynx -stdin -dump" - - if [ -z "$_F_archive_nolinksonly" ]; then - lynx="$lynx -listonly" - fi - if [ -z "$_F_archive_name" ]; then _F_archive_name="$pkgname" fi if [ $# -gt 1 ]; then + local filter lynx="lynx -dump" + + if [ -z "$_F_archive_nolinksonly" ]; then + lynx="$lynx -listonly" + fi + if [ -n "$_F_archive_grep" ]; then - Fwcat $1 | $lynx | grep -- "$_F_archive_grep" | Flastarchive $2 - return + filter="$filter | grep -- \"$_F_archive_grep\"" fi if [ -n "$_F_archive_grepv" ]; then - Fwcat $1 | $lynx | grep -v -- "$_F_archive_grepv" | Flastarchive $2 - return + filter="$filter | grep -v -- \"$_F_archive_grepv\"" fi - Fwcat $1 | $lynx | Flastarchive $2 +# eval "$lynx \"$1\" $filter" | Flastarchive "$2" # possible optimisation + Fwcat "$1" | eval "$lynx -stdin $filter" | Flastarchive "$2" else if [ -z "$_F_archive_nosort" ]; then sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" \ ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=fa89b5123d39b4b97452fab3850477ad67cef1a5 commit fa89b5123d39b4b97452fab3850477ad67cef1a5 Author: Michel Hermier Date: Sat Apr 10 18:24:24 2010 +0200 util.sh * Remove tar option -i in Fextract. Replace it with a more generic and less intrusive variable (_F_extract_taropts), that alow to add extra options to tar invocation. diff --git a/source/include/util.sh b/source/include/util.sh index 4ad8283..922e166 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1362,11 +1362,11 @@ Fextract() { tmp="$(echo "${file}" | tr 'A-Z' 'a-z')" case "${tmp}" in *.tar.gz|*.tar.z|*.tgz) - cmd="tar --use-compress-program=gzip -xif $file" ;; + cmd="tar $_F_extract_taropts --use-compress-program=gzip -xf $file" ;; *.tar.bz2|*.tbz2) - cmd="tar --use-compress-program=bzip2 -xif $file" ;; + cmd="tar $_F_extract_taropts --use-compress-program=bzip2 -xf $file" ;; *.tar) - cmd="tar -xf $file" ;; + cmd="tar $_F_extract_taropts -xf $file" ;; *.zip|*.xpi) unziphack=1 cmd="unzip -qqo $file" ;; ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=f60910ca036555dc5fb20b735dbd2d28e7bc2fcd commit f60910ca036555dc5fb20b735dbd2d28e7bc2fcd Author: Michel Hermier Date: Fri Apr 9 18:51:39 2010 +0200 util.sh * Introduce Fwcat utility that dumps an url content to stdout (https complients). * Make Flastarchive use Fwcat so that https have not to be a special case. diff --git a/source/include/util.sh b/source/include/util.sh index d319c4c..4ad8283 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1063,12 +1063,20 @@ Fsanitizeversion() { } ### +# * Fwcat: Extracts a page to stdout. Parameters: 1) url of the page. +### +Fwcat() { + # Note "-e robots=off" disable robots.txt grabbing + wget -O - -q --no-check-certificate "$1" +} + +### # * Flastarchive: Extracts last archive version from a page. Parameters: 1) # url (optional) of the page, else stdin if not present 2) extension_filter # for the archive type ### Flastarchive() { - local lynx="lynx -dump" + local lynx="lynx -stdin -dump" if [ -z "$_F_archive_nolinksonly" ]; then lynx="$lynx -listonly" @@ -1080,14 +1088,14 @@ Flastarchive() { if [ $# -gt 1 ]; then if [ -n "$_F_archive_grep" ]; then - $lynx $1 | grep -- "$_F_archive_grep" | Flastarchive $2 + Fwcat $1 | $lynx | grep -- "$_F_archive_grep" | Flastarchive $2 return fi if [ -n "$_F_archive_grepv" ]; then - $lynx $1 | grep -v -- "$_F_archive_grepv" | Flastarchive $2 + Fwcat $1 | $lynx | grep -v -- "$_F_archive_grepv" | Flastarchive $2 return fi - $lynx $1 | Flastarchive $2 + Fwcat $1 | $lynx | Flastarchive $2 else if [ -z "$_F_archive_nosort" ]; then sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" \ ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=e52064f30c4a1d3e6e41d493839f52830c8525a1 commit e52064f30c4a1d3e6e41d493839f52830c8525a1 Author: Michel Hermier Date: Thu Mar 25 09:25:57 2010 +0100 util.sh * Oups typo. diff --git a/source/include/util.sh b/source/include/util.sh index 03d41c8..d319c4c 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -543,7 +543,7 @@ Freplace() { Fdeststrip() { local i for i in "$@"; do - Fsed "$Fdestdir" "" "Fdestdir"/$i # expand $i if possible + Fsed "$Fdestdir" "" "$Fdestdir"/$i # expand $i if possible done } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=10716681d5770f2944969119944660b96c71009a commit 10716681d5770f2944969119944660b96c71009a Author: Michel Hermier Date: Thu Mar 25 09:05:18 2010 +0100 util.sh * Partially revert 47414cc9e86a202d3abab88599b819c8d7c9e313 and add a side note for allowed late expansion. diff --git a/source/include/util.sh b/source/include/util.sh index bb5307d..03d41c8 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -543,7 +543,7 @@ Freplace() { Fdeststrip() { local i for i in "$@"; do - Fsed "$Fdestdir" "" "$Fdestdir/$i" + Fsed "$Fdestdir" "" "Fdestdir"/$i # expand $i if possible done } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=7025eadf54c532cc729556daf89e68f4ff0b7922 commit 7025eadf54c532cc729556daf89e68f4ff0b7922 Author: Michel Hermier Date: Tue Mar 23 19:20:00 2010 +0100 util.sh * Add cosmetic " around some variable for potential filename with whitespace. diff --git a/source/include/util.sh b/source/include/util.sh index 38dce90..bb5307d 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -543,7 +543,7 @@ Freplace() { Fdeststrip() { local i for i in "$@"; do - Fsed "$Fdestdir" "" $Fdestdir/$i + Fsed "$Fdestdir" "" "$Fdestdir/$i" done } @@ -654,7 +654,7 @@ Fpatch() { ### Fpatchall() { local patch="" patcharch="" - for i in ${sour...@]}; do + for i in "${sour...@]}"; do if [ -n "`echo "$i" | grep '\.patch[0-9]*$'`" -o -n "`echo "$i" | grep '\.diff$'`" -o -n "`echo "$i" | grep '\.\(patch[0-9]*\|diff\)\.\(gz\|bz2\)$'`" ]; then patch=`strip_url "$i"` patcharch=`echo $patch|sed 's/.*-\([^-]\+\)\.\(diff\|patch0\?\)$/\1/'` ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=8a9122975f01aa254a6d63b0979ab3d25f3816db commit 8a9122975f01aa254a6d63b0979ab3d25f3816db Author: Michel Hermier Date: Tue Mar 23 11:46:57 2010 +0100 util.sh * Introduce Freplace function. * Factorise Fsed and Freplace in private __Fsed. diff --git a/source/include/util.sh b/source/include/util.sh index 1606de4..fba4b37 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -494,15 +494,45 @@ Fln() { } ### +# * __Fsed(): Private implementation of Fsed and Freplace. Parameters: +# 1) regexp (see man sed!) 2) replacement 3) file to edit in place. +### +__Fsed() { + if [ ! -e $i ]; then + error "File $i not found." + Fdie + fi + if [ ! -f $i ]; then + error "File $i is not a regular file." + Fdie + fi + sed -i -e "s|$1|$2|g" "$3" || Fdie +} + +### # * Fsed(): Use sed on file(s). Parameters: 1) regexp (see man sed!) 2) # replacement 3) file(s) to edit in place. ### Fsed() { local i Fcd - for i in ${@:3:$#}; do + for i in "${@:3:$#}"; do Fmessage "Using sed with file: $i" - sed -i -e "s|$1|$2|g" "$i" || Fdie + __Fsed "$1" "$2" "$i" + done +} + +### +# * Freplace(): Do some parameter substitution on file(s). The parameters +# should be escaped using the "@parameter@" syntax. Parameters: +# 1) Variable to substituate 2) file(s) where the substitution happens. +### +Freplace() { + local i + Fcd + for i in "${@:2:$#}"; do + Fmessage "Subtituing $1 in file: $i" + eval "__Fsed '@$1@' \"\${$1}\" \"\$i\"" done } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=4b733bd0a89ad14a7aef2cee80f0256b3628775a commit 4b733bd0a89ad14a7aef2cee80f0256b3628775a Author: Michel Hermier Date: Wed Feb 3 22:53:52 2010 +0100 util.sh * Try to add the tar option i (ignore blocks of zeros in archive (normally mean EOF)) to see if it helps with some archive (like evolution-data-server) diff --git a/source/include/util.sh b/source/include/util.sh index 0c7d911..a24092a 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1323,9 +1323,9 @@ Fextract() { tmp="$(echo "${file}" | tr 'A-Z' 'a-z')" case "${tmp}" in *.tar.gz|*.tar.z|*.tgz) - cmd="tar --use-compress-program=gzip -xf $file" ;; + cmd="tar --use-compress-program=gzip -xif $file" ;; *.tar.bz2|*.tbz2) - cmd="tar --use-compress-program=bzip2 -xf $file" ;; + cmd="tar --use-compress-program=bzip2 -xif $file" ;; *.tar) cmd="tar -xf $file" ;; *.zip|*.xpi) ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh::Fpatch: show patching output only once
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=079dfaa6adf1bfcbf577e7b9436f45c875405466 commit 079dfaa6adf1bfcbf577e7b9436f45c875405466 Author: Miklos Vajna Date: Wed Jan 27 13:42:44 2010 +0100 util.sh::Fpatch: show patching output only once - we used to show it twice when it succeeded and -p1 was used diff --git a/source/include/util.sh b/source/include/util.sh index 8215fe7..0c7d911 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -580,7 +580,13 @@ __Fpatch() { fi level="1" fi - patch -Np$level --no-backup-if-mismatch -i "$Fsrcdir/$1" || Fdie + # if we are here, the patch applied with -p1, so it's no good + # showing the output again + if [ "$level" = 1 ]; then + patch -Np$level --no-backup-if-mismatch -i "$Fsrcdir/$1" >/dev/null || Fdie + else + patch -Np$level --no-backup-if-mismatch -i "$Fsrcdir/$1" || Fdie + fi return 0 } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ee5eb764f908b301d20030691eb8089c9c245c03 commit ee5eb764f908b301d20030691eb8089c9c245c03 Author: Michel Hermier Date: Tue Jan 26 20:05:42 2010 +0100 util.sh * Fix typo. diff --git a/source/include/util.sh b/source/include/util.sh index 7a7d6ae..8215fe7 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -153,7 +153,7 @@ Fcd() { Fsubdestdir() { local subdestdir="$Fdestdir" if [ -n "$1" ]; then - subdestdir="$subidestdir.$1" + subdestdir="$subdestdir.$1" fi if [ ! -d "$subdestdir" ]; then Fmessage "$i is not an existing subpackage." ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=d86cdcaf6b054365345171ed1e4039a9a6e8e70d commit d86cdcaf6b054365345171ed1e4039a9a6e8e70d Author: Michel Hermier Date: Tue Jan 26 18:01:22 2010 +0100 util.sh * Factorise Fcleandestdir by using Fsubdestdir. diff --git a/source/include/util.sh b/source/include/util.sh index 1adc1d7..7a7d6ae 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -151,15 +151,15 @@ Fcd() { # Parameter: optional subpkg name. ### Fsubdestdir() { - local subpath="$Fdestdir" + local subdestdir="$Fdestdir" if [ -n "$1" ]; then - subpath="$subpath.$1" + subdestdir="$subidestdir.$1" fi - if [ ! -d "$subpath" ]; then + if [ ! -d "$subdestdir" ]; then Fmessage "$i is not an existing subpackage." Fdie fi - echo "$subpath" + echo "$subdestdir" } Fsubdestdirinfo() { @@ -558,16 +558,13 @@ __Ftreecmp_cleandestdir() { # them conflict less. Parameters: The subpackages to use. ### Fcleandestdir() { - local i + local i subdestdir for i in "$@" do - if [ ! -d "$Fdestdir.$i" ]; then - Fmessage "$i is not an existing subpackage." - Fdie - fi Fmessage "Removing conflicting files with $i subpackage." + subdestdir="`Fsubdestdir "$i"`" _F_treecmp_findopts='! -type d' \ - Ftreecmp "$Fdestdir" "$Fdestdir.$i" __Ftreecmp_cleandestdir + Ftreecmp "$Fdestdir" "$subdestdir" __Ftreecmp_cleandestdir done } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh * Ohh lol die here #Fdie -> Fdie ; ) * I don't think it was meant like this * in commit 55f69c6d
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=9d2f534b63b0669c872feffdea5ad34122b82f7a commit 9d2f534b63b0669c872feffdea5ad34122b82f7a Author: crazy Date: Tue Jan 26 11:01:05 2010 +0100 util.sh * Ohh lol die here #Fdie -> Fdie ;) * I don't think it was meant like this * in commit 55f69c6d diff --git a/source/include/util.sh b/source/include/util.sh index 13669df..1adc1d7 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1234,7 +1234,7 @@ Fsplit() #Â FIXME Compatibility: check for $subpkg in subpkgs warning "Trying to move $@ to undeclared subpackage $subpkg" mkdir -p $startdir/pkg.$subpkg/ -# Fdie + Fdie fi for i in "$@" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh * remove trailing whitespace
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=1ad1b5c87256e509615ce93226733b8298cf3ae3 commit 1ad1b5c87256e509615ce93226733b8298cf3ae3 Author: James Buren Date: Sat Jan 23 01:32:20 2010 -0600 util.sh * remove trailing whitespace diff --git a/source/include/util.sh b/source/include/util.sh index 5a9e0ff..a6ea32f 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -792,7 +792,7 @@ Fsort() { if [ -x /usr/bin/versort ]; then /usr/bin/versort else - + # Deprecated method of sorting, it's too much slow local i= items= left=0 items=( `cat|tr '\n' ' '` ) ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ff67d6b3ab755e37b53689176370c729f67b58e5 commit ff67d6b3ab755e37b53689176370c729f67b58e5 Author: Michel Hermier Date: Sat Dec 26 18:37:11 2009 +0100 util.sh * Make Finstall more verbose, displaying the install command line. diff --git a/source/include/util.sh b/source/include/util.sh index e1e2694..9aba9a1 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -659,14 +659,14 @@ Fmakeinstall() { Fmessage "Installing to the package directory..." if [ -f GNUmakefile -o -f makefile -o -f Makefile ]; then if grep -q DESTDIR GNUmakefile makefile Makefile 2>/dev/null; then - make DESTDIR="$Fdestdir" "$@" install || Fdie + Fexec make DESTDIR="$Fdestdir" "$@" install || Fdie else - make prefix="$Fdestdir"/"$Fprefix" "$@" install || Fdie + Fexec make prefix="$Fdestdir"/"$Fprefix" "$@" install || Fdie fi elif [ -f setup.py ]; then - python setup.py install --prefix "$Fprefix" --root "$Fdestdir" "$@" || Fdie + Fexec python setup.py install --prefix "$Fprefix" --root "$Fdestdir" "$@" || Fdie elif [ -f setup.rb ]; then - ruby setup.rb install --prefix=$Fdestdir || Fdie + Fexec ruby setup.rb install --prefix=$Fdestdir || Fdie elif [ -f build.xml ]; then if declare -f Fjar >/dev/null; then for i in ${_f_java_ja...@]} ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=bf2be8e8862dde0d92d2fce8b65dfc5bc1f8a252 commit bf2be8e8862dde0d92d2fce8b65dfc5bc1f8a252 Author: Michel Hermier Date: Sat Dec 26 18:34:15 2009 +0100 util.sh * Introduce __Fpatch a private function that really does the patch work. * Make Fpatch use __Fpatch so that we can try various patch strategies. diff --git a/source/include/util.sh b/source/include/util.sh index cc8c32e..e1e2694 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -473,7 +473,23 @@ Fdeststrip() { } ### -# * Fpatch(): Apply a patch with -p1 (or -p0 if -p1 fails). Parameter: Patch to +# * __Fpatch(): Internal. Apply a patch with -p0 (or -p1 if -p0 fails). +# Parameter: Patch to apply. +### +__Fpatch() { + local level="0" + if ! patch -Np0 --dry-run -i "$Fsrcdir/$1" >/dev/null; then + if ! patch -Np1 --dry-run -i "$Fsrcdir/$1" >/dev/null; then + return 1 + fi + level="1" + fi + patch -Np$level --no-backup-if-mismatch -i "$Fsrcdir/$1" || Fdie + return 0 +} + +### +# * Fpatch(): Apply a patch. Parameter: Patch to # apply. A ".gz" or ".bz2" suffix will be ingored. ### Fpatch() { @@ -487,12 +503,14 @@ Fpatch() { else i=$1 fi - sed -i 's/\r$//' "$Fsrcdir/$i" - if patch -Np0 --dry-run -i "$Fsrcdir/$i" >/dev/null && \ - ! patch -Np1 --dry-run -i "$Fsrcdir/$i" >/dev/null; then - level="0" + if ! __Fpatch "$i"; then + warning "Patch $i did not apply, trying a dos2unix line ending convertion." + sed -i 's/\r$//' "$Fsrcdir/$i" + if ! __Fpatch "$i"; then + error "Patch $i did not apply at all, check your patch" + Fdie + fi fi - patch -Np$level --no-backup-if-mismatch -i "$Fsrcdir/$i" || Fdie } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ca1f518263abaa1c790c7d46477163e5e9ebdca6 commit ca1f518263abaa1c790c7d46477163e5e9ebdca6 Author: Michel Hermier Date: Fri Dec 11 16:07:12 2009 +0100 util.sh * Do a sed dos2unix conversion in Fpatch (do we have binary patch out there that require this conversion to be skipped?) diff --git a/source/include/util.sh b/source/include/util.sh index bc2d18b..46fee10 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -487,6 +487,7 @@ Fpatch() { else i=$1 fi + sed 's/\r$//' "$Fsrcdir/$i" > "$Fsrcdir/$i" if patch -Np0 --dry-run -i "$Fsrcdir/$i" >/dev/null && \ ! patch -Np1 --dry-run -i "$Fsrcdir/$i" >/dev/null; then level="0" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=64bddb1a5cfcf30bd94928fc7cc07f6b8824139b commit 64bddb1a5cfcf30bd94928fc7cc07f6b8824139b Author: Michel Hermier Date: Fri Dec 11 13:16:16 2009 +0100 util.sh * Do a sed dos2unix conversion in Fpatch (do we have dinary patch outthere that require this conversion to be skipped?) diff --git a/source/include/util.sh b/source/include/util.sh index bc2d18b..b6e98b5 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -80,6 +80,7 @@ # * Farchs # * Fconfopts # * LDFLAGS +# * _F_gensciptlet_hooks ### Fpkgversep="-" Fsrcdir="$startdir/src" @@ -92,6 +93,7 @@ Fmenudir="/usr/share/applications" Farchs=('i686' 'x86_64' 'ppc') Fbuildchost="`arch`-frugalware-linux" Fconfopts="" +_F_gensciptlet_hooks=('Futil_genscriptlet_hook') ## Move to makepkg.conf for Kalgan+1 export LDFLAGS="-Wl,--hash-style=both" unset LANG LC_ALL @@ -487,6 +489,7 @@ Fpatch() { else i=$1 fi + sed 's/\r$//' "$Fsrcdir/$i" > "$Fsrcdir/$i" if patch -Np0 --dry-run -i "$Fsrcdir/$i" >/dev/null && \ ! patch -Np1 --dry-run -i "$Fsrcdir/$i" >/dev/null; then level="0" @@ -906,6 +909,7 @@ Fsanitizeversion() { if [ $# -gt 0 ]; then echo "$1" | Fsanitizeversion else + # _F_archive_prefix place is questionable sed "s/%2B/+/g;s/$pkgextraver$//;s/$_F_archive_prefix//;s/-/_/g" fi } @@ -1232,3 +1236,12 @@ Fextract() { fi fi } + +### +# * Futil_genscriptlet_hook(): the genscriplet hook for the util.sh variables. +### +Futil_genscriptlet_hook() +{ + Fsed '$pkgname' "$pkgname" $1 + Fsed '$pkgver' "$pkgver" $1 +} ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ca1f518263abaa1c790c7d46477163e5e9ebdca6 commit ca1f518263abaa1c790c7d46477163e5e9ebdca6 Author: Michel Hermier Date: Fri Dec 11 16:07:12 2009 +0100 util.sh * Do a sed dos2unix conversion in Fpatch (do we have binary patch out there that require this conversion to be skipped?) diff --git a/source/include/util.sh b/source/include/util.sh index bc2d18b..46fee10 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -487,6 +487,7 @@ Fpatch() { else i=$1 fi + sed 's/\r$//' "$Fsrcdir/$i" > "$Fsrcdir/$i" if patch -Np0 --dry-run -i "$Fsrcdir/$i" >/dev/null && \ ! patch -Np1 --dry-run -i "$Fsrcdir/$i" >/dev/null; then level="0" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=64bddb1a5cfcf30bd94928fc7cc07f6b8824139b commit 64bddb1a5cfcf30bd94928fc7cc07f6b8824139b Author: Michel Hermier Date: Fri Dec 11 13:16:16 2009 +0100 util.sh * Do a sed dos2unix conversion in Fpatch (do we have dinary patch outthere that require this conversion to be skipped?) diff --git a/source/include/util.sh b/source/include/util.sh index bc2d18b..b6e98b5 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -80,6 +80,7 @@ # * Farchs # * Fconfopts # * LDFLAGS +# * _F_gensciptlet_hooks ### Fpkgversep="-" Fsrcdir="$startdir/src" @@ -92,6 +93,7 @@ Fmenudir="/usr/share/applications" Farchs=('i686' 'x86_64' 'ppc') Fbuildchost="`arch`-frugalware-linux" Fconfopts="" +_F_gensciptlet_hooks=('Futil_genscriptlet_hook') ## Move to makepkg.conf for Kalgan+1 export LDFLAGS="-Wl,--hash-style=both" unset LANG LC_ALL @@ -487,6 +489,7 @@ Fpatch() { else i=$1 fi + sed 's/\r$//' "$Fsrcdir/$i" > "$Fsrcdir/$i" if patch -Np0 --dry-run -i "$Fsrcdir/$i" >/dev/null && \ ! patch -Np1 --dry-run -i "$Fsrcdir/$i" >/dev/null; then level="0" @@ -906,6 +909,7 @@ Fsanitizeversion() { if [ $# -gt 0 ]; then echo "$1" | Fsanitizeversion else + # _F_archive_prefix place is questionable sed "s/%2B/+/g;s/$pkgextraver$//;s/$_F_archive_prefix//;s/-/_/g" fi } @@ -1232,3 +1236,12 @@ Fextract() { fi fi } + +### +# * Futil_genscriptlet_hook(): the genscriplet hook for the util.sh variables. +### +Futil_genscriptlet_hook() +{ + Fsed '$pkgname' "$pkgname" $1 + Fsed '$pkgver' "$pkgver" $1 +} ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: spellfixes
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=5ff7afcc697882768d72a057c972feaaf1ab9e0d commit 5ff7afcc697882768d72a057c972feaaf1ab9e0d Author: Priyank Date: Sat Jul 18 11:03:48 2009 +0530 util.sh: spellfixes diff --git a/source/include/util.sh b/source/include/util.sh index c6b06d0..b45fa9f 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -159,7 +159,7 @@ Fmkdir() { } ### -# * Frm(): Deletes (rm -rf) a directory stucture under $Fdestdir. Parameter: +# * Frm(): Deletes (rm -rf) a directory structure under $Fdestdir. Parameter: # name of the path to rm -rf (you can supply more than one). ### Frm() { @@ -522,8 +522,8 @@ Fpatchall() { # 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 ceratin arch -# or so) apped the $Fconfopts variable. Parameter: switch(es) to pass to the +# 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() { @@ -563,7 +563,7 @@ Fconf() { ### # * Fmake(): A wrapper to make and "python setup.py build" after calling -# Fconf(). Paramter: switch(es) to pass to Fconf(). +# Fconf(). Parameter: switch(es) to pass to Fconf(). ### Fmake() { Fconf "$@" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=6ab63457612db1a40fdbb27fb3b5a2f36020a35d commit 6ab63457612db1a40fdbb27fb3b5a2f36020a35d Author: Michel Hermier Date: Sat May 30 19:21:23 2009 +0200 util.sh * Move url encoding fix, before pkextraver removal. Make more sence. diff --git a/source/include/util.sh b/source/include/util.sh index aab2fde..496b81c 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -881,7 +881,7 @@ Fsanitizeversion() { if [ $# -gt 0 ]; then echo "$1" | Fsanitizeversion else - sed "s/$pkgextraver$//;s/-/_/g;s/%2B/+/g" + sed "s/%2B/+/g;s/$pkgextraver$//;s/-/_/g" fi } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=9e3eb32768e2f342f51d10c5096e7bd5025f1abf commit 9e3eb32768e2f342f51d10c5096e7bd5025f1abf Author: Michel Hermier Date: Tue May 19 23:54:32 2009 +0200 util.sh * Make Flastarchive only process real packages links by default (instead of the whole html and links). * Introduced var _F_archive_nolinksonly so that it also process the html content. diff --git a/source/include/util.sh b/source/include/util.sh index 9f7b458..c8e103b 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -24,6 +24,8 @@ # # == OPTIONS # * _F_archive_name (defaults to $pkgname) +# * _F_archive_nolinksonly (defaults to no, so that only links are proceeded by +# default) # * _F_archive_nosort (defaults to no, so sorting is enabled by default) # * _F_archive_grep (defaults to empty): grep for a regexp before # searching for the version @@ -890,6 +892,11 @@ Fsanitizeversion() { ### Flastarchive() { local lynx="lynx -dump" + + if [ -z "$_F_archive_nolinksonly" ]; then + lynx="$lynx -listonly" + fi + if [ -z "$_F_archive_name" ]; then _F_archive_name="$pkgname" fi ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=cd9eb512fe6e8e41e81d377781c840ebd27efe05 commit cd9eb512fe6e8e41e81d377781c840ebd27efe05 Author: Michel Hermier Date: Tue May 19 23:51:47 2009 +0200 util.sh * Use Fsanitizeversion in Flastarchive diff --git a/source/include/util.sh b/source/include/util.sh index 4465cbb..9f7b458 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -906,9 +906,11 @@ Flastarchive() { $lynx $1 | Flastarchive $2 else if [ -z "$_F_archive_nosort" ]; then - sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | Fsort | tail -n1 + sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" \ + | Fsort | tail -n1 | Fsanitizeversion else - sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | tail -n1 + sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" \ + | tail -n1 | Fsanitizeversion fi fi } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: add unset LANG LC_ALL
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=d21bf47e44826cf6bcfbf95509b92140879fef31 commit d21bf47e44826cf6bcfbf95509b92140879fef31 Author: Miklos Vajna Date: Mon May 18 13:07:43 2009 +0200 util.sh: add unset LANG LC_ALL diff --git a/source/include/util.sh b/source/include/util.sh index 68f6f12..df18bd7 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -90,6 +90,7 @@ Fbuildchost="`arch`-frugalware-linux" Fconfopts="--prefix=$Fprefix" ## Move to makepkg.conf for Kalgan+1 export LDFLAGS="-Wl,--hash-style=both" +unset LANG LC_ALL ### # == PROVIDED FUNCTIONS ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: Fconf should use a custom Fprefix (if set) in $Fconfopts
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=b8d32edddc46756b28e36adbe1802bbed6fd6fe4 commit b8d32edddc46756b28e36adbe1802bbed6fd6fe4 Author: Priyank Date: Sat Dec 20 18:17:53 2008 +0530 util.sh: Fconf should use a custom Fprefix (if set) in $Fconfopts diff --git a/source/include/util.sh b/source/include/util.sh index a3c1ee7..a585834 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -521,6 +521,7 @@ Fpatchall() { ### Fconf() { Fcd + Fconfopts="--prefix=$Fprefix" Fmessage "Configuring..." if [ -z "$_F_conf_configure" ]; then _F_conf_configure="./configure" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=360c296bc58c62fc79606b0be85f04f277204eb8 commit 360c296bc58c62fc79606b0be85f04f277204eb8 Author: Michel Hermier <[EMAIL PROTECTED]> Date: Tue Aug 19 00:10:37 2008 +0200 util.sh * Make _F_archive_name and _F_cd_path allways defined when using Fcd(). * Give Fconf a second chance to find the configure script. This way we should allow outsource build. * Some cosmetic empty line to split default value initialisation of the code. diff --git a/source/include/util.sh b/source/include/util.sh index 027aaa6..6f204e8 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -120,17 +120,18 @@ Fexec() { # optional source directory, default is $_F_cd_path. ### Fcd() { + if [ -z "$_F_archive_name" ]; then + _F_archive_name="$pkgname" + fi + if [ -z "$_F_cd_path" ]; then + _F_cd_path="$_F_archive_name$Fpkgversep$pkgver$pkgextraver" + fi + if [ "$Fsrcdir" = `pwd` ]; then if [ "$#" -eq 1 ]; then Fmessage "Going to the source directory..." cd "$Fsrcdir/$1" || Fdie elif [ "$#" -eq 0 ]; then - if [ -z "$_F_archive_name" ]; then - _F_archive_name="$pkgname" - fi - if [ -z "$_F_cd_path" ]; then - _F_cd_path="$_F_archive_name$Fpkgversep$pkgver$pkgextraver" - fi Fcd "$_F_cd_path" fi fi @@ -523,7 +524,11 @@ Fconf() { Fmessage "Configuring..." if [ -z "$_F_conf_configure" ]; then _F_conf_configure="./configure" + if [ ! -x "$_F_conf_configure" ]; then + _F_conf_configure="$Fsrcdir/$_F_cd_path/configure" + fi fi + if [ -x $_F_conf_configure ]; then grep -q sysconfdir $_F_conf_configure && \ Fconfopts="$Fconfopts --sysconfdir=$Fsysconfdir" @@ -869,6 +874,7 @@ Flastarchive() { if [ -z "$_F_archive_name" ]; then _F_archive_name="$pkgname" fi + if [ $# -gt 1 ]; then lynx -dump $1 | Flastarchive $2 else ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=b3556f6b9eaf1cb8d3c11ba635674067aaef32c3 commit b3556f6b9eaf1cb8d3c11ba635674067aaef32c3 Author: Michel Hermier <[EMAIL PROTECTED]> Date: Mon Aug 18 23:41:36 2008 +0200 util.sh * Introduce new utility function Fexec that display a command line * before it execute it. Note that it's not valid when used with pipes. diff --git a/source/include/util.sh b/source/include/util.sh index 9752212..027aaa6 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -107,6 +107,15 @@ Fdie() { } ### +# * Fexec(): Display and execute the command line passed as parameter. Note that +#Â it cannot be used in a pipe context. Parameters: the command line to execute. +### +Fexec() { + Fmessage "$*" + "$@" +} + +### # * Fcd(): Go to the source directory if it is $Fsrcdir currently. Parameter: # optional source directory, default is $_F_cd_path. ### @@ -522,21 +531,21 @@ Fconf() { Fconfopts="$Fconfopts --localstatedir=$Flocalstatedir" grep -q 'build=' $_F_conf_configure && \ Fconfopts="$Fconfopts --build=$Fbuildchost" - $_F_conf_configure $Fconfopts "$@" || Fdie + Fexec $_F_conf_configure $Fconfopts "$@" || Fdie elif [ -f Makefile.PL ]; then if [ -z "$_F_conf_perl_pipefrom" ]; then - perl Makefile.PL DESTDIR=$Fdestdir "$@" || Fdie + 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 - ruby extconf.rb --prefix="$Fprefix" "$@" || Fdie + Fexec ruby extconf.rb --prefix="$Fprefix" "$@" || Fdie elif [ -f configure.rb ]; then - ./configure.rb --prefix="$Fprefix" "$@" || Fdie + Fexec ./configure.rb --prefix="$Fprefix" "$@" || Fdie elif [ -f setup.rb ]; then - ruby setup.rb config "$@" || Fdie + Fexec ruby setup.rb config "$@" || Fdie fi } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh / Fmakeinstall(): remove empty dirs for noarch perl modules
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=f5bd1a4bda654177301c6e82e2a5eeed24e5ea09 commit f5bd1a4bda654177301c6e82e2a5eeed24e5ea09 Author: Miklos Vajna <[EMAIL PROTECTED]> Date: Thu Jul 10 16:06:06 2008 +0200 util.sh / Fmakeinstall(): remove empty dirs for noarch perl modules diff --git a/source/include/util.sh b/source/include/util.sh index 44d433a..0a99208 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -635,6 +635,8 @@ Fmakeinstall() { if [ -d $Fdestdir/usr/lib/perl5/site_perl ]; then find $Fdestdir/usr/lib/perl5/site_perl -name perllocal.pod -exec rm {} \; find $Fdestdir/usr/lib/perl5/site_perl -name .packlist -exec rm {} \; + rmdir -p --ignore-fail-on-non-empty \ + $Fdestdir/usr/lib/perl5/site_perl/current/*/auto/*/* fi # rc script ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=76d6be4f873cbf32838e62354d655aeea9e00f6d commit 76d6be4f873cbf32838e62354d655aeea9e00f6d Author: Michel Hermier <[EMAIL PROTECTED]> Date: Mon Mar 24 22:21:35 2008 +0100 util.sh * Fixed some command behaviour so that they are more logical. * All the deprecated functions display a warning at build time, maintainers review your scripts when updating/bumping version. diff --git a/source/include/util.sh b/source/include/util.sh index 49344f8..145953a 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -154,12 +154,18 @@ Frm() { } ### -# * Fcp(): Copy file(s) under $Fdestdir. First parameter: name of the file, -# second parameter: path of the destination. +# * Fcp(): Copy file(s) to $Fdestdir recursively from $Fsrcdir. First +# parameter: name of the file, second parameter: path of the destination. ### Fcp() { Fmessage "Copying file(s): $1" - cp "$Fdestdir/"$1 "$Fdestdir"/$2 || Fdie + if [ -e "$Fdestdir/"$1 ]; then + # Compatibility + warning "Deprecated usage of $*" + cp "$Fdestdir/"$1 "$Fdestdir"/$2 || Fdie + else + cp -a "$Fsrcdir/"$1 "$Fdestdir"/$2 || Fdie + fi } ### @@ -168,16 +174,28 @@ Fcp() { ### Fcpr() { Fmessage "Copying file(s) recursive: $1" + warning "Fcpr is deprecated in favor of Fcp" cp -a "$Fsrcdir/"$1 "$Fdestdir"/$2 || Fdie } ### +# * Fcprel(): Copy file(s) to $Fdestdir recursively from the current working +# directory. First parameter: name of the file, second parameter: path of the +# destination. +### +Fcprel() { + Fmessage "Copying file(s): $1" + cp -a $1 "$Fdestdir"/$2 || Fdie +} + +### # * Fcprrel(): Copy file(s) to $Fdestdir recursively from the current working # directory. First parameter: name of the file, second parameter: path of the # destination. ### Fcprrel() { Fmessage "Copying file(s) recursive: $1" + warning "Fcprrel is deprecated in favor of Fcprel" cp -a $1 "$Fdestdir"/$2 || Fdie } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: Fextract(): add 7z support
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=b2c39e6d11619e956a0cfdc2a074866a954d35d4 commit b2c39e6d11619e956a0cfdc2a074866a954d35d4 Author: gaetan <[EMAIL PROTECTED]> Date: Tue Mar 18 23:06:32 2008 +0100 util.sh: Fextract(): add 7z support diff --git a/source/include/util.sh b/source/include/util.sh index 9913a60..49344f8 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -1099,6 +1099,8 @@ Fextract() { cmd="gunzip -f $file" ;; *.bz2) cmd="bunzip2 -f $file" ;; + *.7z) + cmd="7z x $file" ;; *) cmd="" ;; esac ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=45fe4a12cef60a09f50ff70dc33925b869157ce1 commit 45fe4a12cef60a09f50ff70dc33925b869157ce1 Author: Michel Hermier <[EMAIL PROTECTED]> Date: Mon Mar 17 15:16:57 2008 +0100 util.sh * Improvement to Flastarchive so that it accept an optional url as first argument so that we can avoid the "lynx -dump $url | Flasttar" duplication everywhere. Now We can call "Flasttar $url" and the "lynx -dump $url" is done behind the scene at a centralised place. * Updated all the Flast* so that it conform to this new feature. diff --git a/source/include/util.sh b/source/include/util.sh index 41608ab..9913a60 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -813,39 +813,51 @@ Fautoreconf() { } ### -# * Flastarchive: Extracts version from a page's last archive. -# Extension of the archive is given as argument. +# * Flastarchive: Extracts last archive version from a page. Parameters: 1) +# url (optional) of the page, else stdin if not present 2) extension_filter +# for the archive type ### Flastarchive() { if [ -z "$_F_archive_name" ]; then _F_archive_name="$pkgname" fi - if [ -z "$_F_archive_nosort" ]; then - sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | Fsort | tail -n1 + if [ $# -gt 1 ]; then + lynx -dump $1 | Flastarchive $2 else - sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | tail -n1 + if [ -z "$_F_archive_nosort" ]; then + sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | Fsort | tail -n1 + else + sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | tail -n1 + fi fi } ### -# * Flasttar(): Extracts version from a page's last tar.gz link. +# * Flasttar(): A convenience function to Flastarchive for all the known tar +# ball extension. Parameters: 1) url (optional) see Flastarchive ### Flasttar() { - Flastarchive '\.tar\(\.gz\|\.bz2\)\?\|\.tgz' + Flastarchive $1 '\.tar\(\.gz\|\.bz2\)\?\|\.tgz' } ### -# * Flasttgz(): Extracts version from a page's last tgz link. +# * Flasttgz(): A convenience function to Flastarchive for the tgz extension. +# Parameters: 1) url (optional) see Flastarchive +# +# NOTE: this function is obsolete, use Flasttar instead. ### Flasttgz() { - Flastarchive '\.tgz' + Flastarchive $1 '\.tgz' } ### -# * Flasttarbz2(): Extracts version from a page's last tar.bz2 link. +# * Flasttarbz2(): A convenience function to Flastarchive for the tar.bz2 +# extension. Parameters: 1) url (optional) see Flastarchive +# +# NOTE: this function is obsolete, use Flasttar instead. ### Flasttarbz2() { - Flastarchive '\.tar\.bz2' + Flastarchive $1 '\.tar\.bz2' } ### @@ -853,7 +865,7 @@ Flasttarbz2() { ## Fup2gnugz() { - up2date="lynx -dump 'http://ftp.gnu.org/gnu/$pkgname/?C=M;O=A'|Flasttar" + up2date="Flasttar 'http://ftp.gnu.org/gnu/$pkgname/?C=M;O=A'" } ### @@ -861,7 +873,7 @@ Fup2gnugz() ## Fup2gnubz2() { -up2date="lynx -dump 'http://ftp.gnu.org/gnu/$pkgname/?C=M;O=A'|Flasttarbz2" +up2date="Flasttarbz2 'http://ftp.gnu.org/gnu/$pkgname/?C=M;O=A'" } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=026c4c82ff6aa52d9d9cada8cf047701d39e08d1 commit 026c4c82ff6aa52d9d9cada8cf047701d39e08d1 Author: crazy <[EMAIL PROTECTED]> Date: Sun Mar 9 22:51:43 2008 +0100 util.sh * added Fbuildchost , which is set to `arch`-frugalware-linux * and if we find --build= in configure we use it automatically * in $Fconfopts diff --git a/source/include/util.sh b/source/include/util.sh index ef8d898..9f59ba5 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -82,6 +82,7 @@ Fsysconfdir="/etc" Flocalstatedir="/var" Fmenudir="/usr/share/applications" Farchs=('i686' 'x86_64' 'ppc') +Fbuildchost="`arch`-frugalware-linux" Fconfopts="--prefix=$Fprefix" ## Move to makepkg.conf for Kalgan+1 export LDFLAGS="-Wl,--hash-style=both" @@ -501,6 +502,8 @@ Fconf() { Fconfopts="$Fconfopts --sysconfdir=$Fsysconfdir" grep -q localstatedir $_F_conf_configure && \ Fconfopts="$Fconfopts --localstatedir=$Flocalstatedir" + grep -q 'build=' $_F_conf_configure && \ + Fconfopts="$Fconfopts --build=$Fbuildchost" $_F_conf_configure $Fconfopts "$@" || Fdie elif [ -f Makefile.PL ]; then if [ -z "$_F_conf_perl_pipefrom" ]; then ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=7211673f2e915c06ae513e1e7575611e18fd9bda commit 7211673f2e915c06ae513e1e7575611e18fd9bda Author: crazy <[EMAIL PROTECTED]> Date: Sat Mar 8 13:17:37 2008 +0100 util.sh * remove gcc hack from here , never worked * will be moved to makepkg for now and for Kalgan+1 to makepkg.conf * added comment for LDFLAGS these have to be moved to makepkg.conf also diff --git a/source/include/util.sh b/source/include/util.sh index 49ed8d7..ef8d898 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -83,11 +83,7 @@ Flocalstatedir="/var" Fmenudir="/usr/share/applications" Farchs=('i686' 'x86_64' 'ppc') Fconfopts="--prefix=$Fprefix" -_gccver=`type -p gcc >/dev/null && gcc -dumpversion` -if [ "${_gccver%%.?}" == "4.2" ]; then - export CFLAGS="$CFLAGS -fno-strict-aliasing" - export CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" -fi +## 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] frugalware-current: util.sh: Fmakeinstall(): /usr/lib/perl5/?.?.? -> /usr/lib/perl5/*.*.*
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=91a74d740f76964cfbe129005d84b4d0edc2 commit 91a74d740f76964cfbe129005d84b4d0edc2 Author: Miklos Vajna <[EMAIL PROTECTED]> Date: Sat Feb 9 22:57:03 2008 +0100 util.sh: Fmakeinstall(): /usr/lib/perl5/?.?.? -> /usr/lib/perl5/*.*.* as ?.?.? does not match 5.10.0 diff --git a/source/include/util.sh b/source/include/util.sh index 14ebd19..a951b89 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -581,15 +581,15 @@ Fmakeinstall() { if [ -e $Fdestdir/usr/share/info/dir ]; then Frm /usr/share/info/dir fi - if [ -d $Fdestdir/usr/lib/perl5/?.?.? ]; then - Fmv '/usr/lib/perl5/?.?.?' /usr/lib/perl5/current + if [ -d $Fdestdir/usr/lib/perl5/*.*.* ]; then + Fmv '/usr/lib/perl5/*.*.*' /usr/lib/perl5/current fi if [ -d $Fdestdir/usr/lib/perl5 ]; then find $Fdestdir/usr/lib/perl5 -name perllocal.pod -exec rm {} \; find $Fdestdir/usr/lib/perl5 -name .packlist -exec rm {} \; fi - if [ -e $Fdestdir/usr/lib/perl5/site_perl/?.?.? ]; then - Fmv '/usr/lib/perl5/site_perl/?.?.?' /usr/lib/perl5/site_perl/current + if [ -e $Fdestdir/usr/lib/perl5/site_perl/*.*.* ]; then + Fmv '/usr/lib/perl5/site_perl/*.*.*' /usr/lib/perl5/site_perl/current fi if [ -d $Fdestdir/usr/lib/perl5/site_perl ]; then find $Fdestdir/usr/lib/perl5/site_perl -name perllocal.pod -exec rm {} \; ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=69248158f11787cf2fc27e5c445d307600f8fb1d commit 69248158f11787cf2fc27e5c445d307600f8fb1d Author: crazy <[EMAIL PROTECTED]> Date: Mon Jan 14 23:58:48 2008 +0100 util.sh * fix bug in _F_desktop_show_in which * was always set to $pkgname.dektop diff --git a/source/include/util.sh b/source/include/util.sh index d4abac4..14ebd19 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -952,7 +952,7 @@ MimeType=$dmime EOF if [ ! -z $_F_desktop_show_in ] ; then - echo "OnlyShowIn=$dshowin;" >> $Fdestdir$Fmenudir/$pkgname.desktop + echo "OnlyShowIn=$dshowin;" >> $Fdestdir$Fmenudir/$deskfilename fi } ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: don't check for gcc version if no gcc available
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=c414618114d1f9b91a6efac0cd5d6714323d commit c414618114d1f9b91a6efac0cd5d6714323d Author: Miklos Vajna <[EMAIL PROTECTED]> Date: Thu Dec 13 09:01:57 2007 +0100 util.sh: don't check for gcc version if no gcc available noticed by krix diff --git a/source/include/util.sh b/source/include/util.sh index c638729..d4abac4 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -83,7 +83,7 @@ Flocalstatedir="/var" Fmenudir="/usr/share/applications" Farchs=('i686' 'x86_64' 'ppc') Fconfopts="--prefix=$Fprefix" -_gccver=`gcc -dumpversion` +_gccver=`type -p gcc >/dev/null && gcc -dumpversion` if [ "${_gccver%%.?}" == "4.2" ]; then export CFLAGS="$CFLAGS -fno-strict-aliasing" export CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: add _F_archive_nosort to get back the good old Flasttar (no sorting)
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=34ea613f0bfaabdfc91f34677d91a5d36747881d commit 34ea613f0bfaabdfc91f34677d91a5d36747881d Author: Miklos Vajna <[EMAIL PROTECTED]> Date: Sun Nov 11 18:43:20 2007 +0100 util.sh: add _F_archive_nosort to get back the good old Flasttar (no sorting) diff --git a/source/include/util.sh b/source/include/util.sh index b926679..73f2220 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -24,6 +24,7 @@ # # == OPTIONS # * _F_archive_name (defaults to $pkgname) +# * _F_archive_nosort (defaults to no, so sorting is enabled by default) # * _F_cd_path (defaults to $_F_archive_name$Fpkgversep$pkgver$pkgextraver) # * _F_conf_configure (defaults to ./configure) # * _F_conf_perl_pipefrom: if set, pipe the output of this command in Fconf() @@ -806,7 +807,11 @@ Flastarchive() { if [ -z "$_F_archive_name" ]; then _F_archive_name="$pkgname" fi - sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | Fsort | tail -n1 + if [ -z "$_F_archive_nosort" ]; then + sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | Fsort | tail -n1 + else + sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | tail -n1 + fi } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=55d122a127ba39a36682dd0ed8911d0358b26c56 commit 55d122a127ba39a36682dd0ed8911d0358b26c56 Author: Michel Hermier <[EMAIL PROTECTED]> Date: Thu Nov 1 16:53:42 2007 +0100 util.sh * Revert / matching at the front of the archive name. diff --git a/source/include/util.sh b/source/include/util.sh index 78afdd6..b926679 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -806,7 +806,7 @@ Flastarchive() { if [ -z "$_F_archive_name" ]; then _F_archive_name="$pkgname" fi - sed -n "s/.*\/$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | Fsort | tail -n1 + sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | Fsort | tail -n1 } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=057ff5343ce07b2044f31fbad5864d052b8ad276 commit 057ff5343ce07b2044f31fbad5864d052b8ad276 Author: Michel Hermier <[EMAIL PROTECTED]> Date: Thu Nov 1 14:09:49 2007 +0100 util.sh * Avoid an uinnecessary grep. * Fix the sed program to spit all the version it find (was spitting only the last line before). * Imporve the sed match patern to be sure that before the archive name we have a '/'. diff --git a/source/include/util.sh b/source/include/util.sh index 927eb2b..78afdd6 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -806,7 +806,7 @@ Flastarchive() { if [ -z "$_F_archive_name" ]; then _F_archive_name="$pkgname" fi - grep ".*$_F_archive_name$Fpkgversep.*\($1\).*"|sed -n "s/.*$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/;$ p"|Fsort|tail -n1 + sed -n "s/.*\/$_F_archive_name$Fpkgversep\(.*\)\($1\).*/\1/p" | Fsort | tail -n1 } ### ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh: allow filenames like patch-version in Fpatch()
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=e4f94cd98f92c109ea7bb9ccc3855ac804db05ea commit e4f94cd98f92c109ea7bb9ccc3855ac804db05ea Author: Miklos Vajna <[EMAIL PROTECTED]> Date: Wed Oct 31 23:59:32 2007 +0100 util.sh: allow filenames like patch-version in Fpatch() - basically if you use Fpatch directly then you know what you are doing, so we won't check if the filename has a .diff or .patch* extension - you're a big boy - thx crazy for the idea diff --git a/source/include/util.sh b/source/include/util.sh index 0cce07a..927eb2b 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -445,9 +445,9 @@ Fpatch() { Fcd local i level="1" Fmessage "Using patch: $1" - if [ -n "`echo "$1" | grep '\.\(patch[0-9]*\|diff\)\.gz$'`" ]; then + if [ -n "`echo "$1" | grep '\.gz$'`" ]; then i=`basename "$1" .gz` - elif [ -n "`echo "$1" | grep '\.\(patch[0-9]*\|diff\)\.bz2$'`" ]; then + elif [ -n "`echo "$1" | grep '\.bz2$'`" ]; then i=`basename "$1" .bz2` else i=$1 ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git
[Frugalware-git] frugalware-current: util.sh
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=8fb9768141837fff1d1d55de08ae72a8c5f75d06 commit 8fb9768141837fff1d1d55de08ae72a8c5f75d06 Author: crazy <[EMAIL PROTECTED]> Date: Tue Oct 23 22:11:07 2007 +0200 util.sh * heh fixed my own typos :s diff --git a/source/include/util.sh b/source/include/util.sh index 35d4f04..e47de99 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -824,7 +824,7 @@ Flasttarbz2() { } ### -# * Fup2gnugz(): Up2date line for programs hosted at ftp.gnu.org ( tar.gz ) +# * Fup2gnugz(): Up2date line for programs hosted at ftp.gnu.org ( tar.gz ). ## Fup2gnugz() { @@ -832,7 +832,7 @@ Fup2gnugz() } ### -# * Fup2gnubz2(): Up2date line for programs hosted at ftp.gnu.org ( tar.bz2 ) +# * Fup2gnubz2(): Up2date line for programs hosted at ftp.gnu.org ( tar.bz2 ). ## Fup2gnubz2() { ___ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git