Debian Developers - [pryzbyj: maint scripts]

This is Interesting: Free IT Magazines  
Home > Archive > Debian Developers > August 2004 > [pryzbyj: maint scripts]





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [pryzbyj: maint scripts]
Justin Pryzby

2004-08-07, 2:47 am

Hi all,

-mentors didn't have much to say, so I'm trying here.

Thanks,
--
Justin
aptitude install iraf saods9 eclipse xpa sextractor x11iraf wcstools pyraf
http://www.justinpryzby.com/debian/

----- Forwarded message from pryzbyj -----

To: debian-mentors@lists.debian.org
Subject: maint scripts

Hi all,

As per policy, my unofficial package of IRAF now includes a PERL script
update-extern.pkg.pl which is installed in /usr/bin/. It will be used
by external IRAF packages, each of which need to update extern.pkg. Of
course, each also depends on IRAF. If memory serves, the script
shouldn't have the .pl extension; can someone remind me why? (I like it
because then vim color-highlights it).

This script takes two arguments: the first is "add|remove" and the
second is the name of the external pacakge. Both actually do "remove"
first, for idempotency.

I'm wondering how this should be implemented in the maintscripts. All
that _needs_ to happen is:

- run add for initial installation only
- run remove for removal

What I think I'd like to do is also run add on upgrades, in case my
script changes and I want to fix something.

Debian's maintscripts obviously allow for much more generality than I
need, so I'd appreciate it if someone could confirm that the following
makes sense:

preinst:
upgrade)
add
install)
add

postrm:
remove)
delete

I don't think its worth implementing error-unwind, because if my script
fails once, I see no reason why it won't fail again. So, all the other
arguments will fall into
*) exit 1;

Hamish Moffatt

2004-08-07, 2:47 am

On Fri, Aug 06, 2004 at 09:14:49PM -0400, Justin Pryzby wrote:
> As per policy, my unofficial package of IRAF now includes a PERL script
> update-extern.pkg.pl which is installed in /usr/bin/. It will be used
> by external IRAF packages, each of which need to update extern.pkg. Of
> course, each also depends on IRAF. If memory serves, the script
> shouldn't have the .pl extension; can someone remind me why? (I like it
> because then vim color-highlights it).


Because the user of your script doesn't care what language it's written
in. It's just a program. The OS doesn't care either, because it looks
for "#!/usr/bin/perl".

And BTW, VIM doesn't care either; it can work out that it's PERL without
the .pl extension.

Finally, should your script be in /usr/sbin instead if it's only going to be
called by package maintainer scripts? (Perhaps even /usr/lib?).


Hamish
--
Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Joey Hess

2004-08-07, 2:47 am

Justin Pryzby wrote:
> As per policy, my unofficial package of IRAF now includes a PERL script
> update-extern.pkg.pl which is installed in /usr/bin/. It will be used
> by external IRAF packages, each of which need to update extern.pkg. Of
> course, each also depends on IRAF. If memory serves, the script
> shouldn't have the .pl extension; can someone remind me why? (I like it
> because then vim color-highlights it).


Because you'd have to rename it if the implementation language changed.
Also because users should not need to know or care what the
implementation language is to use a program. Also because .pl is
annoying to type. It's fine if you call it .pl in the source package but
please do not include language extentions in programs installed into
PATH.

(vim can be made to highlight PERL programs based on file magic.)

--
see shy jo

Justin Pryzby

2004-08-07, 2:47 am

On Sat, Aug 07, 2004 at 12:40:50PM +1000, Hamish Moffatt wrote:
> On Fri, Aug 06, 2004 at 09:14:49PM -0400, Justin Pryzby wrote:
>
> Because the user of your script doesn't care what language it's written
> in. It's just a program. The OS doesn't care either, because it looks
> for "#!/usr/bin/perl".
>
> And BTW, VIM doesn't care either; it can work out that it's PERL without
> the .pl extension.

Mine doesn't work like that; am I missing an option?

> Finally, should your script be in /usr/sbin instead if it's only going tobe
> called by package maintainer scripts? (Perhaps even /usr/lib?).

Nope, /usr/bin/ is intentional; iraf has its own user, which is meant to
be used by the "IRAF administrator", in the case that its different from
the general system administrator. /usr/{lib,share}/iraf/ are
iraf:nogroup. The IRAF admin shouldn't have to specify /usr/sbin/.

Can someone comment on how user 'iraf' relates to Policy? I don't know
if package's users are actually supposed to be used like that; for now
its a debconf option.

Cheers,
--
Justin
aptitude install iraf saods9 eclipse xpa sextractor x11iraf wcstools pyraf
http://www.justinpryzby.com/debian/

Hamish Moffatt

2004-08-07, 2:47 am

On Fri, Aug 06, 2004 at 10:54:01PM -0400, Justin Pryzby wrote:
> On Sat, Aug 07, 2004 at 12:40:50PM +1000, Hamish Moffatt wrote:
> Mine doesn't work like that; am I missing an option?


Err. Mine seems to just do that. It won't do it with a brand new file,
only if you open an existing file. My .vimrc doesn't contain anything
special.

> Nope, /usr/bin/ is intentional; iraf has its own user, which is meant to
> be used by the "IRAF administrator", in the case that its different from
> the general system administrator. /usr/{lib,share}/iraf/ are
> iraf:nogroup. The IRAF admin shouldn't have to specify /usr/sbin/.


OK.

> Can someone comment on how user 'iraf' relates to Policy? I don't know
> if package's users are actually supposed to be used like that; for now
> its a debconf option.


I don't know, sorry.

Hamish
--
Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Colin Watson

2004-08-07, 5:51 pm

On Fri, Aug 06, 2004 at 10:54:01PM -0400, Justin Pryzby wrote:
> On Sat, Aug 07, 2004 at 12:40:50PM +1000, Hamish Moffatt wrote:
>
> Mine doesn't work like that; am I missing an option?


':filetype on'. You might like some of the other options in ':help
filetype' too.

Cheers,

--
Colin Watson [cjwatson@flatline.org.uk]


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Justin Pryzby

2004-08-07, 5:51 pm

On Sat, Aug 07, 2004 at 04:20:27PM +0100, Colin Watson wrote:
> On Fri, Aug 06, 2004 at 10:54:01PM -0400, Justin Pryzby wrote:
>
> ':filetype on'. You might like some of the other options in ':help
> filetype' too.

Er, yes. I actually put that in my ~/.vimrc (as well as in /etc) last
night, but it didn't work. vim detects filetype=virata.

Of course, if I force filetype=perl, it looks nice. I checked
/usr/bin/replay, and my script starts exactly the same.

Just so this isn't completely OT, can someone comment on my maint script
question?

Thanks,
--
Justin
aptitude install iraf saods9 eclipse xpa sextractor x11iraf wcstools pyraf
http://www.justinpryzby.com/debian/

References

[1] http://www.justinpryzby.com/iraf.no...date-extern.pkg

Adeodato Simó

2004-08-07, 5:51 pm

* Justin Pryzby [Sat, 07 Aug 2004 11:36:37 -0400]:

> Er, yes. I actually put that in my ~/.vimrc (as well as in /etc) last
> night, but it didn't work. vim detects filetype=virata.


> Of course, if I force filetype=perl, it looks nice. I checked
> /usr/bin/replay, and my script starts exactly the same.


[going on with the OT]

it's because of the .pkg extension:

$ fgrep .pkg /usr/share/vim/vim63/filetype.vim
au BufRead,BufNewFile *.hw,*.module,*.pkg setf virata

it takes precedence over the hash-bang line. you could use a
modeline...

--
Adeodato Simó
EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.
-- George Bernard Shaw


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Colin Watson

2004-08-07, 5:51 pm

On Sat, Aug 07, 2004 at 11:36:37AM -0400, Justin Pryzby wrote:
> On Sat, Aug 07, 2004 at 04:20:27PM +0100, Colin Watson wrote:
>
> Er, yes. I actually put that in my ~/.vimrc (as well as in /etc) last
> night, but it didn't work. vim detects filetype=virata.


That'll be the ".pkg".

" Virata Config Script File
au BufRead,BufNewFile *.hw,*.module,*.pkg setf virata

--
Colin Watson [cjwatson@flatline.org.uk]


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com