Using packager

I recently tried to use the packager. I created a
directory with a directory structure and a link from
usr/bin to the program I wanted in the package.

I answered all the questions, and in the end I got this
error message:

=======================================================
Sorting files into the required packages…
Error: Files exist within “/tmp/pkgrAAA986026”.
Clear the contents of this directory [Y/N]? y

Error sorting files (component entry already exists)
(note: temporary directory has been created) /tmp/pkgrAAA986026
Clearing documents from memory…OK

Error during generation. Packages not generated.

I repeated this twice answering the final question
both yes and no with the same answer. Can you give
me a clue as to what I’m doing wrong?

Thanks,

Mitchell



Mitchell Schoenbrun - maschoen@pobox.com
Micro Business Applications - http://www.schoenbrun.com/mba

Previously, mitchell wrote in qdn.public.qnxrtp.porting:

In a second attempt I tried to use the packager to
create a package out of the source code for the same
program. This time I used the -a and -f options.
The results were better. I was able to go through
the entire procedure creating the package files.

When complete I used the package installer to first
create a repository of the directory where the
packager program put the created files. I then
was able to start an installation on my package.

In the “Expanding the Archives” windows I almost
immediately got the error:

“Error archive format”

This is a little befuddling. Anything I’m missing?

Thanks,

Mitchell

Mitchell Schoenbrun --------- maschoen@pobox.com

mitchell <maschoen@pobox.com> wrote:

I recently tried to use the packager. I created a
directory with a directory structure and a link from
usr/bin to the program I wanted in the package.

Firstly, you should copy the file into your directory, so that
it appears in a subdirectory representing the directory you
would like it to finally appear within.

basedir/
basedir/opt
basedir/opt/bin
basedir/opt/bin/myprogram

Can you tell me what options you passed to packager?
I recommend:

packager basedir

Let me know what happens.

Jerry Chappell
Photon Application Developer
QNX Software Systems Ltd.
jchappell@qnx.com

Mitchell Schoenbrun <maschoen@pobox.com> wrote:

When complete I used the package installer to first
create a repository of the directory where the
packager program put the created files. I then
was able to start an installation on my package.

To put your packages into a repository, use the -k option
to packager to create QPK/QPM files instead of QPR files.
Put these files into a directory you want to become a
repository. Then move into that directory and type:

packager -r

This will ask you a set of questions to create a repository
in that location. Any time you update that directory to
hold more packages, or if the packages changes, type:

packager -ruv2

Otherwise, you can create a QPR like you did before,
and pass it to pkg-installer with the -u option:

pkg-installer -u my-package-name.qpr

Jerry Chappell
jchappell@qnx.com

Previously, Jerry Chappell wrote in qdn.public.qnxrtp.porting:

mitchell <> maschoen@pobox.com> > wrote:
I recently tried to use the packager. I created a
directory with a directory structure and a link from
usr/bin to the program I wanted in the package.

Firstly, you should copy the file into your directory, so that
it appears in a subdirectory representing the directory you
would like it to finally appear within.

basedir/
basedir/opt
basedir/opt/bin
basedir/opt/bin/myprogram

I did this, as follows

basedir/
basedir/usr
basedir/usr/bin
basedir/usr/bin/myprogram

Could the problem be related to having only one file? I noticed
that there was a sort step, which is just before the error.

Can you tell me what options you passed to packager?
I recommend:

packager basedir

In my first attempt, the one file package I used no options.

Mitchell Schoenbrun --------- maschoen@pobox.com

Previously, Jerry Chappell wrote in qdn.public.qnxrtp.porting:

To put your packages into a repository, use the -k option
to packager to create QPK/QPM files instead of QPR files.
Put these files into a directory you want to become a
repository. Then move into that directory and type:

packager -r

There is no -r option to my version of the packager.
I’m guessing you are now going to tell me where to get
an update?

Mitchell Schoenbrun --------- maschoen@pobox.com

Previously, Mitchell Schoenbrun wrote in qdn.public.qnxrtp.porting:

There is no -r option to my version of the packager.
I’m guessing you are now going to tell me where to get
an update?

I did a little more work on these problems. First I
discovered that I was right about the program barfing when
there is only a single file to be put in the package.
Putting in a 2nd dummy file gets me past this problem.

I downloaded two versions from your staff sight, and neither
have the mystery -r option. I’m still able to get the
package manager to recognize my test repository by simply
creating a file “index” as a listing of the files.

The package manager still attempts to install my package,
but fails with the error stated before.

Thanks for any assistance that you can provide.

Mitchell Schoenbrun --------- maschoen@pobox.com

Mitchell Schoenbrun <maschoen@pobox.com> wrote:

Could the problem be related to having only one file? I noticed
that there was a sort step, which is just before the error.

One file only works fine, but you have to make sure it is a FILE,
not a SYMLINK. You must copy the file into the basedir
structure.

“Can you tell me what options you passed to packager?”

You can get the newer packager at:
ftp://staff.qnx.com/~jchappell/packager-1.1-x86-qnx-patchC.qpr
(works on PatchA/B/C).

Jerry Chappell

Previously, Jerry Chappell wrote in qdn.public.qnxrtp.porting:

One file only works fine, but you have to make sure it is a FILE,
not a SYMLINK. You must copy the file into the basedir
structure.

The first time I tried this I used a symlink and it failed. I then
copied the file in and tried again. That time if failed again.
I think this was with an earlier version. Since then I’ve installed
the version below, and it works ok with one file.

“Can you tell me what options you passed to packager?”

-a and -f dir

You can get the newer packager at:
ftp://staff.qnx.com/~jchappell/packager-1.1-x86-qnx-patchC.qpr

I went to this site and tried to install. I was told that it is
already installed. I presume that I installed before from one
of the links at your site.

This version still does not show a -r in the “use” and
responds to “packager -r” by showing the use message.


Mitchell Schoenbrun --------- maschoen@pobox.com

Mitchell Schoenbrun <maschoen@pobox.com> wrote:

ftp://staff.qnx.com/~jchappell/packager-1.1-x86-qnx-patchC.qpr
I went to this site and tried to install. I was told that it is
already installed. I presume that I installed before from one
of the links at your site.

The Package-Installer you have does not like the fact
that ReleaseNumber changes in packager and
BuildNumber does not. Until 6.1 is released, you
will have to uninstall your old packager, and then
install the new one.

This version still does not show a -r in the “use” and
responds to “packager -r” by showing the use message.

Until you can get the -r option, you still have an old
version of packager. You mentioned that packager
now works ok with one file; what problems are you
left with?

Jerry Chappell

Previously, Jerry Chappell wrote in qdn.public.qnxrtp.porting:

The Package-Installer you have does not like the fact
that ReleaseNumber changes in packager and
BuildNumber does not. Until 6.1 is released, you
will have to uninstall your old packager, and then
install the new one.

Ok, I’m past this problem and I now have a version of
packager which takes a ‘-r’ option.

You mentioned that packager now works ok with one file;

I can run it to completion, but read on.

what problems are you left with?

I’m left with one I mentioned I while ago. I’ll
describe my entire process.

  1. Create directory “pgm_dir” with executable in it

  2. Run “packager -a -f packages pgm_dir”
    This runs to completion.

  3. I cd to my “packages” directory and run “packager -r”

All this looks good so far.

  1. I run the package manager. I’ve setup the “packager”
    directory as a repository. I’m able to start the download/install
    process on my product. Then everythings stops. The package
    manager has a small window on the screen that looks like this:


    PACKAGE MANAGER


    Expanding the Archives …

| |
| XXXXXXXXXXXXXXXX |




An error occured while expanding:
/pgks/repository/pcalc-1.0-mba-qpk (tar exit code=2)

\

Cancel



Mitchell Schoenbrun --------- maschoen@pobox.com

I have some more to add. The directory in which I create my
test repository has no .qpk files. There is some drek left
over in /pkgs/repository. It lists two .qpk files which
both are just short HTML files indicating that no .qpk
file was found in the test repository.

So maybe I should be asking, why weren’t .qpk files created?
I’ll play around some more.

Mitchell Schoenbrun --------- maschoen@pobox.com

Previously, Mitchell Schoenbrun wrote in qdn.public.qnxrtp.porting:

So maybe I should be asking, why weren’t .qpk files created?
I’ll play around some more.

Maybe this will be useful. I start “packager” as follows:

packager -f packages pcalc_package



Here are the last few lines of the session.
Note that “packager” indicates that the
files:
pcalc-1.0-mba.qpk
pcalc-1.0-x86-mba.qpk
pcalc-1.0-x86-mba.qpr

Will be created, however they are not put
in my directory “packages”.


------Photon Launch Menu------

How many LAUNCH menu items for “pcalc”? (0) 1

(1) Launch menu label? (ENTER=no more launch items)

Saving “pcalc” MANIFEST…OK

------pcalc-host_x86------

Saving “pcalc-host_x86” MANIFEST…OK

------Generation------

Individual packages:
Generating QPK (pcalc-1.0-mba.qpk)
Generating QPK (pcalc-1.0-x86-mba.qpk)

Combined repositories for each processor:
Generating QPR (pcalc-1.0-x86-mba.qpr)

------Completion------

Clearing documents from memory…OK

Successful generation.

ls packages

… pcalc-1.0-x86-mba.qpr



Mitchell Schoenbrun --------- maschoen@pobox.com

Previously, Mitchell Schoenbrun wrote in qdn.public.qnxrtp.porting:

Will be created, however they are not put
in my directory “packages”.

To be a little more clear, they are not all created.
The one file that is created is put in the “packages”
directory.


Mitchell Schoenbrun --------- maschoen@pobox.com

Mitchell Schoenbrun <maschoen@pobox.com> wrote:

Will be created, however they are not put
in my directory “packages”.

You’re so close…here’s the solution.

Packager creates a QPR file by default. If you want to create
a repository, you want QPK/QPM files. Use the -k option to
have packager do this. An alternative is to take your QPR and
do:
tar -zxf my_package.qpr

This will uncompress the QPR (it’s just a .tar.gz) into the QPK/
QPM pair of files.

Here’s the other solution:
When you have a QPR file, you can pass it directly to
Package Installer with a -u option:
pkg-installer -u my_package.qpr

You could even post your QPR on a web site, so people can
download it without connecting to a repository.

So any of those solutions will solve your problem.

I’m glad it’s working for you now.

Jerry Chappell

Jerry,

This is all very enlightening, I’ll try it later today.
The way I’ve seen this presented so far has been extremely
confusing. I’ll try it out later. Is there a document
around explaining .qpk, .qpm, .qpr files? One thing that I’m
finding a little confusing is what can someone do with a
…qpr file if they download it. I haven’t found any options
to the package manager to install a single package file. Am
I missing something?

Previously, Jerry Chappell wrote in qdn.public.qnxrtp.porting:

Mitchell Schoenbrun <> maschoen@pobox.com> > wrote:
Will be created, however they are not put
in my directory “packages”.

You’re so close…here’s the solution.

Packager creates a QPR file by default. If you want to create
a repository, you want QPK/QPM files. Use the -k option to
have packager do this. An alternative is to take your QPR and
do:
tar -zxf my_package.qpr

This will uncompress the QPR (it’s just a .tar.gz) into the QPK/
QPM pair of files.

Here’s the other solution:
When you have a QPR file, you can pass it directly to
Package Installer with a -u option:
pkg-installer -u my_package.qpr

You could even post your QPR on a web site, so people can
download it without connecting to a repository.

So any of those solutions will solve your problem.

I’m glad it’s working for you now.

Jerry Chappell


Mitchell Schoenbrun --------- maschoen@pobox.com

Mitchell Schoenbrun <maschoen@pobox.com> wrote:

This is all very enlightening, I’ll try it later today.
The way I’ve seen this presented so far has been extremely
confusing. I’ll try it out later. Is there a document
around explaining .qpk, .qpm, .qpr files? One thing that I’m
finding a little confusing is what can someone do with a
.qpr file if they download it. I haven’t found any options
to the package manager to install a single package file. Am
I missing something?

When you download a QPR file, you can pass it directly to
Package Installer with a -u option:
pkg-installer -u my_package.qpr

I’m working on a QDN article explaining how to use packager
and create QPG files (don’t ask… :wink: ). It should be available
around the same time as the General Release of 6.1.

Jerry Chappell