Pkg Test Repository Experiments
By user12607856 on Sep 02, 2008
I've been playing around with setting up my own IPS test repository, then adding in a very simple package, then updating the meta-data associated with the package and then republishing the updated package.
Here are my notes based on the example on the IPS for Developers web page. Thanks to Shawn and Danek for pointing out the two mistakes there and giving me the correct commands.
- Creating my own test repository:
\* Start pkg.depotd: $ /usr/lib/pkg.depotd -d /export/home/richb/pkg/test_repository -p 9000 I confirmed it was their by looking at http://localhost:9000 in a browser.
- Creating a simple test package:
# Create a temporary directory on your system. $ mkdir /export/home/richb/pkg/my_tmp # Change the directory to the temporary directory. $ cd /export/home/richb/pkg/my_tmp # Create a directory called my_package. $ mkdir my_package # Change the directory to my_package. $ cd my_package # Create a text file under the directory my_package. $ cp /etc/motd my_text_file # Export the directory my_package. Specify a version number and a # sub-version number for the package. In this example, the my_package # has a version number of 1.0 and a subversion number of 1. Note the # back quotes used in this command. $ eval `pkgsend -s http://localhost:9000 open firstname.lastname@example.org` # Add attributes to the package. In this task you add a directory # action with attributes of mode, owner, group, and path. Path is # the key attribute for the directory action and has to be specified. $ pkgsend -s http://localhost:9000 add dir mode=0555 owner=root group=bin path=/etc/my_package # Add the file my_text_file under the my_package directory (with attributes) $ pkgsend -s http://localhost:9000 add file my_package/my_text_file mode=0555 owner=root group=bin path=/etc/my_package # We will add a dependency for this package and set a name attribute. $ pkgsend -s http://localhost:9000 add depend fmri=pkg:/email@example.com type=require # Add a description. $ pkgsend -s http://localhost:9000 add set name=description value="Example Package" # Use the following option to close the transaction. $ pkgsend -s http://localhost:9000 close
- Grabbing the package out of a repository
\* To grab my newly created "my_package out of my test repository: $ cd /tmp $ pkgrecv -s http://localhost:9000 pkg:/firstname.lastname@example.org,5.11-1:20080902T195702Z \* This created a directory called my_package under /tmp. Inside there are all the files that are in the package plus a file called 'manifest' which contains the package's um, ... manifest.
- Modifying the package's manifest:
\* I added the following five lines to the end of the 'manifest' file: set name=package_display_name value="afio" set name=extended_description value="The extended description for this package that will go on and on and on" set name=category value="Operating System" set name=subcategory value="Core" set name=search_keyword_list value="keyword1,keyword2,keyword3,keyword4" These are an example of extra lines of meta-data that might be useful to a tool like
- Republishing the modified package back to the test repository
\* I put the package back in my test repository (with the same version number but a new timestamp) with: $ eval `pkgsend -s http://localhost:9000 open email@example.com` $ pkgsend -s http://localhost:9000 include -d /tmp/my_package /tmp/my_package/manifest $ pkgsend -s http://localhost:9000 close
Statistics Number of packages: 2 Number of in-flight transactions: 0 Number of catalogs served: 3 Number of manifests served: 5 Number of files served: 0 Number of flists requested: 1 Number of files served by flist: 1 Number of packages renamed: 0 Catalog FMRI Info Manifest ---------------------------------------------------------------- pkg:/firstname.lastname@example.org,5.11-1:20080902T195702Z Info Manifest pkg:/email@example.com,5.11-1:20080902T210205Z Info Manifest