Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 317551 - app-admin/haskell-updater should respect choice of app-admin/eselect-package-manager
Summary: app-admin/haskell-updater should respect choice of app-admin/eselect-package-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-27 23:16 UTC by Maciej Piechotka
Modified: 2010-08-02 13:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Piechotka 2010-04-27 23:16:41 UTC
app-admin/eselect-package-manager allows to select the package manager. It sets the PACKAGE_MANAGER variable.

It should be chosen as default by haskell-updater if not overriden by parameter.
Comment 1 Panagiotis Christopoulos (RETIRED) gentoo-dev 2010-05-03 13:29:00 UTC
It does

RDEPEND="|| ( >=sys-apps/portage-2.1.6
              sys-apps/pkgcore
              sys-apps/paludis )"

What's wrong with that?
Comment 2 Maciej Piechotka 2010-05-03 13:38:25 UTC
(In reply to comment #1)
> It does
> 
> RDEPEND="|| ( >=sys-apps/portage-2.1.6
>               sys-apps/pkgcore
>               sys-apps/paludis )"
> 
> What's wrong with that?
> 

It does at runtime. However it should consider $PACKAGE_MANAGER variable at runtime. For example:

% PACKAGE_MANAGER=paludis haskell-updater -c

Should rebuild packages using paludis not portage (as does for example python updater).

% PACKAGE_MANAGER="" haskell-updater -c # Portage still should be default

------------------
It allows users of alternative package managers to write
% eselect package-manager set paludis
% env-update
% source /etc/profile

And later just run
% haskell-updater -c
Instead of
% haskell-updater -c -P paludis
or
% haskell-updater -c # Oh! I forgot once again this parameter - was it -P or -p?
Comment 3 Maciej Piechotka 2010-05-03 13:42:09 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > It does
> > 
> > RDEPEND="|| ( >=sys-apps/portage-2.1.6
> >               sys-apps/pkgcore
> >               sys-apps/paludis )"
> > 
> > What's wrong with that?
> > 
> 
> It does at runtime. 

I meant it does *not* at runtime of course.
Comment 4 Ivan 2010-05-04 00:13:01 UTC
Well, it doesn't for several reasons:

1) I have never heard of it before.

2) I can't find any documentation on it to know how it works.  As such, I see no reason why it should.

3) The various other -updater scripts run in bash; haskell-updater doesn't.  This means it may not be possible to test for the variable.

4) Eww, date-based versioning! :p
Comment 5 Maciej Piechotka 2010-05-04 00:41:51 UTC
(In reply to comment #4)
> Well, it doesn't for several reasons:
> 
> 1) I have never heard of it before.
> 
> 2) I can't find any documentation on it to know how it works.  As such, I see
> no reason why it should.
> 

It modifies /etc/env.d/50package-manager:
% cat /etc/env.d/50package-manager
# Configuration file for eselect
# This file has been automatically generated.
PACKAGE_MANAGER="paludis"

Which is read by env-update so the variable is exported everywhere

> 3) The various other -updater scripts run in bash; haskell-updater doesn't. 
> This means it may not be possible to test for the variable.
> 

IIRC it is Haskell so:
http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/System-Environment.html#v%3AgetEnv
http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/System-Environment.html#v%3AgetEnvironment


> 4) Eww, date-based versioning! :p
> 

It is sufficient if haskell-update would test the veriable - it do not need to depened on it.
Comment 6 Ivan 2010-05-04 00:53:57 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > 2) I can't find any documentation on it to know how it works.  As such, I see
> > no reason why it should.
> > 
> 
> It modifies /etc/env.d/50package-manager:
> % cat /etc/env.d/50package-manager
> # Configuration file for eselect
> # This file has been automatically generated.
> PACKAGE_MANAGER="paludis"
> 
> Which is read by env-update so the variable is exported everywhere

That isn't documentation.

Don't forget: all this stuff might be available to some hidden site for Gentoo developers, but I maintain haskell-updater and I am not an official developer.  If this is the case (a hidden site), then it obviously isn't important enough for me to care about.

> > 3) The various other -updater scripts run in bash; haskell-updater doesn't. 
> > This means it may not be possible to test for the variable.
> 
> IIRC it is Haskell so:
> http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/System-Environment.html#v%3AgetEnv
> http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/System-Environment.html#v%3AgetEnvironment

Hmmm, forgot about those.
Comment 7 Maciej Piechotka 2010-05-04 01:18:45 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > 2) I can't find any documentation on it to know how it works.  As such, I see
> > > no reason why it should.
> > > 
> > 
> > It modifies /etc/env.d/50package-manager:
> > % cat /etc/env.d/50package-manager
> > # Configuration file for eselect
> > # This file has been automatically generated.
> > PACKAGE_MANAGER="paludis"
> > 
> > Which is read by env-update so the variable is exported everywhere
> 
> That isn't documentation.
> 
> Don't forget: all this stuff might be available to some hidden site for Gentoo
> developers, but I maintain haskell-updater and I am not an official developer. 
> If this is the case (a hidden site), then it obviously isn't important enough
> for me to care about.
> 

I'm not sure if inline documentation counts:

% eselect package-manager
Usage: eselect package-manager <action> <options>

Standard actions:
  help                      Display help text
  usage                     Display usage information
  version                   Display version information

Extra actions:
  list                      List available targets for the PACKAGE_MANAGER
                            variable
  set <target>              Set the PACKAGE_MANAGER variable in profile
    target                    Target name or number (from 'list' action)
  show                      Show value of the PACKAGE_MANAGER variable in
                            profile
  update                    Update the PACKAGE_MANAGER variable if it is unset
                            or invalid

Comment 8 Ivan 2010-05-07 12:22:11 UTC
Can you please get the latest version from the darcs repository and test this?
If you have dev-haskell/cabal-install installed, then it's just a matter of:

darcs get http://code.haskell.org/gentoo/haskell-updater/
cd haskell-updater
cabal configure
cabal build
dist/build/haskell-updater/haskell-updater

(this way it doesn't get installed).

Not only does it use the value of PACKAGE_MANAGER if it exists, it now also states which package manager it is using.
Comment 9 Maciej Piechotka 2010-05-11 14:04:46 UTC
(In reply to comment #8)
> Can you please get the latest version from the darcs repository and test this?
> If you have dev-haskell/cabal-install installed, then it's just a matter of:
> 
> darcs get http://code.haskell.org/gentoo/haskell-updater/
> cd haskell-updater
> cabal configure
> cabal build
> dist/build/haskell-updater/haskell-updater
> 

Sorry for the delay. I'll test it today.
> (this way it doesn't get installed).
> 
> Not only does it use the value of PACKAGE_MANAGER if it exists, it now also
> states which package manager it is using.
> 
Comment 10 Maciej Piechotka 2010-05-11 22:36:28 UTC
(In reply to comment #8)
> Can you please get the latest version from the darcs repository and test this?
> If you have dev-haskell/cabal-install installed, then it's just a matter of:
> 
> darcs get http://code.haskell.org/gentoo/haskell-updater/
> cd haskell-updater
> cabal configure
> cabal build
> dist/build/haskell-updater/haskell-updater
> 
> (this way it doesn't get installed).
> 
> Not only does it use the value of PACKAGE_MANAGER if it exists, it now also
> states which package manager it is using.
> 

  * Package manager: paludis
                                   ^^^^^

Works for me.