On 08/27/10 12:00 PM, Darren Reed wrote:
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?
It says *network* access; the pkgsend man page quite clearly states that
you can access a repository directly using file:// URIs.
Why do I need to configure a repository independly of a depot?
Because a repository can be used independently of a depot server. The
depot server provides *network* access to a repository.
Why can't I configure both at the same time, through the same
configuration file?
Because they can be used independently.
If my depot only ever has one repository, surely this would seem sensible?
No, see above.
Furthermore, why should it be possible for the default publisher in a
repository be allowed to be different from that of a depot?
A depot can't have a default publisher.
Can there be multiple repositories in a single depot?
A depot can't have things "in it"; a depot just serves repositories. If
your question is whether a depot can serve multiple repositories, that's
something still under consideration.
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?
No; see above.
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.
That's a bug.
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."
No, it doesn't correspond to the default settings for pkg/server. The
default setting for pkg/server is actually port 80; not 10000.
The 10000 default is a leftover from early developer use at the
beginning of the project. I'd rather remove the default logic entirely
if it's going to cause this much confusion.
...
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.
Because a depot server provides *network* access to a repository. It is
not the only means through which to use one.
* 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.
Yes, it does give an example of an FMRI that contains only the
publisher's prefix plus the name of the package. That *is* a "full FMRI"
(whatever that means).
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?
Because '/' is a valid character in a package name.
For example:
package/pkg
Which is why to specify a publisher, you must include the scheme:
pkg://<publisher>/<package_name>@<version>
...
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?
Please file an RFE with suggestions as to how you would like to see man
page text for pkg(5) expanded.
-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss