* [gentoo-dev] [RFC] Portability eclass
@ 2005-09-16 15:42 Diego 'Flameeyes' Pettenò
2005-09-16 15:59 ` Mike Frysinger
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2005-09-16 15:42 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 576 bytes --]
If nobody finds problem in the attached eclass, I'm going to commit this
tonight or tomorrow.
The first function is a drop-in replacement for cp --parent (that doesn't work
on BSD userland), the second one is a commodity function to symlink commands
and manpages at once (as done by bsdtar and other packages).
If we'll find other functions needed for portability's sake, they'll probably
going to be there, too.
Comments?
--
Diego "Flameeyes" Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)
[-- Attachment #1.2: portability.eclass --]
[-- Type: text/plain, Size: 1105 bytes --]
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Author: Diego Pettenò <flameeyes@gentoo.org>
#
# This eclass is created to avoid using non-portable GNUisms inside ebuilds
#
# NB: If you add anything, please comment it!
# treecopy orig1 orig2 orig3 .... dest
#
# mimic cp --parents copy, but working on BSD userland as well
treecopy() {
dest=$(eval "echo \${$#}")
files_count=$#
for (( i=1; ${i} < ${files_count}; i=$((${i}+1)) )); do
dirstruct=$(dirname "$1")
mkdir -p "${dest}/${dirstruct}"
cp -pPR "$1" "${dest}/${dirstruct}"
shift
done
}
# symcmd oldcmd newcmd [mansection]
#
# Symlinks a given command to a new one, useful to shade a package that is
# the default provider of a command in a given userland.
# When mansection is specified, also the manpage with basename(oldcmd) is
# symlinked to basename(newcmd).
symcmd() {
dosym ${newcmd} ${oldcmd} || die "symlink failed"
if [[ -n "$3" ]]; then
dosym ${oldcmd}.$3.gz /usr/share/man/man$3/${newcmd}.$3.gz
fi
}
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 15:42 [gentoo-dev] [RFC] Portability eclass Diego 'Flameeyes' Pettenò
@ 2005-09-16 15:59 ` Mike Frysinger
2005-09-16 16:33 ` Diego 'Flameeyes' Pettenò
2005-09-16 16:16 ` Martin Schlemmer
2005-09-17 13:01 ` Diego 'Flameeyes' Pettenò
2 siblings, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2005-09-16 15:59 UTC (permalink / raw
To: gentoo-dev
On Friday 16 September 2005 11:42 am, Diego 'Flameeyes' Pettenò wrote:
> the second one is a commodity function to symlink
> commands and manpages at once (as done by bsdtar and other packages).
i dont see this being really useful ... either way, assuming the manpage is
compressed with gzip (or compressed at all) is wrong
-mike
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 15:42 [gentoo-dev] [RFC] Portability eclass Diego 'Flameeyes' Pettenò
2005-09-16 15:59 ` Mike Frysinger
@ 2005-09-16 16:16 ` Martin Schlemmer
2005-09-16 17:07 ` Diego 'Flameeyes' Pettenò
2005-09-17 13:01 ` Diego 'Flameeyes' Pettenò
2 siblings, 1 reply; 11+ messages in thread
From: Martin Schlemmer @ 2005-09-16 16:16 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 794 bytes --]
On Fri, 2005-09-16 at 17:42 +0200, Diego 'Flameeyes' Pettenò wrote:
> If nobody finds problem in the attached eclass, I'm going to commit this
> tonight or tomorrow.
> The first function is a drop-in replacement for cp --parent (that doesn't work
> on BSD userland), the second one is a commodity function to symlink commands
> and manpages at once (as done by bsdtar and other packages).
>
> If we'll find other functions needed for portability's sake, they'll probably
> going to be there, too.
>
I do not think its so urgent? Either way, we have elibs approved now,
so how about waiting a while so that we do not have yet another elib
candidate to port?
Also, treecopy() will break if I do:
treecopy ${S}/data ${D}/usr/share/foodata
--
Martin Schlemmer
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 15:59 ` Mike Frysinger
@ 2005-09-16 16:33 ` Diego 'Flameeyes' Pettenò
2005-09-16 17:21 ` Chris Gianelloni
2005-09-16 17:28 ` Mike Frysinger
0 siblings, 2 replies; 11+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2005-09-16 16:33 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 371 bytes --]
On Friday 16 September 2005 17:59, Mike Frysinger wrote:
> i dont see this being really useful ... either way, assuming the manpage is
> compressed with gzip (or compressed at all) is wrong
Doesn't portage always gzip manpages?
--
Diego "Flameeyes" Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 16:16 ` Martin Schlemmer
@ 2005-09-16 17:07 ` Diego 'Flameeyes' Pettenò
0 siblings, 0 replies; 11+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2005-09-16 17:07 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 961 bytes --]
On Friday 16 September 2005 18:16, Martin Schlemmer wrote:
> I do not think its so urgent? Either way, we have elibs approved now,
> so how about waiting a while so that we do not have yet another elib
> candidate to port?
There are at least two ebuilds in portage that uses cp --parente . It wasn't
being a problem if it wasn't used.
elib can be approved, but we're working on Gentoo/*BSD (and Gentoo/OSX) now,
not 4 years from now (ok that was an exageration, but simplify what the
problem is: it doesn't seem probable that a newer portage goes out working
and ebuilds start using the new features in a little time.
Remember that we had a bit of opposition also to have gcc using USE_EXPAND-ed
variables, I can't figure what would happen also if tomorrow we find a
portage with elib working :/
--
Diego "Flameeyes" Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 16:33 ` Diego 'Flameeyes' Pettenò
@ 2005-09-16 17:21 ` Chris Gianelloni
2005-09-16 17:28 ` Mike Frysinger
1 sibling, 0 replies; 11+ messages in thread
From: Chris Gianelloni @ 2005-09-16 17:21 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
On Fri, 2005-09-16 at 18:33 +0200, Diego 'Flameeyes' Pettenò wrote:
> On Friday 16 September 2005 17:59, Mike Frysinger wrote:
> > i dont see this being really useful ... either way, assuming the manpage is
> > compressed with gzip (or compressed at all) is wrong
> Doesn't portage always gzip manpages?
No, it can bzip2 them, also.
--
Chris Gianelloni
Release Engineering - Strategic Lead
Games - Developer
Gentoo Linux
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 16:33 ` Diego 'Flameeyes' Pettenò
2005-09-16 17:21 ` Chris Gianelloni
@ 2005-09-16 17:28 ` Mike Frysinger
2005-09-16 17:36 ` Diego 'Flameeyes' Pettenò
1 sibling, 1 reply; 11+ messages in thread
From: Mike Frysinger @ 2005-09-16 17:28 UTC (permalink / raw
To: gentoo-dev
On Friday 16 September 2005 12:33 pm, Diego 'Flameeyes' Pettenò wrote:
> On Friday 16 September 2005 17:59, Mike Frysinger wrote:
> > i dont see this being really useful ... either way, assuming the manpage
> > is compressed with gzip (or compressed at all) is wrong
>
> Doesn't portage always gzip manpages?
current stable does yes, but ive started adding customizable compression to
trunk
-mike
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 17:28 ` Mike Frysinger
@ 2005-09-16 17:36 ` Diego 'Flameeyes' Pettenò
2005-09-16 17:59 ` warnera6
2005-09-16 19:12 ` Mike Frysinger
0 siblings, 2 replies; 11+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2005-09-16 17:36 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
On Friday 16 September 2005 19:28, Mike Frysinger wrote:
> current stable does yes, but ive started adding customizable compression to
> trunk
Okay, then *that* is a problem :P Suggestion how to fix it?
--
Diego "Flameeyes" Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 17:36 ` Diego 'Flameeyes' Pettenò
@ 2005-09-16 17:59 ` warnera6
2005-09-16 19:12 ` Mike Frysinger
1 sibling, 0 replies; 11+ messages in thread
From: warnera6 @ 2005-09-16 17:59 UTC (permalink / raw
To: gentoo-dev
Diego 'Flameeyes' Pettenò wrote:
> On Friday 16 September 2005 19:28, Mike Frysinger wrote:
>
>>current stable does yes, but ive started adding customizable compression to
>>trunk
>
> Okay, then *that* is a problem :P Suggestion how to fix it?
>
You are going to have to ask portage what it used via a PortageAPI call,
I'd gather.
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 17:36 ` Diego 'Flameeyes' Pettenò
2005-09-16 17:59 ` warnera6
@ 2005-09-16 19:12 ` Mike Frysinger
1 sibling, 0 replies; 11+ messages in thread
From: Mike Frysinger @ 2005-09-16 19:12 UTC (permalink / raw
To: gentoo-dev
On Friday 16 September 2005 01:36 pm, Diego 'Flameeyes' Pettenò wrote:
> On Friday 16 September 2005 19:28, Mike Frysinger wrote:
> > current stable does yes, but ive started adding customizable compression
> > to trunk
>
> Okay, then *that* is a problem :P Suggestion how to fix it?
simple, dont add the function
but i guess if you insist on cruft, create the symlink w/out a compression
extension and portage may fix it for you (or it may remove it, who knows)
-mike
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [gentoo-dev] [RFC] Portability eclass
2005-09-16 15:42 [gentoo-dev] [RFC] Portability eclass Diego 'Flameeyes' Pettenò
2005-09-16 15:59 ` Mike Frysinger
2005-09-16 16:16 ` Martin Schlemmer
@ 2005-09-17 13:01 ` Diego 'Flameeyes' Pettenò
2 siblings, 0 replies; 11+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2005-09-17 13:01 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 986 bytes --]
On Friday 16 September 2005 17:42, Diego 'Flameeyes' Pettenò wrote:
> If we'll find other functions needed for portability's sake, they'll
> probably going to be there, too.
Dropped the symcmd function, cleaned up the treecopy function (Martin, take a
look at cp --parent, what treecopy does is just the same, if someone calls it
with ${S}, it WILL create ${S} inside ${D}, but that's what they are asking
for using it), added an eseq option, that would be used on enewuser and
elsewhere were seq is used.
This does not use ${USERLAND} to find out which command to use, as Darwin can
have seq installed (and actually someone can have userland-gnu merged on *BSD
and path changed), so it just look if it's able to find seq, otherwise use
jot.
If this is ok, I'll commit this tonight changing enewuser according to use it.
--
Diego "Flameeyes" Pettenò
Gentoo Developer - http://dev.gentoo.org/~flameeyes/
(Gentoo/FreeBSD, Video, Gentoo/AMD64, Sound, PAM)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2005-09-17 13:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-16 15:42 [gentoo-dev] [RFC] Portability eclass Diego 'Flameeyes' Pettenò
2005-09-16 15:59 ` Mike Frysinger
2005-09-16 16:33 ` Diego 'Flameeyes' Pettenò
2005-09-16 17:21 ` Chris Gianelloni
2005-09-16 17:28 ` Mike Frysinger
2005-09-16 17:36 ` Diego 'Flameeyes' Pettenò
2005-09-16 17:59 ` warnera6
2005-09-16 19:12 ` Mike Frysinger
2005-09-16 16:16 ` Martin Schlemmer
2005-09-16 17:07 ` Diego 'Flameeyes' Pettenò
2005-09-17 13:01 ` Diego 'Flameeyes' Pettenò
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox