Re: How to add dependencies that exist in another repository

2010-11-11 Thread Goswin von Brederlow
Ben Hutchings b...@decadent.org.uk writes:

 On Wed, Nov 10, 2010 at 04:50:49PM -0200, Henrique de Moraes Holschuh wrote:
 On Wed, 10 Nov 2010, Bob Proulx wrote:
  The packages for Debian there add a source.list.d file as you
  describe.  (And it really confused me until I figured out what it had
 
 Which begs the question: why do we even have source.list.d/ suport in
 the first place (or, if it is really useful to other users of apt, why
 is it enabled by default) ?
  
 - An organisation/site with a private repository or mirror can provide the
   configuration for this as a package or preinstalled file without
   interfering with per-machine configuration
 - Non-Debian packages (such as Chrome) can integrate with the usual update
   mechanisms rather than reinventing this wheel
 - Mobile users can enable and disable sources in different locations just by
   renaming the files (this is now less important thanks to cdn.debian.net,
   though that is not yet an official service)

 Ben.

To give a users use case:

I have a package my-apt-config that installs the gpg key for the local
repository, a /etc/apt/sources.list.d/ file, /etc/apt/apt.conf.d/ file
and /etc/apt/preferences.d/ file with all the right settings for me.

With one simple package I configure apt to my needs on a new system and
any changes are easily distributed through the package via
update/upgarde. Doing that with include directives would be way harder
and violate policy (don't edit other packages conffiles).

MfG
Goswin


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87y690yzh5@frosties.localnet



Re: How to add dependencies that exist in another repository

2010-11-11 Thread Andreas Tille
On Thu, Nov 11, 2010 at 10:35:34AM +0100, Goswin von Brederlow wrote:
 I have a package my-apt-config that installs the gpg key for the local
 repository, a /etc/apt/sources.list.d/ file, /etc/apt/apt.conf.d/ file
 and /etc/apt/preferences.d/ file with all the right settings for me.

I completely agree but did not managed to get /etc/apt/preferences.d/
working as expected.  Did I missed a piece of documentation or can you
provide any working example.

Kind regards

  Andreas.

-- 
http://fam-tille.de


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2010110330.ga24...@an3as.eu



Re: How to add dependencies that exist in another repository

2010-11-11 Thread Bastian Blank
On Thu, Nov 11, 2010 at 12:03:30PM +0100, Andreas Tille wrote:
 On Thu, Nov 11, 2010 at 10:35:34AM +0100, Goswin von Brederlow wrote:
  I have a package my-apt-config that installs the gpg key for the local
  repository, a /etc/apt/sources.list.d/ file, /etc/apt/apt.conf.d/ file
  and /etc/apt/preferences.d/ file with all the right settings for me.
 I completely agree but did not managed to get /etc/apt/preferences.d/
 working as expected.  Did I missed a piece of documentation or can you
 provide any working example.

Your apt is too old. Upgrade to Squeeze.

Bastian

-- 
There is an order of things in this universe.
-- Apollo, Who Mourns for Adonais? stardate 3468.1


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2010115703.gb22...@wavehammer.waldi.eu.org



Re: How to add dependencies that exist in another repository

2010-11-11 Thread Mike Hommey
On Thu, Nov 11, 2010 at 12:03:30PM +0100, Andreas Tille wrote:
 On Thu, Nov 11, 2010 at 10:35:34AM +0100, Goswin von Brederlow wrote:
  I have a package my-apt-config that installs the gpg key for the local
  repository, a /etc/apt/sources.list.d/ file, /etc/apt/apt.conf.d/ file
  and /etc/apt/preferences.d/ file with all the right settings for me.
 
 I completely agree but did not managed to get /etc/apt/preferences.d/
 working as expected.  Did I missed a piece of documentation or can you
 provide any working example.

From man apt_preferences:
  Note that the files in the /etc/apt/preferences.d directory are parsed
  in alphanumeric ascending order and need to obey the following naming
  convention: The files have no or pref as filename extension and which
  only contain alphanumeric, hyphen (-), underscore (_) and period (.)
  characters - otherwise they will be silently ignored.

Cheers,

Mike


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2010121449.ga9...@glandium.org



Re: How to add dependencies that exist in another repository

2010-11-11 Thread Ian Jackson
Henrique de Moraes Holschuh writes (Re: How to add dependencies that exist in 
another repository):
 On Wed, 10 Nov 2010, Bob Proulx wrote:
  The packages for Debian there add a source.list.d file as you
  describe.  (And it really confused me until I figured out what it had
 
 Which begs the question: why do we even have source.list.d/ suport in
 the first place (or, if it is really useful to other users of apt, why
 is it enabled by default) ?

People are going to do this hideous thing anyway.  At least this way
they don't have to untraceably edit the actual master sources.list.

Ian.


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/19675.57832.843600.525...@chiark.greenend.org.uk



Re: How to add dependencies that exist in another repository

2010-11-11 Thread Andreas Tille
Hi,

to answer the previous question: Yes, I'm using Squeeze.

 From man apt_preferences:
   Note that the files in the /etc/apt/preferences.d directory are parsed
   in alphanumeric ascending order and need to obey the following naming
   convention: The files have no or pref as filename extension and which
   only contain alphanumeric, hyphen (-), underscore (_) and period (.)
   characters - otherwise they will be silently ignored.

Well, this defines a *sequence* of these files but what about the
*content*.  In /etc/apt/preferences the sequence of paragraphs
does not matter.  Just the Pin-Priority value has relevance.  So
again, some working example would help understanding things.

Kind regards

  Andreas.

-- 
http://fam-tille.de


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2010133639.gb28...@an3as.eu



Re: How to add dependencies that exist in another repository

2010-11-11 Thread David Kalnischkies
On Thu, Nov 11, 2010 at 14:36, Andreas Tille andr...@an3as.eu wrote:
 to answer the previous question: Yes, I'm using Squeeze.

 From man apt_preferences:
   Note that the files in the /etc/apt/preferences.d directory are parsed
   in alphanumeric ascending order and need to obey the following naming
   convention: The files have no or pref as filename extension and which
   only contain alphanumeric, hyphen (-), underscore (_) and period (.)
   characters - otherwise they will be silently ignored.

 Well, this defines a *sequence* of these files but what about the
 *content*.  In /etc/apt/preferences the sequence of paragraphs
 does not matter.  Just the Pin-Priority value has relevance.  So

Wrong. The manpage says:
 If any specific-form records match an available package version then the
 first such record determines the priority of the package version.
 Failing that, if any general-form records match an available package version
 then the first such record determines the priority of the package version.

So its important in which sequence the paragraphs are written (and read).

The syntax of the fragment files is (obviously) the same as the one for
the main file, so i don't see what an example will help, but here we go:

/etc/apt/preferences:
Package: *
Pin: release experimental
Pin-Priority: -1

Package: *
Pin: release o=Debian
Pin-Priority: 400


/etc/apt/preferences.d/gcc-45.pref:
Package: gcc cpp-4.5 g++-4.5 gcc-4.5
Pin: release experimental
Pin-Priority: 500

$ apt-cache policy gcc
gcc:
  Installiert: 4:4.4.5-1
  Kandidat:4:4.5.1-1exp1
  Paket-Pinning: 4:4.5.1-1exp1
  Versionstabelle:
 4:4.5.1-1exp1 500
 -1 http://ftp.de.debian.org/debian/ experimental/main i386 Packages
 *** 4:4.4.5-1 500
400 http://ftp.de.debian.org/debian/ sid/main i386 Packages
400 http://ftp.de.debian.org/debian/ testing/main i386 Packages
100 /var/lib/dpkg/status
 4:4.3.2-2 500
400 http://ftp.de.debian.org/debian/ lenny/main i386 Packages

In that example you can also see why the sequence is important - swap
the stanzas in the preferences file and all archives which match o=Debian
will be pinned to 400 - which includes experimental!

But if that doesn't work i guess a bug report is better suited
than proceeding in hijacking a thread…


Best regards

David Kalnischkies

P.S.: Yes, i know that the given gcc pinning is not enough,
my real stanza is longer - and the preferences file is a pure fiction…


--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/aanlktingx9yjpuolmt_nv51phs8s+65ey2akh_kg4...@mail.gmail.com



Re: How to add dependencies that exist in another repository

2010-11-11 Thread Goswin von Brederlow
Ian Jackson ijack...@chiark.greenend.org.uk writes:

 Henrique de Moraes Holschuh writes (Re: How to add dependencies that exist 
 in another repository):
 On Wed, 10 Nov 2010, Bob Proulx wrote:
  The packages for Debian there add a source.list.d file as you
  describe.  (And it really confused me until I figured out what it had
 
 Which begs the question: why do we even have source.list.d/ suport in
 the first place (or, if it is really useful to other users of apt, why
 is it enabled by default) ?

 People are going to do this hideous thing anyway.  At least this way
 they don't have to untraceably edit the actual master sources.list.

 Ian.

And if you don't want it then set

  Dir::Etc::sourceparts /dev/null;

or similar.

.oO( Unless evil software overrides that again in /etc/apt/apt.conf.d/ :)

MfG
Goswin


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87pqub7dbx@frosties.localnet



Re: How to add dependencies that exist in another repository

2010-11-11 Thread Goswin von Brederlow
Andreas Tille andr...@an3as.eu writes:

 On Thu, Nov 11, 2010 at 10:35:34AM +0100, Goswin von Brederlow wrote:
 I have a package my-apt-config that installs the gpg key for the local
 repository, a /etc/apt/sources.list.d/ file, /etc/apt/apt.conf.d/ file
 and /etc/apt/preferences.d/ file with all the right settings for me.

 I completely agree but did not managed to get /etc/apt/preferences.d/
 working as expected.  Did I missed a piece of documentation or can you
 provide any working example.

 Kind regards

   Andreas.

I just placed a file ther for pining like this:

m...@frosties:~% cat /etc/apt/preferences.d/pin
Package: *
Pin: release v=666.0,o=Debian,a=unstable,n=sid,l=Debian,c=main
Pin-Priority: 666

m...@frosties:~% apt-cache policy
Package files:
 100 /var/lib/dpkg/status
 release a=now
 666 http://chocos/debian/ sid/main amd64 Packages
 release v=666.0,o=Debian,a=unstable,n=sid,l=Debian,c=main
 origin chocos
Pinned packages:


MfG
Goswin


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87tyjn7dlp@frosties.localnet



Re: How to add dependencies that exist in another repository

2010-11-10 Thread Goswin von Brederlow
Reza Alemi alemi.r...@gmail.com writes:

 Hello all,
 I don't seem to be able to find my answer searching the net, so please
 forgive me if my question is too trivial.

 I am packaging a product which is dependent on sun-java6-sdk (upstream
 says it won't work with openjdk). in ubuntu, that package is in the
 partner repository which I can get user consent to add, using debconf.

 in shell, I would normally do an add-apt-repository for the repository
 and then an apt-get update before I can install the sun-java6-sdk
 package.

 my question is, can I do something like that in my own install scripts?
 can I run add-apt-repository and apt-get update while the package is
 being installed? won't it break if the package is installed with
 aptitude or dpkg an on debian instead of ubunut?  

 Thank you,
 Rex

No. It will not work:

1) While you install apt holds the lock so you can't just call apt-get
update.

2) The user might not be using apt. There are alternatives.

3) Your package depends on sun-java6-sdk. It won't install without
the repository being present. So your script is way to late to add it.

4) Don't just add repositories to the users config.


As for working on Ubuntu but not debian you can detect that and only
call the ubuntu tools when being installed on ubuntu.

MfG
Goswin


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87oc9xiebu@frosties.localnet



Re: How to add dependencies that exist in another repository

2010-11-10 Thread Bob Proulx
PJ Weisberg wrote:
 Ben Hutchings wrote:
  Don't even think of doing this in a package uploaded to Debian.
 
 Right.  I mentioned it mostly for completness, since it's the answer
 to the question that was actually asked.  I almost added, I don't
 think any Debian packages actually do this, but I've never looked at
 most of the packages in Debian. :-)

Not part of Debian but packaged for it is the KDE 3.x Trinity project.

  http://trinity.pearsoncomputing.net/

The packages for Debian there add a source.list.d file as you
describe.  (And it really confused me until I figured out what it had
done.  And once I realized that it did that I resolved not to use such
packages.  If they would do that then what other nasty business would
they include that I didn't find?)

Bob


signature.asc
Description: Digital signature


Re: How to add dependencies that exist in another repository

2010-11-10 Thread Henrique de Moraes Holschuh
On Wed, 10 Nov 2010, Bob Proulx wrote:
 The packages for Debian there add a source.list.d file as you
 describe.  (And it really confused me until I figured out what it had

Which begs the question: why do we even have source.list.d/ suport in
the first place (or, if it is really useful to other users of apt, why
is it enabled by default) ?

-- 
  One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie. -- The Silicon Valley Tarot
  Henrique Holschuh


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101110185048.ga7...@khazad-dum.debian.net



Re: How to add dependencies that exist in another repository

2010-11-10 Thread Henrique de Moraes Holschuh
On Wed, 10 Nov 2010, Henrique de Moraes Holschuh wrote:
 On Wed, 10 Nov 2010, Bob Proulx wrote:
  The packages for Debian there add a source.list.d file as you
  describe.  (And it really confused me until I figured out what it had
 
 Which begs the question: why do we even have source.list.d/ suport in
 the first place (or, if it is really useful to other users of apt, why
 is it enabled by default) ?

Answering my own question: it was done in response to a valid request for an
include directive for sources.list.

See #66325, which asks for, and provides reasonable reasons for a include
directive... but people got sources.list.d/ instead, which is a lot more
difficult to keep wraps on.

-- 
  One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie. -- The Silicon Valley Tarot
  Henrique Holschuh


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101110185734.gb7...@khazad-dum.debian.net



Re: How to add dependencies that exist in another repository

2010-11-10 Thread David Kalnischkies
On Wed, Nov 10, 2010 at 19:57, Henrique de Moraes Holschuh
h...@debian.org wrote:
 On Wed, 10 Nov 2010, Henrique de Moraes Holschuh wrote:
 On Wed, 10 Nov 2010, Bob Proulx wrote:
  The packages for Debian there add a source.list.d file as you
  describe.  (And it really confused me until I figured out what it had

 Which begs the question: why do we even have source.list.d/ suport in
 the first place (or, if it is really useful to other users of apt, why
 is it enabled by default) ?

 Answering my own question: it was done in response to a valid request for an
 include directive for sources.list.

 See #66325, which asks for, and provides reasonable reasons for a include
 directive... but people got sources.list.d/ instead, which is a lot more
 difficult to keep wraps on.

Working with files is easier for a user (or an application working on request
for the user) to handle than modifying a single file to include/remove
specific sources entries - at least in my eyes.

And in comparison: what about e.g. /etc/ssl/certs ?


If you want to inject something, you can do it both ways - and after all
I can do a lot more in maintainer scripts than adding a sources.list entry,
so mysteriously added sources.list entries are not a disease
(or a misfeature of APT to allow it) but a symptom of the widespread
disease of trusting random packages from an unknown sources…


Best regards

David Kalnischkies (with his APT hat speaking)


--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/aanlktik-=gtivtwfqc3dunpv3hrxsd-k-b52hsunr...@mail.gmail.com



Re: How to add dependencies that exist in another repository

2010-11-10 Thread Ben Hutchings
On Wed, Nov 10, 2010 at 04:50:49PM -0200, Henrique de Moraes Holschuh wrote:
 On Wed, 10 Nov 2010, Bob Proulx wrote:
  The packages for Debian there add a source.list.d file as you
  describe.  (And it really confused me until I figured out what it had
 
 Which begs the question: why do we even have source.list.d/ suport in
 the first place (or, if it is really useful to other users of apt, why
 is it enabled by default) ?
 
- An organisation/site with a private repository or mirror can provide the
  configuration for this as a package or preinstalled file without
  interfering with per-machine configuration
- Non-Debian packages (such as Chrome) can integrate with the usual update
  mechanisms rather than reinventing this wheel
- Mobile users can enable and disable sources in different locations just by
  renaming the files (this is now less important thanks to cdn.debian.net,
  though that is not yet an official service)

Ben.

-- 
Ben Hutchings
We get into the habit of living before acquiring the habit of thinking.
  - Albert Camus


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101110220436.gg31...@decadent.org.uk



Re: How to add dependencies that exist in another repository

2010-11-09 Thread PJ Weisberg
 On Mon, 2010-11-08 at 09:14 -0800, Reza Alemi wrote:
 Hello all,
 I don't seem to be able to find my answer searching the net, so please
 forgive me if my question is too trivial.

 I am packaging a product which is dependent on sun-java6-sdk (upstream
 says it won't work with openjdk). in ubuntu, that package is in the
 partner repository which I can get user consent to add, using debconf.

 in shell, I would normally do an add-apt-repository for the repository
 and then an apt-get update before I can install the sun-java6-sdk
 package.

 my question is, can I do something like that in my own install scripts?
 can I run add-apt-repository and apt-get update while the package is
 being installed? won't it break if the package is installed with
 aptitude or dpkg an on debian instead of ubunut?

 Thank you,
 Rex

The bullet-points:

- sun-java6-sdk is in non-free, so this is a non-issue for you if your
package is in contrib (since no one enables contrib but not non-free).
- Your package can't be in main, because packages in main aren't
allowed to depend on any packages that aren't in main.
- The package manager won't even try to install your package or run
any of your scripts if you depend on anything that isn't *already* in
a repository that's enabled.
- It *is* possible to add repositories when you install your package.
Google does this in the *.deb files it distributes so that the package
manager can find newer versions.  If you have a reason to do this
(which you almost certainly don't), you should add some file to
/etc/apt/sources.list.d/, which you can delete when your package is
purged from the system.  Don't do anything that would make it
difficult to know whether the repository was added by your package,
another package, or the user.


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/aanlktindyth99tsvxl-johuwnzxztf=znsiv0clpz...@mail.gmail.com



Re: How to add dependencies that exist in another repository

2010-11-09 Thread Peter Palfrader
On Tue, 09 Nov 2010, PJ Weisberg wrote:

 - It *is* possible to add repositories when you install your package.

I'm pretty sure we probably wouldn't want any package in Debian do that
tho.
-- 
   |  .''`.  ** Debian GNU/Linux **
  Peter Palfrader  | : :' :  The  universal
 http://www.palfrader.org/ | `. `'  Operating System
   |   `-http://www.debian.org/


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20101109234228.gc10...@anguilla.noreply.org



Re: How to add dependencies that exist in another repository

2010-11-09 Thread Ben Hutchings
On Tue, 2010-11-09 at 14:48 -0800, PJ Weisberg wrote:
[...]
 - It *is* possible to add repositories when you install your package.
 Google does this in the *.deb files it distributes so that the package
 manager can find newer versions.  If you have a reason to do this
 (which you almost certainly don't), you should add some file to
 /etc/apt/sources.list.d/, which you can delete when your package is
 purged from the system.  Don't do anything that would make it
 difficult to know whether the repository was added by your package,
 another package, or the user.

Don't even think of doing this in a package uploaded to Debian.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.


signature.asc
Description: This is a digitally signed message part


Re: How to add dependencies that exist in another repository

2010-11-09 Thread PJ Weisberg
On 11/9/10, Ben Hutchings b...@decadent.org.uk wrote:

 Don't even think of doing this in a package uploaded to Debian.


Right.  I mentioned it mostly for completness, since it's the answer
to the question that was actually asked.  I almost added, I don't
think any Debian packages actually do this, but I've never looked at
most of the packages in Debian.
  :-)

-PJ


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/aanlktimuqkw1cedca=fyprzyemgxzdjkbkeh2zsay...@mail.gmail.com



Re: How to add dependencies that exist in another repository

2010-11-08 Thread Chris Baines
Hi Rex,

In my opinion a more appropriate place for you question would be the
Debian mentors list. This list is more meant for Debian development. I
have cc'ed it as such.

Why do you need to do anything above the normal for this. The package
sun-java6-jdk exists in the Debian non-free repository. Just add the
dependency as normal. You package will be restricted to the contrib
section though (if it is free, if not non-free) as it depends on a
non-free package. 

Chris

On Mon, 2010-11-08 at 09:14 -0800, Reza Alemi wrote:
 Hello all,
 I don't seem to be able to find my answer searching the net, so please
 forgive me if my question is too trivial.
 
 I am packaging a product which is dependent on sun-java6-sdk (upstream
 says it won't work with openjdk). in ubuntu, that package is in the
 partner repository which I can get user consent to add, using debconf.
 
 in shell, I would normally do an add-apt-repository for the repository
 and then an apt-get update before I can install the sun-java6-sdk
 package.
 
 my question is, can I do something like that in my own install scripts?
 can I run add-apt-repository and apt-get update while the package is
 being installed? won't it break if the package is installed with
 aptitude or dpkg an on debian instead of ubunut?  
 
 Thank you,
 Rex
 
 
 



signature.asc
Description: This is a digitally signed message part