pkgutils-c-1.5

Anton Vorontsov cbou at mail.ru
Thu Aug 9 18:28:30 UTC 2007


On Mon, Aug 06, 2007 at 10:43:55AM +0200, Clemens Koller wrote:
> Hi, Anton!
>
> Anton Vorontsov schrieb:
>> It's been a long time from the previous version announcement (1.1).
>> Three versions released silently, so here is version 1.5 of the
>> pkgutils-c: unofficial pkgutils for CRUX, rewritten in C.
>
> Nice work!

Thanks!

>> Few bugs and memory leaks fixed, speed ups and some cosmetic changes.
>> Nothing drastically new, so far.
>
> Can you point out places where pkgutils-c's behaviour is not 100%
> compatible with pkgutils - from the user's point of view.

Sure. Let's point to all user visible changes, not compatible are
1 and 4.

1. pkgadd.conf syntax changed. To use \ in the regexp you should around
   the regexp with double quotes and escape the \, like strings in C.
   For example: "^etc/rc\\.d/net$". So, after installing
   pkgutils-c, issuing `rejmerge' is mandatory.

   C++ pkgutils can't handle spaces inside regexp, thereby pkgutils-c
   fixed it.

2. pkgadd and pkgrm are able to handle multiple packages on the command
   line. `pkgadd *.pkg.tar.gz' and `pkgrm gcc glibc binutils' is
   possible with pkgutils-c. ;-)

3. pkgadd's -u (--upgrade) switch is meaningless in the pkgutils-c,
   but still silently accepted for compatibility reasons.
   Currently pkgadd will install package if it's absent, and will
   upgrade if it's installed.

   Why this is done? To use pkgadd * for installing and upgrading
   bunch of packages.

   Actually, I planning to revive -u option, and add -i. so
   pkgadd * will install all not installed packages,
   pkgadd -u * will upgrade all packages, but not install anything
   new, and pkgadd -i -u will do what it's doing now: install
   not-installed pkgs, upgrade installed pkgs.

4. pkgadd is more secure than original C++ version. If you trying
   to install package with wrong permissions (i.e. that differs
   from what you have already), for example, 0777 on, say "/usr",
   then the C++ version will silently change filesystem's permission
   on that directory.

   But pkgutils-c will complain about it, warning you. -p option used
   to force installation or upgrade:
   	-p  --force-perms   ignore permissions conflicts

5. Old -f (--force) option renamed to -o option, used to overwrite
   existing files.
   	-o  --force-over    ignore database and filesystem conflicts

6. pkgutils-c's -f option doing both -o and -p, so it's compatible
   with C++ish pkgutils:
   	-f  --force         same as -o and -p together

7. -m option added to pkginfo, it's used to list files absent on the
   filesystem but which exist in the database (i.e. you can use this
   option to find out which files you or someone else had deleted
   from, e.g. /usr/bin ;-):
   	-m  --missing             list missing files

8. -O option added to pkginfo, it's used to list files which exist
   on the filesystem, but absent in the database.
   It's useful if you're interested in cleaning up extraneous files,
   say after doing cp /lib/* /usr/bin/*, pkginfo -O will show you
   these files.
	-O  --orphans=[pattern]   list orphaned files except pattern

   Default exceptions pattern is (i.e. -O will not search for
   orphans in this directories):
   "^(dev|sys|proc|mnt|tmp|var|root|home|lost\\+found|boot|etc|
   lib/modules|opt|usr/var|usr/src|usr/ports|usr/local)"

9. pkgutils-c is more secure in sense that it using different
   database locking strategy. Using C++'ish pkgutils: user
   doing `flock -w 10000 /var/lib/pkg/db', and then root tries
   to do `pkgadd somepkg'. pkgadd will fail. Why? Because of
   mere user. If root doing it manually, it's okay, root will
   kill user's process. But if he/she just has put
   `prt-get sysup' into crontab? So, mere user can stop system's
   upgrades. Hard to exploit, but anyway... ;-)

10. rejmerge using $PAGER variable now (or `more' if no $PAGER
    specified) to display diff output.

>> Another news is: in addition to ARM and i686, pkgutils-c now
>> tested to work on PowerPC 32.
>
> ACK! verified on embedded PowerPC 32, gcc-4.2.1.
>
> I just want to complain about /etc/pkg{add,mk}.conf:
> Can you please tab-align the columns instead of using some odd
> number of spaces? Thank you!

Well. I'm not that against tabs, I prefer them but for indenting,
not for formating. Spaces for formatting helps people with tab
size != 8. Use vim?

aaa		bbb
cccccc		ddd

Looks okay? Try "set ts=4". Personally I use ts=8, which is
standard, so to me it's not a problem.

If I didn't convinced you, well okay... I'll change spaces to
tabs then. ;-)

Thanks,

-- 
Anton Vorontsov
email: cbou at mail.ru
backup email: ya-cbou at yandex.ru
irc://irc.freenode.net/bd2



More information about the CRUX mailing list