Shawn Walker wrote:
On 08/26/10 09:06 PM, Darren Reed wrote:
In trying to create a my own package on a private depot, I've followed
the instructions in the man page for pkgsend which start with:
$ eval `pkgsend open [email protected]`
ok, it was obvious that wasn't going to work because there was nothing
in that statement that told pkgsend how to connect to my depotd (and in
trying it, no it didn't work), so I added the complimentary "-s
http://server:port" and then ran into this error:
pkgsend: 'open' failed for transaction ID 'None': http protocol error:
code: 400 reason: Bad Request
URL: ...
Additional Details:
The specified FMRI, '[email protected]', must include the publisher
prefix as the repository contains package data for more than one
publisher or a default publisher has not been defined.
What is the "publisher prefix"?
That's explained in the pkg(5) man page.
I'm even more confused by the "Additional Details" as the repository
contains no package data (I've only just started pkg.depotd -d
/directory -p port) to a previously empty /directory.
In order to address the "default publisher" bit of the message above, I
tried starting pkg.depotd with a small configuration file (pkg.depot
--cfg /tmp/depot.cfg):
[pkg]
port = 8081
inst_root = /tmp/depot
default_publisher = darrenr
but that did not cause the above error to stop being produced.
And it wouldn't; that's depot configuration, not repository configuration.
To me the way you say that makes it seem like depots and repositories
are completely separate entities. Is that the meaning you intended to
convey?
To look at the first paragraph of the DESCRIPTION for pkg.depotd, I have:
pkg.depotd is the depot server for the image packaging system.
It provides clients network access to the data contained within a
package repository. pkg(1), the retrieval client, makes requests
to the depot server for catalogs and packages. pkgsend(1), the
publication client, sends new versions of packages to the depot
server. pkgrepo(1) provides creation, management, and summary
functionality for repositories. pkg.depotd is typically run as
a service on the system. Package and software developers may
wish to run private copies for various testing purposes.
So quite clearly the depot server is providing access for clients to
repositories and as such, why wouldn't you configure the repository
through it?
Why do I need to configure a repository independly of a depot?
Why can't I configure both at the same time, through the same
configuration file?
If my depot only ever has one repository, surely this would seem sensible?
Furthermore, why should it be possible for the default publisher in a
repository be allowed to be different from that of a depot?
Can there be multiple repositories in a single depot?
I'll add that I never created a repository myself, I just started
pkg.depotd which I assume used some set of defaults to create the
repository in which to put things sent to it from pkgsend.
It seems to me that if I start pkg.depotd with a configuration that
supplies a default publisher and that pkg.depotd has to create a new
repository in which to put new packages then it makes sense (to me at
least) for any configuration options that also apply to the repository
to be inherited from the depot server. Does that seem logical or not?
If you want to set the default publisher for the *repository*, you
would do this:
$ pkgrepo -s path_or_uri_to_repo set publisher/prefix=darrenr
...and yes, the pkgrepo man page needs to be expanded; there's already
an RFE for that.
And there's no reference to pkgrepo from pkgsend's man page.
With an additional bit of playing, it seems like what's required is
this:
pkgsend -s http://server:port open pkg://darrenr/[email protected]
and that made sense. What I was looking for was how to specify only the
publisher (as part of the FMRI) when what I needed to do was give it a
full FMRI. If I try to just add the publisher
(darrenr/[email protected]), it fails so the error message should
mention that I need to provide a full pkg FMRI rather than just the
"publisher prefix".
Again, see pkg(5) for an explanation of package FMRIs, etc.
More information that I could easily see as being useful on the pkgsend
man page is:
* that without using "-s ..." it requires a local pkg.depotd to be
running on port 10000 as provided by svc:/application/pkg/server.
That's already in the man page; see the notes under the -s option.
Yes, but there is no explanation of the significance of
"http://localhost:10000". It might be better reading if the last
sentence of that paragraph said:
"The default value is http://localhost:10000/, which corresponds to the
default settings used by svc:/application/pkg/server."
Given that the default values of pkgsend have been chosen to match the
default values used by pkg/server, if I use svcprop to change how
pkg/server starts, and there is only one instance of pkg/server
configured, it would seem logical to me for pkgsend to continue to
automatically contact the local pkg.depotd through the properties for
pkg/server. That is unless there is some other way to set the default
depot server for pkgsend in a system wide manner?
I can appreciate the engineering purity and desire to keep things
separate but at the same time, it is all part of the same toolset and
thus a change in one corner should be acknowledged and used throughout
the entire toolset, rather than breaking it or making it more difficult
to use.
Note that again the man page uses "repository" in conjunction with the
URI used to contact the "depot" server.
* if it is possible to just add the publisher prefix without giving a
full fmri, please mention how that should be done as none of the CLI
options or examples illustrate this
Feel free to file RFEs, but I would note that the pkg(5) man page
explains what a publisher prefix is and what FMRIs are and that
pkgsend(1) says to see also pkg(5).
I'd rather not duplicate the material in pkg(5) in other man pages.
The pkg(5) man page does not give an example of an FMRI that contains
only the publisher's prefix plus the name of the package. In fact that
man page has only one FMRI (a fully qualified one) as an example, which
I do not think is enough.
For example, would "opensolaris.org/[email protected]" be accepted by
pkgsend, with it using "opensolaris.org" as the publisher prefix?
If I give pkgsend an FMRI that is composed as "foo/[email protected]", why does
pkgsend not treat "foo" as the publisher?
What about if I used "foo//[email protected]"?
What about if I want to name a package "sun.com/rpc"?
Will pkgsend assume that "sun.com" is the name of a publisher even if it
isn't intended to be?
Or do I need to call it "pkg://opensolaris.org/sun.com/rpc"?
How does pkgsend, or any other tool that uses FMRIs, know what is part
of the name and what is part of the publisher when a fully qualified
FMRI is not present and the supplied FMRI has at least one '/' in it?
I'm well aware of the recommendation to use domain names as the
publisher, but the text says just that - a recommendation. If it is
going to allow text that is not in the form of a domain name then simple
names should also work, meaning "a/[email protected]" should be a valid
specification of a package name and publisher, correct?
Darren
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss