[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bashims in debian/rules


On Fri, 7 Nov 1997, Ian Jackson wrote:

> Roman Hodek:
> > I think you misunderstood "cross compilation" in the original mail. It
> > meant compiling Debian packages on a non-Debian system, where sh isn't
> > bash.
> I don't think we should attempt to support `cross compilation' in this
> sense.

I think we should try it *because it is not so difficult*.

GNU packages may be built in *any* Unix system, and this is a good thing.
Use of #!/bin/sh in shell scripts is one of the GNU coding standards.

In this case, I fail to see how much more difficult is:

1) cp debian/{postinst,prerm} debian/tmp/DEBIAN


2) cd debian && cp postinst prerm tmp/DEBIAN

The work involved to change 1) into 2) is *very* small. The benefits of
the added portability is greater than this small work.

Of course, if we teach our new developers to write debian/rules files in a
POSIX way for newly created packages, the cost is zero.

Note that 2) is even shorter than 1)

> That way we end up importing a lot of braindamage over which we have no
> control, and can no longer fix bugs where they are but have to work
> around them.

I don't think so. Please give me a *real* examples which apply to *this*
curly braces bashism (i.e. don't just create an irreal debian/rules
using curly braces that nobody have ever written yet).

Are you really calling "cd debian && cp postinst prerm tmp/DEBIAN"

> The use of { } makes the rules files clearer and
> avoids duplication of information (which is always a bad idea, because
> the two copies can end up different).

So, use of { } would be justified if it were the only way to avoid
duplicate information, but it is not.

In this example, if you "mv" first to "debian" directory, the duplication
of information disappears.

In fact you are duplicating information, see what could happen if you
make a mistake:

cp debian/{postinst,prerm} debn/tmp/DEBIAN

In your example "debian" appears *twice*. If your theory was true ("the
two copies can end up different"), this would be much more likely to
happen than the alternate method not using curly braces.

Are we going to be non POSIX (which is one of the Linux goals) just
because some people likes to write debian/rules in an only slightly more
easy way?

In any case, do you really think that the possible "duplication" that "may
end up being different" will be missed easily, with the great number of
people compiling Debian packages for several architectures? We have
already a lot of "redundancy" in package building that would make this
type of mistakes almost impossible to happen (or really easy to find).

[ You have not uploaded a .deb package for a long time, have you?
  Every package is rebuilt a lot of times by different people. They
  will always tell you if you have a "wrong" duplication ]

Version: 2.6.3ia
Charset: latin1


TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: