GithubHelp home page GithubHelp logo

pkgin's Introduction

pkgin(1) -- A tool to manage pkgsrc binary packages.

SYNOPSIS

pkgin [-dfFhpPvVyn] [-l limit_chars] [-c chroot_path] [-t log_file] command [package ...]

DESCRIPTION

The pkgin command is aimed at being an apt / yum like tool for managing pkgsrc(7) binary packages. It relies on pkg_summary(5) for installation, removal and upgrade of packages and associated dependencies, using a remote repository.

OPTIONS

The following command line arguments are supported:

  • -c chroot_path: Enable chrooting pkgin in the given repository

  • -d: Download only

  • -f: Force database update

  • -F: Force package reinstall

  • -h: Displays help for the command

  • -l limit_chars: Only include the packages with the specified [STATUS FLAGS][]

  • -n: Assumes "no" as default answer and print results of actions to be taken line per line

  • -p: Displays results in a parsable format

  • -P: Displays packages versions instead of globs (sd, sfd, srd)

  • -t log_file: Logs package browsing (dependencies and impact) to a given log file

  • -v: Displays pkgin version

  • -V: Be verbose when (un)installing

  • -y: Assumes "yes" as default answer, except for autoremove

The pkgin utility provides several commands:

  • autoremove: Automatically removes orphan dependencies. When used with the -n flag, it can be used to show packages that are possibly not necessary.

  • avail: Lists all packages available in the repository.

  • clean: Delete downloaded packages from the cache directory.

  • export: Export the list of non-autoremovable packages to stdout (one category/package by line)

  • upgrade: Upgrade all packages to the newest versions available in the repository.

  • import file: Import a list of packages to be installed from file (one category/package by line)

  • install package|glob ...: Performs installation or upgrade of package. If more than one packages are specified on the command-line, all will be installed (or upgraded). Instead of a package name, a glob can be specified in order to install specific versions.

    Example:

    pkgin in 'mysql-server>5.1<5.6'

  • keep package ...: Marks package as "non auto-removable". A keep-able package is equivalent to a non-automatic package in pkgsrc(7) terminology.

  • list: Lists all packages installed locally on a system. If the l modifier is added to this command, show only packages matching the status flag.

  • pkg-content package: Show remote package content.

  • pkg-descr package: Show remote package long-description.

  • pkg-build-defs package: Show remote package build definitions.

  • provides package: Shows what a package provides to others

  • remove package ...: Removes package as well as all packages depending on it. When more than one package are specified, they will all be uninstalled. By default, it will prompt you to confirm before package removals.

  • requires package: Shows what a package requires from others packages.

  • search pattern: Performs a regular expression search for a pattern in the repository.

  • show-deps: Displays all direct dependencies

  • show-full-deps package: Displays all direct dependencies recursively

  • show-rev-deps package: Displays all reverse direct dependencies for package. If more than one package is specified, pkgin will show recursively reverse direct dependencies for all packages on the command-line.

  • show-category category: Show packages belonging to category.

  • show-pkg-category package: Show package category.

  • show-keep: Display "non auto-removable" packages.

  • show-no-keep: Display "auto-removable" packages.

  • unkeep package ...: Marks package as "auto-removable". If no other package depends on it, it will be removed when using the autoremove modifier. It is equivalent to an automatic package in pkgsrc(7) terminology.

  • update: Creates and populates the initial database of locally installed packages and available packages (from the remote pkg_summary(5) list). This is done automatically when pkgin is first used, when the system package database has been modified, or when pkgin is upgraded to a new database version.

STATUS FLAGS

When using the -l flag along with the list command, the following status flag must be set:

  • =: The installed version of the package is current.

  • <: The installed version of the package is older than the current version.

  • >: The installed version of the package is newer than the current version.

ENVIRONMENT

PKG_REPOS The PKG_REPOS environment variable can be pointed to a suitable repository or a list of space separated repositories in order to override /usr/pkg/etc/pkgin/repositories.conf

FILES

  • /usr/pkg/etc/pkgin/repositories.conf: This file contains a list of repository URIs that pkgin will use. It may contain macros $arch to define the machine hardware platform and $osrelease to define the release version for the operating system (as reported by uname(3)).

  • /usr/pkg/etc/pkgin/preferred.conf: This file contains a list of preferences regarding packages to be installed or upgraded. Each line defines a package preference taking the form of a simple glob(3).

    Example:

    mysql-server<5.6
    php>=5.4
    autoconf=2.69.*

  • /var/db/pkgin: This directory contains component needed by pkgin at run time. This directory can be completely emptied if pkgin's database gets corrupted, pkgin will rebuild its database based on pkg_install's PKG_DB next time it is called.

  • /var/db/pkgin/cache: This directory contains the packages downloaded by pkgin. It is safe to empty it regularily using pkgin clean or simply rm -rf /var/db/pkgin/cache.

  • /var/db/pkgin/pkgin.db: pkgin.db is the main pkgin SQLite database. This format has been chosen in order to parse, query, match and order packages using the SQL language thus making packages list manipulation a lot easier.

  • /var/db/pkgin/pkg_install-err.log: This file contains errors and warnings given by pkg_add(1) and pkg_delete(1), which are the tools called by pkgin to manipulate packages themselves.

  • /var/db/pkgin/sql.log: This file contains SQL errors that might have occurred on a SQLite query. Mainly for debugging purposes.

EXAMPLES

Setup the initial database:

# echo ftp://ftp.fr.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All > /usr/pkg/etc/pkgin/repositories.conf
# pkgin update
processing local summary...
updating database: 100%
downloading pkg_summary.bz2: 100%
processing remote summary (ftp://ftp.fr.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0/All)...
updating database: 100%

Listing all packages available in the repository:

# pkgin avail | more
[...]
autoconf-2.63        Generates automatic source code configuration scripts
aumix-gtk-2.8nb3     Set mix levels (ncurses and GTK+ 2.0 interfaces)
aumix-2.8nb7         Set mix levels (ncurses interface only)
august-0.63b         Simple Tk-based HTML editor
audacity-1.2.6nb3    Audio editor
[...]

Install packages and their dependencies:

# pkgin install links eterm
nothing to upgrade.
11 packages to be installed: tiff-3.8.2nb4 png-1.2.35 libungif-4.1.4nb1 libltdl-1.5.26 jpeg-6bnb4 pcre-7.8 perl-5.10.0nb5 libast-0.6.1nb3 imlib2-1.4.2nb1 links-2.2nb1 eterm-0.9.4nb1 (25M to download, 64M to install)
proceed ? [y/N]

Remove packages and their reverse dependencies:

# pkgin remove links eterm
2 packages to delete: links-2.2nb1 eterm-0.9.4nb1
proceed ? [y/N]

Remove orphan dependencies:

# pkgin autoremove
in order to remove packages from the autoremove list, flag those with the -k modifier.
9 packages to be autoremoved: libast-0.6.1nb3 pcre-7.8 imlib2-1.4.2nb1 tiff-3.8.2nb4 png-1.2.35 libungif-4.1.4nb1 libltdl-1.5.26 perl-5.10.0nb5 jpeg-6bnb4
proceed ? [y/N]

SEE ALSO

pkg_add(1), pkg_info(1), pkg_summary(5), pkgsrc(7)

AUTHORS

  • Emile iMil Heitor: Initial work and ongoing development.
  • Jonathan Perkin: Primary maintainer 0.9.0 onwards.

CONTRIBUTORS

  • Jeremy C. Reed: Testing and refinements.
  • Arnaud Ysmal: Tests and patches
  • Claude Charpentier: SQLite schema, and SQL queries debugging.
  • Guillaume Lasmayous: Man page
  • Antonio Huete Jimenez: DragonFly port
  • Min Sik Kim: Darwin port
  • Filip Hajny: SunOS port
  • Baptiste Daroussin: FreeBSD port and patches
  • Gautam B.T.: MINIX port
  • Thomas wiz Klausner: Testing and refinements.
  • Youri yrmt Mouton: OSX testing and patches

BUGS

We're hunting them.

pkgin's People

Contributors

ahpnils avatar arnie97 avatar dhgutteridge avatar erikvannooijen-tomtom avatar imilnb avatar jlmuir avatar jperkin avatar michaelforney avatar nbyouri avatar ralfdoering avatar robohack avatar sevan avatar snimmagadda avatar snowkat avatar solevis avatar stacktic avatar sthomen avatar suominen avatar yamt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pkgin's Issues

"pkgin up" loses manual/keepable status of newly-added packages

With pkgin db up to date, pkg_add a package. Observe that automatic=YES is not set. Run "pkgin up". Observe that the package is now not on the keepable list, and that automatic=YES was set on the package. The manual/automatic status of packages added outside pkgin should be respected.

pkgin don't work "out-of-the-box"

pkgin don't work "out-of-the-box" like it should.

Example:

[root@localhost ~]# rm -rf /usr/pkg* /var/db/pkg*
[root@localhost ~]# echo http://bob.dracolinux.org/pkgsrc/packages/stable/All > /etc/pkgin/repositories.conf

[root@localhost ~]# pkgin install perl
Database needs to be updated.
proceed ? [Y/n] y
empty available packages list
nothing to do.

This should not happen, but when I do:

[root@localhost ~]# mkdir /var/db/pkg

and then run install again:

[root@localhost ~]# pkgin install perl
Database needs to be updated.
proceed ? [Y/n] y
pkg_summary.bz2 100% 5565 5.4KB/s 5.4KB/s 00:00
processing remote summary (http://bob.dracolinux.org/pkgsrc/packages/stable/All)...
updating database: 100%
calculating dependencies... done.
nothing to do.

The database was updated, but no packages was installed. This should not happen. If I manually install a package (any package):

[root@localhost ~]# pkg_add http://bob.dracolinux.org/pkgsrc/packages/stable/All/digest-20121220.tgz

And run install again:

[root@localhost ~]# pkgin install perl
reading local summary...
processing local summary...
updating database: 100%
calculating dependencies... done.

nothing to upgrade.
1 packages to be installed: perl-5.18.2nb1 (16M to download, 60M to install)

proceed ? [Y/n]

Now I can install a package. I should be able to use pkgin on a "clean install".

pkgin does not update database when repository removed from repositories.conf

I have the following in repositories.conf:

file:///usr/pkgsrc/packages/All
http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.4/All

I do an update:

$ pkgin update -f           
pkg_summary.bz2                     100% 5371     5.3KB/s   5.3KB/s   00:00    
processing remote summary (file:///usr/pkgsrc/packages/All)...
updating database: 100%
pkg_summary.bz2                     100% 2176KB 725.5KB/s 514.4KB/s   00:03    
processing remote summary (http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.4/All)...
updating database: 100%

I check the list of available packages:

$ pkgin avail | less

Looks good.

Now I remove the NetBSD.org repo from repositories.conf, leaving just the local repo:

file:///usr/pkgsrc/packages/All

I do an update:

$ pkgin update -f
database for file:///usr/pkgsrc/packages/All is up-to-date

Hmm, nothing about the fact that I removed the remote repo. Let's check the list of available packages:

$ pkgin avail | less

Wrong. I removed the remote repo from repositories.conf, yet it still lists all the packages from that repo.

A workaround is to touch the pkg_summary.bz2 file of the local repo:

$ touch /usr/pkgsrc/packages/All/pkg_summary.bz2

I do an update, and now it realizes that the remote repo has been removed:

$ pkgin update -f           
pkg_summary.bz2                     100% 5371     5.3KB/s   5.3KB/s   00:00    
cleaning database from http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.4/All entries...
processing remote summary (file:///usr/pkgsrc/packages/All)...
updating database: 100%

I used the latest version of pkgin from GitHub (cloned on August 25, 2014; latest commit: 413f8a8) on NetBSD 6.1.4 (GENERIC) amd64.

This issue may be related to issue #3.

Update output hard to read

When updating many packages (with ug or fug) the output is really hard to read; it is just a dump of package names in (for the user) random order.
Please at least sort the lists.
I'd probably prefer one package per line, or perhaps some tabular output.

Also, sometimes the lists of packages are overlapping (removed and added, or removed and updated or similar, I don't remember exactly which).

The listing issue also affects other commands like 'ar'.

wrongly supressed question during pkgin install for unsigned packages

When installing a unsigned package with pkg_add asks weather it should install the unsigned package. pkgin suppresses this question and leave the user hanging with a empty line.

even typing 'y' in that empty line does not allow for a successful installation, using pkg_add itself the isntallation is without problems.

Support for SUPERSEDES

pkgin should support SUPERSEDES if defined by a package, and automatically suggest the new package (name), if the previous one is being asked for (e.g. the case of git-base vs. scmgit-base in 2013Q3).

pkgin should check for duplicate nested dependencies

Pkgin will exit with error code 1, if it installs a package set that has a duplicate dependancy. The install actually completes fine because the dep has been installed once successfully. This presents a problem when automating pkgin from scripts or puppet.

For instance on SmartOS with pkgsrc 2013Q2 openjdk7 lists libXi and libXtst as direct dependancies. However libXtst also lists libXi as a direct dependancy.

The result of this is pkgin install libXtst using pkg_add which also installs libXi and registers the package. pkgin then attempts to install libXi using pkg_add which generates an error because libXi is now installed.

Example error run from installing erlang ,which requires openjdk:

---Jul 29 14:43:59: installing nagios-nrpe-2.12nb5...
---Jul 29 14:46:08: installing libfontenc-1.1.2...
---Jul 29 14:46:08: installing mkfontscale-1.1.0nb2...
---Jul 29 14:46:08: installing mkfontdir-1.0.7...
---Jul 29 14:46:08: installing encodings-1.0.4nb1...
---Jul 29 14:46:08: installing libXfixes-5.0.1...
---Jul 29 14:46:08: installing zip-3.0nb2...
---Jul 29 14:46:08: installing unzip-6.0nb1...
---Jul 29 14:46:08: installing libXtst-1.2.2...
---Jul 29 14:46:08: installing libXrender-0.9.8...
---Jul 29 14:46:08: installing libXi-1.7.2...
pkg_add: A different version of libXi-1.7.2 is already installed: libXi-1.7.2
pkg_add: 1 package addition failed
---Jul 29 14:46:08: installing dejavu-ttf-2.33...
---Jul 29 14:46:09: installing libltdl-2.4.2...
---Jul 29 14:46:09: installing unixodbc-2.3.0nb2...
---Jul 29 14:46:09: installing openjdk7-1.7.21nb3...
---Jul 29 14:46:10: installing erlang-16.1...
---Jul 29 14:46:16: installing py27-simplejson-2.6.2...
---Jul 29 14:46:17: installing rabbitmq-3.1.5...
---Jul 29 14:46:22: removing postfix-2.9.6nb4...
---Jul 29 14:46:23: installing popt-1.16nb1...
---Jul 29 14:46:23: installing logrotate-3.8.4...
---Jul 29 14:46:25: installing libesmtp-1.0.6nb1...
---Jul 29 14:46:25: installing esmtp-1.2nb1...
---Jul 29 14:46:29: installing nagios-plugins-1.4.15nb6...
---Jul 29 14:46:30: installing procmail-3.22nb3...
---Jul 29 14:46:51: installing openssh-6.2.1nb1...
---Jul 29 14:46:59: installing spread-4.3.0...

pkgin show-deps openjdk7
direct dependencies for openjdk7-1.7.21nb3
zip-[0-9]*
unzip-[0-9]*
libiconv>=1.9.1nb4
libXtst>=1.0.1
libXrender>=0.9.2
libXi>=1.0.0
libXext>=0.99.0
gcc47-libs>=4.7.0
{gcc47,gcc47-libs}>=4.7
freetype2>=2.4.11
fontconfig>=2.10.93nb2
dejavu-ttf-[0-9]*

pkgin show-deps libXtst
direct dependencies for libXtst-1.2.2
libXi>=1.0.0
libXext>=1.0.99.4
libX11>=1.1
gcc47-libs>=4.7.0
{gcc47,gcc47-libs}>=4.7

Build failure under DragonFly

Following the instructions at http://pkgin.net/. The Git fetch is OK, and the Configure is OK. Make is causing trouble:

$ make
Warning: Object directory not changed from original /root/pkgin
gcc  -O -pipe    -std=gnu99  -c main.c
In file included from pkgin.h:45:0,
                 from main.c:33:
/usr/include/fetch.h:44:14: error: 'MAXHOSTNAMELEN' undeclared here (not in a function)
  char   host[MAXHOSTNAMELEN+1];
              ^
/usr/include/fetch.h:59:14: error: 'PATH_MAX' undeclared here (not in a function)
  char   name[PATH_MAX];
              ^
In file included from pkgin.h:48:0,
                 from main.c:33:
pkgindb.h:37:28: fatal error: pkgindb_create.h: No such file or directory
compilation terminated.

$ uname -a
DragonFly dragonfly 4.6-RELEASE DragonFly v4.6.1-RELEASE #3: Sun Oct 16 21:13:25 EDT 2016     [email protected]:/usr/obj/home/justin/release/4_6/sys/X86_64_GENERIC  x86_64
$ uname -m
x86_64
$ uname -s
DragonFly

Pkgin should sort stuff alphabetically -- causes chef to install incorrect versions of packages

[root@monitoring ~]# pkgin se bash
dash-0.5.7           Debian Almquist shell, POSIX-compliant shell faster than bash
bash-doc-2.05.2      Documentation for the GNU Bourne Again Shell
bash-completion-2.1  Programmable completion specifications for bash
bash-4.2nb3 <        The GNU Bourne Again Shell
bash-2.05.2.7nb11 =  The GNU Bourne Again Shell (version 2)

=: package is installed and up-to-date
<: package is installed but newer version is available
>: installed package has a greater version than available package

Ability to suppress progress monitor for automated use

Hi folks:

I am using Chef to bring up SmartOS servers that use pkgin. The progress monitor actually consumes the lion's share of the logging lines. I'd like to cut that progress logging out of the output.

pkgin uses progressmeter in download.c. I see that can_output() checks to see if STDOUT is the console.

This puts me in an odd spot. I'd like to have the output of pkgin, but not the progress. I could redirect to a file, but then the Chef output would be missing the pkgin output. I could redirect to a tempfile and then cat it, but that seems clumsy and actually won't work for errors.

Can there be an option to suppress progress output? Alternatively, is there a fix I can make externally by filtering output?

Thanks,
Alain

pkgin segfaults on upgrade

I created a binary package using pkg_create and added to the repo.

pkg_info -X >> pkg_summary was used to update the summary file.

pkgin install was used to install the packge.

All worked fine.

pkgin upgrade caused a segfault:

[root@2f52fae8-983d-4425-a8bd-29f929cc995e /var/db/pkgin]# mdb /opt/local/bin/pkgin core
Loading modules: [ libumem.so.1 libc.so.1 ld.so.1 ]

$C
fffffd7fffdffa20 libc.so.1`strcmp+0x16()
fffffd7fffdffa40 pkgin_upgrade+0x36()
fffffd7fffdffb20 main+0x55f()
fffffd7fffdffb30 _start+0x6c()

truss:

67017: read(4, 0x006AE018, 1024) = 1024
67017: \r\0\0\005\0 !\003 302 m01B0\0DA\0 !\0\0\0\0\0\0\0\0\0\0\0\0\0\0
67017: \081 61E12\0 7 '1B E1D1D [15\0 /\01F17\017\0 p 5 - N e t - L i b
67017: I D N - 0 . 1 2 n b 4 p 5 - N e t - L i b I D N 0 . 1 2 n b 4 P
67017: e r l b i n d i n g s f o r G N U L i b i d n a r t i s
67017: t i c 2 0 0 9 1 1 1 5 h t t p : / / s e a r c h . c p a n . o r
67017: g / d i s t / N e t - L i b I D N / 5 . 1 1 n e t / p 5 - N e t
67017: - L i b I D N n e t p e r l 5 5 4 5 5 4 S u n O S81 S1D12\0 ;
67017: -19 g\01D m15\0 ?\01D17\017\0 p k g _ i n s t a l l - i n f o -
67017: 4 . 5 n b 3 p k g _ i n s t a l l - i n f o 4 . 5 n b 3 S t a n
67017: d a l o n e G N U i n f o f i l e i n s t a l l a t i o
67017: n u t i l i t y 2 0 0 9 1 1 1 5 h t t p : / / w w w . g n u .
67017: o r g / s o f t w a r e / t e x i n f o / t e x i n f o . h t m
67017: l 5 . 1 1 p k g t o o l s / p k g _ i n s t a l l - i n f o p k
67017: g t o o l s 3 2 4 4 8 S u n O S81 :1C12\0 9 # ! e !1D 315\0 /\0
67017: 1F1F\017\0 s c m g i t - b a s e - 1 . 8 . 0 . 1 n b 1 s c m g i
67017: t - b a s e 1 . 8 . 0 . 1 n b 1 G I T T r e e H i s t o r y
67017: S t o r a g e T o o l ( b a s e p a c k a g e ) g n u -
67017: g p l - v 2 2 0 0 9 1 1 1 5 h t t p : / / g i t - s c m . c o m
67017: / 5 . 1 1 d e v e l / s c m g i t - b a s e d e v e l s c m 2
67017: 0 7 2 7 8 0 3 8 S u n O S81 C1B12\0 )151F ] 91D 515\0 ! / -1D\0
67017: 17\0 p e r l - 5 . 1 6 . 2 n b 2 p e r l 5 . 1 6 . 2 n b 2 P r a
67017: c t i c a l E x t r a c t i o n a n d R e p o r t L a n
67017: g u a g e g n u - g p l - v 2 O R a r t i s t i c 2 0 0 9 1
67017: 1 1 5 h t t p : / / w w w . p e r l . o r g / 5 . 1 1 l a n g /
67017: p e r l 5 6 4 b i t a u t o t h r e a d s l a n g d e v e l
67017: p e r l 5 6 1 5 8 3 5 3 5 S u n O S81 J1A12\0 5 #1D y %1D 915
67017: \0 5171D1B\017\t p k g _ i n s t a l l - 2 0 1 2 0 2 2 1 p k g _
67017: i n s t a l l 2 0 1 2 0 2 2 1 P a c k a g e m a n a g e m e n
67017: t a n d a d m i n i s t r a t i o n t o o l s f o r p
67017: k g s r c m o d i f i e d - b s d 2 0 0 9 1 1 1 5 h t t p : / /
67017: w w w . p k g s r c . o r g / 5 . 1 1 p k g t o o l s / p k g _
67017: i n s t a l l i n e t 6 p k g t o o l s 2 2 5 7 5 1 2 S u n O S
67017: brk(0x006C8000) = 0
67017: Incurred fault #6, FLTBOUNDS %pc = 0xFFFFFD7FFF1782D6
67017: siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
67017: Received signal #11, SIGSEGV [default]
67017: siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000

FIX:

pkgin unkeep <package.

pkgin upgrade

--> works?!?!

pkgin update does not understand MultiStream pkg_summary archives

For both gzip and bzip2 archives can be concatenated into multistream archives.
For example cat file1.bz2 file2.bz2 > pkg_summary.bz2 will produce a file that can be extracted from command line.
pkgin update will download the entire file, but extract only the first stream.

Please update to support multiple streams. This is useful when setting up proxy that downloads upstream pkg_summary and merges it with private packages.

pkgin changes behavior if output is a tty or not, breaks Ansible

when the '-p' flag was added (a good thing!), a change was also made to have this if output is not a tty.

This breaks (among other things, probably) pkgin's usage in ansible. (See
ansible/ansible-modules-extras#316? for more details)

in other words: to support future tools better, you broke existing tools :(

I'm not certain whether switching back is a good thing or not at this point; it's worth pointing out that this affects all versions of ansible from 1.7 to 1.9.1 - ansible 1.6.3 (which is the current version in pkgsrc) has more limited pkgin support, and doesn't break in this particular way (but it breaks in other ways, which were fixed in newer ansible, at least until pkgin broke it entirely)

Non Zero exit codes

If an operation does not complete as it should, please don't return a 0 exit code.

[root@c5d1f54b-ed4e-4710-99a4-e4ee6d109b88 ~]# pkgin -v
pkgin 0.6.0 for SunOS-5.11 i386 (using SQLite 3.7.7.1)
[root@c5d1f54b-ed4e-4710-99a4-e4ee6d109b88 ~]# pkgin -y in gcc-compiler
gcc-compiler is not available on the repository
calculating dependencies... done.
nothing to do.
[root@c5d1f54b-ed4e-4710-99a4-e4ee6d109b88 ~]# echo $?
0
[root@c5d1f54b-ed4e-4710-99a4-e4ee6d109b88 ~]# 

It's arguable if it should return 1, or any other chosen exit code since the issue was a package not found.

If this is properly handled in > 0.6 please forgive me

pkgin installation requires pkgsrc

Hello. The install target is in the pkgsrc Makefile rather than the pkgin one. It would be nice to install pkgin independent of pkgsrc.

installing an older version of an existing package fails silently

Installing a newer version works, but installing an older version does nothing:

[root@test ~]# pkgin se nodejs
sqlrelay-nodejs-0.65.0  node.js API for SQL Relay
nodejs-6.7.0 <       V8 JavaScript for clients and servers
nodejs-4.6.0 =       V8 JavaScript for clients and servers
nodejs-0.8.28 >      V8 JavaScript for clients and servers
nodejs-0.12.17 >     V8 JavaScript for clients and servers
nodejs-0.10.48 >     V8 JavaScript for clients and servers

=: package is installed and up-to-date
<: package is installed but newer version is available
>: installed package has a greater version than available package
[root@test ~]# pkgin -y in nodejs-6.7.0
calculating dependencies... done.

1 packages to be upgraded:

nodejs-4.6.0

1 packages to be installed (0B to download, 871K to install):

nodejs-6.7.0

downloading packages...
removing packages to be upgraded...
removing nodejs-4.6.0...
pkg_install warnings: 0, errors: 0
installing packages...
installing nodejs-6.7.0...
pkg_install warnings: 0, errors: 0
reading local summary...
processing local summary...
[root@test ~]# pkgin se nodejs
sqlrelay-nodejs-0.65.0  node.js API for SQL Relay
nodejs-6.7.0 =       V8 JavaScript for clients and servers
nodejs-4.6.0 >       V8 JavaScript for clients and servers
nodejs-0.8.28 >      V8 JavaScript for clients and servers
nodejs-0.12.17 >     V8 JavaScript for clients and servers
nodejs-0.10.48 >     V8 JavaScript for clients and servers

=: package is installed and up-to-date
<: package is installed but newer version is available
>: installed package has a greater version than available package
[root@test ~]# pkgin -y in nodejs-4.6.0
calculating dependencies... done.
nothing to do.
[root@test ~]# pkgin se nodejs
sqlrelay-nodejs-0.65.0  node.js API for SQL Relay
nodejs-6.7.0 =       V8 JavaScript for clients and servers
nodejs-4.6.0 >       V8 JavaScript for clients and servers
nodejs-0.8.28 >      V8 JavaScript for clients and servers
nodejs-0.12.17 >     V8 JavaScript for clients and servers
nodejs-0.10.48 >     V8 JavaScript for clients and servers

=: package is installed and up-to-date
<: package is installed but newer version is available
>: installed package has a greater version than available package

spurious parens generate warnings from clang on OS X 10.9

Because bsd.sys.mk enables -Werror by default, these warnings result in a build failure. This ticket is about the code that leads to warnings. An example:

clang -O2 -I/usr/pkg/include -DHAVE_NBCOMPAT_H=1 -I/usr/pkgsrc/pkgtools/pkgin/work/libnbcompat -I/usr/pkg/include -DPKGIN_VERSION=""0.9.3 for Darwin-13.4.0 x86_64"" -DHAVE_NBCOMPAT_H=1 -I/usr/pkgsrc/pkgtools/pkgin/work/libnbcompat -I/usr/pkg/include -g -DLOCALBASE="/usr/pkg" -DPKG_SYSCONFDIR="/usr/pkg/etc" -DPKG_DBDIR=""/var/db/pkg"" -DDEF_LOG_DIR=""/var/db/pkg"" -DPKGIN_DB="/var/db/pkgin"
-DPKGTOOLS="/usr/pkg/sbin" -DHAVE_CONFIG_H -D_LARGEFILE_SOURCE -D_LARGE_FILES -DCHECK_MACHINE_ARCH="x86_64" -Iexternal -I. -I/usr/pkg/include -c depends.c
depends.c:124:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if (((&r_plisthead)->slh_first == ((void_)0))) {
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
depends.c:124:33: note: remove extraneous parentheses around the comparison to silence this warning
if (((&r_plisthead)->slh_first == ((void_)0))) {
~ ^ ~
depends.c:124:33: note: use '=' to turn this equality comparison into an assignment
if (((&r_plisthead)->slh_first == ((void*)0))) {
^~
=
1 warning generated.

pkgin is sorting packages by string, not version number

pkgin needs to be changed to sort by the version. Normal package managers will sort by version number and the latest will be at the bottom (last in list). As you can see, pkgin does not do that but instead sorts by string which is not logical.

[root@75e226e9-d915-cac6-dc0b-f42aad24d713 ~]# pkgin se nodejs
nodejs-0.8.28 >      V8 JavaScript for clients and servers
nodejs-0.12.7 <      V8 JavaScript for clients and servers
nodejs-0.12.6 <      V8 JavaScript for clients and servers
nodejs-0.12.4 <      V8 JavaScript for clients and servers
nodejs-0.12.3 =      V8 JavaScript for clients and servers
nodejs-0.12.2 >      V8 JavaScript for clients and servers
nodejs-0.12.1 >      V8 JavaScript for clients and servers
nodejs-0.12.0 >      V8 JavaScript for clients and servers
nodejs-0.10.40 >     V8 JavaScript for clients and servers
nodejs-0.10.39 >     V8 JavaScript for clients and servers
nodejs-0.10.38 >     V8 JavaScript for clients and servers
nodejs-0.10.36 >     V8 JavaScript for clients and servers
nodejs-0.10.35 >     V8 JavaScript for clients and servers

=: package is installed and up-to-date
<: package is installed but newer version is available
>: installed package has a greater version than available package

Version 0.10.35 is not the latest but it is last on the list because of sting sorting.

This is the fix we had to use:

[root@75e226e9-d915-cac6-dc0b-f42aad24d713 ~]# pkgin se nodejs | grep '<' | sort
<: package is installed but newer version is available
nodejs-0.12.4;<;V8 JavaScript for clients and servers
nodejs-0.12.6;<;V8 JavaScript for clients and servers
nodejs-0.12.7;<;V8 JavaScript for clients and servers

The latest version is last on the list now.

smarter library handling

When running "pkgin fug", the user can end up with unusable programs if a shlib was bumped and the necessary PKGREVISION bumps were forgotten in pkgsrc.
However, pkgin does have enough information to avoid this or fix it, so it would be good if it did.

More details:
Let's assume libfoo was bumped from 2.0 to 2.1, and nobody expected the shlib major to change, but it did.
libbar depends on it but it's PKGREVISION wasn't bumped.

On the local system, libfoo and libbar are installed. Currently, if one runs "pkgin fug", libfoo is updated and libbar is broken, since the old libfoo library is missing.
The easiest solution would be to check the PLISTs before upgrading and verify that the REQUIRES lines of all dependencies are still fulfilled (from /var/db/pkg/*/+BUILD_INFO), and stop/skip the package upgrade if not.

Usually, a bulk build machine will rebuild libbar, so there might be a newer binary package for libbar available, with the same PKGREVISION, but depending on the newer libfoo, so alternatively, libbar could be reinstalled from the newer binary package instead.

Corner-case surprise when using `pkgin -y remove`

Let's say there is a package, git-base, that depends on another package, curl. I've installed them like so:

# pkgin -y install curl git-base
calculating dependencies... done.

nothing to upgrade.
2 packages to be installed: curl-7.38.0 git-base-2.1.0 (0B to download, 241M to install)

downloading packages...
installing packages...
installing curl-7.38.0...
installing git-base-2.1.0...
.
.
.
pkg_install warnings: 0, errors: 0
reading local summary...
processing local summary...
updating database: 100%
marking curl-7.38.0 as non auto-removable
marking git-base-2.1.0 as non auto-removable

Later I want to remove just curl, but it doesn't occur to me that git-base is depending on it, so in a hurry I do this:

# pkgin -y remove curl
2 packages to delete: git-base-2.1.0 curl-7.38.0
removing git-base-2.1.0...
removing curl-7.38.0...
pkg_install warnings: 0, errors: 0
reading local summary...
processing local summary...
updating database: 100%

Both have been removed, which on one hand makes sense. But they were also both marked as non-auto-removable. Since I only named curl on the command line, it seems like the right thing to do would have been to halt with an error when pkgin came to uninstall git-base and saw that it was marked.

pkgin can't update cwrappers and pkg_install

With pkgin-0.9.4nb6, upgrading from one quarterly branch to another, everything works fine, except for the two central packages:

    $ pkgin full-upgrade
    calculating dependencies... done.
    2 packages to be upgraded:
    cwrappers-20170112 pkg_install-20160410nb1
    2 packages to be installed (0B to download, -395K to install):
    pkg_install-20170419 cwrappers-20170611
    proceed ? [Y/n] y
    downloading packages...
    removing packages to be upgraded...
    removing cwrappers-20170112...
    removing pkg_install-20160410nb1...
    pkg_install warnings: 0, errors: 2
    pkg_install error log can be found in /apps/xxx/local/pkg/var/db/pkgin/pkg_install-err.log
    installing packages...
    installing pkg_install-20170419...
    about to upgrade pkg_install, proceed ? [Y/n]
    installing cwrappers-20170611...
    pkg_install warnings: 0, errors: 4
    pkg_install error log can be found in /apps/xxx/local/pkg/var/db/pkgin/pkg_install-err.log

pkg_install-err.log says:

    ---Sep 25 15:59:40: removing cwrappers-20170112...
    pkg_delete: The following packages are marked as not for deletion:
            cwrappers-20170112
    ---Sep 25 15:59:40: removing pkg_install-20160410nb1...
    Package `pkg_install-20160410nb1' is still required by other packages:
            pkgin-0.9.4nb6
    pkg_delete: The following packages are marked as not for deletion:
            pkg_install-20160410nb1
    ---Sep 25 15:59:40: installing pkg_install-20170419...
    pkg_add: A different version of pkg_install-20170419 is already installed: pkg_install-20160410nb1
    pkg_add: 1 package addition failed
    ---Sep 25 15:59:45: installing cwrappers-20170611...
    pkg_add: A different version of cwrappers-20170611 is already installed: cwrappers-20170112
    pkg_add: 1 package addition failed

"pkgin ar" output is hard to read

When running "pkgin ar", the list is unreadable because the package names are space-separated on one long line. While I know how to use tr, the default should be one package per line. With "pkgin -n ar", it should just output the list to be removed, with nothing else, similar to "pkgin sk" (except without any superfluous text).

pkgin should be able to rm named packages without dependencies

I'd like to be able to remove a package or set of packges, and have that just work if it can be removed, and just fail with an error if it cannot (due to a dependency still being there). As it is I have to parse the suggested output, and this basically requires pkgin to be used interactively.

Perhaps I should use pkg_delete instead, and it's an error to use the human tool for machine operations.

confusing error message stops pkgin in its tracks

After finishing a bulk build, I wanted to upgrade the installed packages, but couldn't:

# pkgin up
pkg_summary.bz2                      100%  295KB 295.0KB/s 295.0KB/s   00:00
processing remote summary (file:///archive/packages/current/All)...
updating database: 100%
# pkgin fug
calculating dependencies... done.
pkgin: vlc-2.1.4nb1 has no associated repository

I hadn't seen this message before, even if vlc has been there for some time, and whatever the error means, I don't think it should stop the upgrade -- just skip vlc.

Updating the list of repositories does not update the packages summary info

pkgin update after updating /opt/local/etc/pkgin/repositories.conf

[Wed, 03 Jul 2013 18:34:29 +0000] FATAL: Chef::Exceptions::Package: package[unzip] (sharecell::packages-archivers line 19) had an error: Chef::Exceptions::Package: Package unzip not found
[ Jul  3 18:34:29 Method "start" exited with status 1. ]

Manually force -f (sometimes a few times for it to actually update):

[root@wellington (ord) /var/chef]# pkgin -f up
pkg_summary.gz                                                                       100%  511KB 511.4KB/s 511.4KB/s   00:00   
cleaning database from http://pkgsrc.ams.example.com/sdc6/2012Q2/i386/All entries...
cleaning database from http://pkgsrc.ams.example.com/foo/2012Q2/i386/All entries...
cleaning database from http://pkgsrc.example.com/sdc6/2012Q2/i386/All entries...
cleaning database from http://pkgsrc.example.com/foo/2012Q2/i386/All entries...
processing remote summary (http://pkgsrc.example.com/sdc6/2012Q2/i386/All)...
updating database: 100%
pkg_summary.gz                                                                       100%   41KB  41.4KB/s  41.4KB/s   00:00   
processing remote summary (http://pkgsrc.example.com/foo/2012Q2/i386/All)...
updating database: 100%

pkgin upgrade or full-upgrade isn't possible if one package is no longer availble

Environment

  • Uname: Darwin havanna.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64 i386 MacBookPro12,1 Darwin
  • Version: pkgin 0.9.4 for Darwin-13.4.0 x86_64 (using SQLite 3.20.1)
  • Repositories: https://pkgsrc.joyent.com/packages/Darwin/trunk/x86_64/All

Details

I'm using the trunk Darwin repository from Joyent. The repository provides rolling updates for packages. I mostly run an pkgin update and pkgin upgrade or pkgin fug, but if one package is no longer available on the remote site a upgrade or fug isn't possible.

Example

Update the local database:

 » pkgin update
processing remote summary (https://pkgsrc.joyent.com/packages/Darwin/trunk/x86_64/All)...
database for https://pkgsrc.joyent.com/packages/Darwin/trunk/x86_64/All is up-to-date

Run an upgade which result in the error vim-lang has no associated repository:

 » pkgin upgrade
calculating dependencies... done.
pkgin: vim-lang-8.0.1096 has no associated repository

A workaround or maybe regular way is to remove the package, in this case vim-lang to run an upgrade after that. This works fine!

Recommendation

pkgin could handle this case so it will inform the user if he like to remove the package and run the upgrade.

Also the best case would be the package will be removed exactly at the time when it's needed to be removed. Because otherwise if you remove the package at the beginning and wait before the upgrade you may have broken dependencies or missing features in one or more application.

Corner case when picking the latest dependency available

This is with pkgin 0.8.0. Consider the following situation:

# pkgin av | grep ^jasper
jasper-1.900.1nb10;Software-based reference implementation of the JPEG-2000 codec
jasper-1.900.1nb8;Software-based reference implementation of the JPEG-2000 codec

Directly calling pkgin in jasper picks the nb10 version properly. However, installing a package that depends on jasper seems to prefer nb8:

# pkgin in gdal-lib
calculating dependencies... done.

nothing to upgrade.
2 packages to be installed (744K to download, 42M to install):

jasper-1.900.1nb8 gdal-lib-1.11.1

proceed ? [Y/n] n

Sounds like numerical sorting is not applied for the various parts of the version string when picking the right dep. Same case might be here, but I don't have anything that would depend on nodejs, so can't confirm:

# pkgin av | grep ^nodejs
nodejs-0.10.35;V8 JavaScript for clients and servers
nodejs-0.10.36;V8 JavaScript for clients and servers
nodejs-0.12.0;V8 JavaScript for clients and servers
nodejs-0.8.28;V8 JavaScript for clients and servers

Sounds like plain alpha sorting is being used for display and (possibly) dependency lookup, which doesn't work for the 9->10 version updates.

No pkg update

pkgin: Could not fetch ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/7.0.2/All/pkg_summary.gz

suggestion: signed summary file

A cheap way to get package verification would be:
Let bulk builds provide pkg_summary.gz.asc signatures for the summary files.
Extend the summary files to contain a checksum for the binary package.
When downloading summaries, check the signatures of the summaries against allowed keys.
When installing packages, check the checksums of the binary packages against the summary file.

OS version change does not make package appear to need upgrades

On a machine running netbsd-6/i386, I upgraded to netbsd-7. I changed my pkgin config file and did "pkgin up". In my view, packages built on netbsd-6 are out of date because they are possibly linked with old libraries. As long as one uses only those packages, it will work because of binary compatibility, but updating to mixed versions will be trouble. Therefore, I think packages should be viewed as needing upgrades if the build OS version is different, or there should be some flag to ug/fug to enable this.

pkgin assumes stdin is the terminal

I ran "pkgin -n ar | egrep py27 | xargs pkgin rm" to try to remove all unneeded python packages. pkgin printed out the proceed? prompt and exited, rather than reading from the terminal.

However, "rm -i" has the same behavior, so perhaps this is not really a bug.

pkgin documentation needs improvements

Some topics that should be covered:
Where is pkgin's database?
What are the files in /var/db/pkgin/ for?
What happens when you give an argument to pkgin fug or pkgin ug?
Can the cache directory be changed (/var might not be big enough) or cleaned?
Is 'keepable' the same as 'automatic=YES'?
Why does pkgin keep its own database?
Why is there even an upgrade command? (Doesn't everyone use fug?)
Perhaps document that 'pkgin -n ar' can be used to show packages that are possibly not necessary.

make pkgin standalone

Currently, pkgin is basically a frontend for pkg_add and pkg_delete, calling the executables when needed.
It would be good if it was standalone instead.

The pkg_install tools already provide much functionality in a library, but the main add/delete functionality is in add/perform.c and delete/pkg_delete.c respectively. Perhaps a first step would be to refactor them into the library. (This part is not directly pkgin relevant, but the end goal is.)

install target issues

'make install' installs the binary and the configuration below /usr/local
but the man pages (in mdoc and html format) below /usr/share

A deinstall or uninstall target removing them again would be nice to have too :)

pkgin conflates variables from adjacent packages

Using:
pkgin 0.6.4 for SunOS-5.11 x86_64 (using SQLite 3.8.4.1) on SmartOS 14.1

I am creating my own packages, and due to a bit of carelessness when constructing the plist, ended up with my @pkgdep lines before @name, yielding something like the following in pkg_summary:

PKGNAME=my-first-pkg-1.0
...

PKGNAME=my-next-pkg-3.0
...

DEPENDS=my-first-pkg
PKGNAME=my-last-pkg-2.0
...

The first two packages are standalone-- no deps. The last package depends on my-first-pkg. What surprised me was that a pkgin install my-next-pkg caused the dependency from "my-last-pkg" to also be installed. Despite blank lines apparently being the delimiter in pkg_summary, pkgin seems to be conflating any dependencies from the trailing package with the one preceding it.

My workaround was to fix my process so that @name was always first in the plist, but given what I understand from pkg_summary(5), the order should not matter. It seems as though pkgin is using PKGNAME as the delimiter instead.

pkgin requires way too much RAM

Whilst building our 2013Q3 package sets, I noticed that an initial pkgin up with an empty database failed on zones with 256M RAM:

processing remote summary (http://pkgsrc.joyent.com/packages/SmartOS/2013Q3/x86_64/All)...
updating database:  88%pkgin: can't allocate memory
: Not enough space

Increasing the zone memory to 512M and retrying, I monitored the RSS usage and it required 271M to complete the update.

Looking through the code, there is an awful lot of caching and over-allocation going on. I have an initial diff to at least stream the DB updates:

$NetBSD$

--- summary.c.orig  2013-06-16 14:00:45.000000000 +0000
+++ summary.c
@@ -87,7 +87,7 @@ int               colnames(void *, int, char **, ch

 char       *env_repos, **pkg_repos;
 char       **commit_list = NULL;
-int            commit_idx = 0;
+int            commit_idx = -1;
 int            query_size = BUFSIZ;
 /* column count for table fields, given by colnames callback */
 int            colcount = 0;
@@ -398,6 +398,24 @@ update_col(struct Summary sum, int pkgid
 /* default version for (rare and buggy) packages with a version */
 #define NOVERSION "-0.0"

+void
+do_commit_list()
+{
+   int i;
+
+   commit_idx++;
+   XREALLOC(commit_list, (commit_idx + 1) * sizeof(char *));
+   commit_list[commit_idx] = NULL;
+
+   for (i = 0; commit_list[i] != NULL; i++) {
+       pkgindb_doquery(commit_list[i], NULL, NULL);
+   }
+
+   free_list(commit_list);
+   commit_list = NULL;
+   commit_idx = -1;
+}
+
 static void
 insert_summary(struct Summary sum, char **summary, char *cur_repo)
 {
@@ -416,11 +434,9 @@ insert_summary(struct Summary sum, char
    /* record columns names to cols */
    pkgindb_doquery(query, colnames, NULL);

-   SLIST_INIT(&inserthead);
-
-   XMALLOC(commit_list, sizeof(char *));
    /* begin transaction */
-   XSTRDUP(commit_list[0], "BEGIN;");
+   snprintf(query, BUFSIZ, "BEGIN;");
+   pkgindb_doquery(query, NULL, NULL);

    printf(MSG_UPDATING_DB);
    fflush(stdout);
@@ -452,6 +468,8 @@ insert_summary(struct Summary sum, char
                pkgname = tmpname;
            }

+           SLIST_INIT(&inserthead);
+
            add_to_slist("FULLPKGNAME", pkgname);

            /* split PKGNAME and VERSION */
@@ -476,6 +494,9 @@ insert_summary(struct Summary sum, char
        /* build INSERT query */
        prepare_insert(pkgid, sum, cur_repo);

+       /* Perform the query */
+       do_commit_list();
+
        /* next PKG_ID */
        pkgid++;

@@ -487,20 +508,12 @@ insert_summary(struct Summary sum, char

    } /* while *psum != NULL */

-   commit_idx++;
-   XREALLOC(commit_list, (commit_idx + 2) * sizeof(char *));
-   XSTRDUP(commit_list[commit_idx], "COMMIT;");
-   commit_list[commit_idx + 1] = NULL;
-
-   /* do the insert */
-   for (i = 0; commit_list[i] != NULL; i++)
-       pkgindb_doquery(commit_list[i], NULL, NULL);
+   /* finish the transaction */
+   snprintf(query, BUFSIZ, "COMMIT;");
+   pkgindb_doquery(query, NULL, NULL);

    progress(alnum[strlen(alnum) - 1]); /* XXX: nasty. */

-   free_list(commit_list);
-   commit_idx = 0;
-
    /* reset pkgid */
    if (sum.type == LOCAL_SUMMARY)
        pkgid = 1;

but this could do with cleaning up further - it still requires 70MB, which seems like an awful lot when the uncompressed pkg_summary is only 14MB.

database information stays out of sync

tex-jadetex had errors during installation, as I saw in the pkg_install error log.
So I removed it (with pkg_delete -r, sorry) and used "pkgin im" to get all packages installed again.
This worked. A bit later, I ran "pkgin im" again, and it said:

# pkgin im Projects/NetBSD/packages/wiz/yt.base
calculating dependencies... done.

nothing to upgrade.
3 packages to be installed: netbsd-doc-print-1.3nb1 netbsd-www-1.8nb3 pkgsrc-guide-tools-1.0nb1 (0B to download, 0B to install)

proceed ? [Y/n]
downloading packages...
installing packages...
installing netbsd-doc-print-1.3nb1...
installing netbsd-www-1.8nb3...
installing pkgsrc-guide-tools-1.0nb1...
pkg_install warnings: 0, errors: 0
# pkgin im Projects/NetBSD/packages/wiz/yt.base
calculating dependencies... done.

nothing to upgrade.
3 packages to be installed: netbsd-doc-print-1.3nb1 netbsd-www-1.8nb3 pkgsrc-guide-tools-1.0nb1 (0B to download, 0B to install)

proceed ? [Y/n]
downloading packages...
installing packages...
installing netbsd-doc-print-1.3nb1...
installing netbsd-www-1.8nb3...
installing pkgsrc-guide-tools-1.0nb1...
pkg_install warnings: 0, errors: 0

So for some reason it didn't understand that these packages had already been installed.

I've since run 'pkg_delete -r tex-jadetex' again and then it worked:

# pkgin up
reading local summary...
processing local summary...
updating database: 100%
pkg_summary.bz2                                                                                                                                                         100%  287KB 286.7KB/s 286.7KB/s   00:00
processing remote summary (file:///archive/packages/current/All)...
updating database: 100%
# pkgin im Projects/NetBSD/packages/wiz/yt.base
calculating dependencies... done.

nothing to upgrade.
4 packages to be installed: tex-jadetex-3.13nb8 netbsd-doc-print-1.3nb1 netbsd-www-1.8nb3 pkgsrc-guide-tools-1.0nb1 (0B to download, 1497K to install)

proceed ? [Y/n]
downloading packages...
installing packages...
...

and another pkgin im says "nothing to do."

pkgin uses "pkg_add -f"

I had xentools41 installed, and did "pkgin in xentools24". This should have failed, because xentools42 conflicts with xentools41 because PLISTs overlap. pkg_add rejects this addition. As a result, I had a mix of the packages, and when I removed xentools42 the xentools41 package was broken. It seems this happens because -f is pased to pkg_add.

This is a critical integrity failure; it should not be possible to reach unsafe states with pkgin. pkgin should never use -f with pkg_add. I really do mean never; if some specific check needs overriding for a good reason, there should be a flag to just skip that. (Arguably, pkg_add/etc. should have a coherent scheme of named checks with a flexible override mechanism.)

pkgin seriously confused about dependencies when has more than one repository

I have a repositories.conf that contains two repos:

file:///usr/pkgsrc/packages/All
http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.4/All

The local repo contains the following (built from pkgsrc-2014Q2):

$ ls -1 /usr/pkgsrc/packages/All/
checkpassword-0.90.tgz
daemontools-0.76nb1.tgz
digest-20121220.tgz
djbdns-1.05nb10.tgz
djbdns-run-20140415.tgz
libfetch-2.36nb1.tgz
par-1.52.tgz
perl-5.20.0nb1.tgz
pkg_summary.bz2
pkgin-0.6.4nb7.tgz
qmail-1.03nb19.tgz
qmail-run-20060604.tgz
rsync-3.1.0nb2.tgz
ucspi-tcp-0.88nb3.tgz

The remote repo can be inspected with a web browser or whatever.

I do an update:

$ pkgin update -f           
pkg_summary.bz2                     100% 5371     5.3KB/s   5.3KB/s   00:00    
processing remote summary (file:///usr/pkgsrc/packages/All)...
updating database: 100%
pkg_summary.bz2                     100% 2176KB 725.5KB/s 514.4KB/s   00:03    
processing remote summary (http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/6.1.4/All)...
updating database: 100%

I now try to install the qmail-run package:

# pkgin install qmail-run
calculating dependencies... done.
/usr/X11R7/lib/libxcb.so.1, needed by sam-4.3nb3 is not present in this system.
/usr/X11R7/lib/libXt.so.7, needed by sam-4.3nb3 is not present in this system.
/usr/X11R7/lib/libXdmcp.so.7, needed by sam-4.3nb3 is not present in this system.
/usr/X11R7/lib/libXau.so.7, needed by sam-4.3nb3 is not present in this system.
/usr/X11R7/lib/libX11.so.7, needed by sam-4.3nb3 is not present in this system.
/usr/X11R7/lib/libSM.so.7, needed by sam-4.3nb3 is not present in this system.
/usr/X11R7/lib/libICE.so.7, needed by sam-4.3nb3 is not present in this system.

nothing to upgrade.
5 packages to be installed: libXgFonts-1.0nb4 perl-5.20.0nb1 checkpassword-0.90 qmail-1.03nb19 qmail-run-20060604 (1329K to download, 62M to install)

the following packages have unmet requirements: sam-4.3nb3

proceed ? [Y/n]

This is wrong. Where is the sam-4.3nb3 dependency coming from? That's a text editor. (The X11R7 errors are probably just because X is not installed on this machine.) Certainly qmail-run and any dependencies do not depend on sam-4.3nb3. Also, sam-4.3nb3 is not in the list of five packages to be installed, yet there's the line, "the following packages have unmet requirements: sam-4.3nb3." And there is libXgFonts-1.0nb4 listed as one of the five packages to be installed. What's that? Why is that a dependency?

If I remove the remote repo from repositories.conf such that I have just the local repo listed there, this strange behavior goes away.

I used the latest version of pkgin from GitHub (cloned on August 25, 2014; latest commit: 413f8a8) on NetBSD 6.1.4 (GENERIC) amd64.

pkgin loses dependency information when upgrading packages (NetBSD PR 48620)

When using 'pkgin fug' to update packages, they lose the information by what packages
they are needed, while the packages needing them still know about this.
This causes problems later-on. For example, when you do pkg_delete -r, not all
depending packages are removed.

Example:
Upgrade a package that is used by another one.
E.g. after upgrading isl with 'pkgin fug':

pkg_info isl

Information for isl-0.12.2:

Comment:
Integer set library required by gcc graphite

Requires:
gmp>=5.0.1

Description:
isl is a library for manipulating sets and relations of integer
points bounded by linear constraints. Supported operations on sets
include intersection, union, set difference, emptiness check, convex
hull, (integer) affine hull, integer projection, and computing the
lexicographic minimum using parametric integer programming. It also
includes an ILP solver based on generalized basis reduction.

Homepage:
http://isl.gforge.inria.fr/

pkg_info gcc48

Information for gcc48-4.8.2nb1:

Comment:
The GNU Compiler Collection (GCC) - 4.8 Release Series

Requires:
gmp>=5.0.1
mpcomplex>=0.8.2
mpfr>=3.0.0.3
cloog>=0.18.0nb1
isl>=0.11.1

Required by:
icc11-11.1.080nb2

Description:
The GNU Compiler Collection (GCC) includes front ends for C, C++, Objective-C,
Fortran, Java, and Go, as well as libraries for these languages (libstdc++,
libgcj,...). This package provides the snapshot relases of version 4.8.
See http://gcc.gnu.org/gcc-4.8/changes.html for changes relative to 4.7.x.

Homepage:
http://gcc.gnu.org/

So isl doesn't know that gcc48 needs it, but gcc48 still remembers.

Suggested solution:
Do what 'make replace' does.
Move the file with the dependency information aside and restore it after
updating the package.

For bonus points: mark the depending packages with unsafe_depends, like
pkg_rr does.

excessive complaints and corrupted db with an i386 pkg on amd64

I have an amd64 NetBSD machine that I just upgraded from i386. For various reasons I have one package that is i386 still (not rebuilt). I generate a local pkg_summary file for my local packages, plus point pkgin at the normal repo. When doing "pkgin up" I get a warning about i386 vs amd64. Then I can run "pkgin -n ar" to see what I might prune. After doing that a few times, I get "pkgin: no packages have been installed with pkgin".

What I'd like to see is pkgin up to give a warning only on the first reading of the i386 pkg, and when the package data has not changed from the db, not warn again. And, have nothing worse than a warning; it's not really 100% broken to have an i386 package installed on an amd64 machine, as it runs fine. In some ways it is not so different than having a package built for NetBSD 4 on a NetBSD 6 machine.

pkgin loses 'automatic' information

When using "pkgin fug", pkgin removes the information if a package was automatically installed or not.
This is probably related to #15 but a separate problem.
You can see that this is happening due to the following messages by pkg_add:

pkg_add: package `py34-dateutil-2.4.0' was already installed as dependency, now marked as installed manually

pkgin should ask about upgrading pkg_install before removing other packages

I recently did a 'pkgin full-upgrade' over ssh, which of course can take a long time. The problem I ran into was this prompt:

about to upgrade pkg_install, proceed ? [Y/n]

I didn't realize it was coming, and it only happened after downloading all the packages, and ACTUALLY REMOVING the packages it was upgrading.

I got distracted, and then a network problem closed my ssh connection - which meant nearly all my packages were deleted and there was no easy way to recover.

When working interactively, pkgin should get answers to all questions BEFORE removing anything to avoid this sort of issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.