You are not logged in.

#1 2011-09-10 03:22:51

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

nosr: pkgfile reborn

This project has been renamed pkgfile and replaces pkgfile from pkgtools in the official repos.

To continue my trend of absurd application naming, I present: nosr: It's pkgfile in pure C, with mostly the same feature set but a bit more robustitude (aka not parsing pacman debug output).

Usage: nosr [options] target

 Operations:
  -l, --list              list contents of a package
  -s, --search            search for packages containing the target (default)
  -u, --update            update repo files lists

 Filtering:
  -b, --binaries          return only files contained in a bin dir
  -g, --glob              enable matching with glob characters
  -i, --ignorecase        use case insensitive matching
  -R, --repo REPO         search a specific repo
  -r, --regex             enable matching with pcre

  -h, --help              display this help and exit
  -v, --verbose           output more

Dependencies are currently:

  • glibc (derp)

  • pcre

  • libcurl (this becomes libalpm once pacman 4.0 is released)

  • libarchive

It's, of course, in the AUR under nosr-git. Source and manpage are available on github.

I'll also throw it out there that this is somewhat of a prototype for functionality to be added in pacman. It's not yet certain what form it'll take -- a separate binary or integration into /usr/bin/pacman itself, but I'm fairly confident that this will be shipped in some form with pacman 4.1. Go forth, find me bugs. Give me reasonable feature requests. Become a wizard.

Q: Wat. Why nosr?
Randy Morris (rson) was the inspiration for me to write cower. Given how many people enjoy it, I figure it was fitting to give him some credit in some small way.

Q: Does Daenyth approve of this?
Yup. He's already agreed to bequeath to me the name pkgfile should this end up as a separate binary -- a situation which I think would benefit everyone.

Last edited by falconindy (2012-09-15 18:13:47)

Offline

#2 2011-09-10 04:01:10

estevao
Member
From: Vitória, ES - Brazil
Registered: 2009-10-13
Posts: 100
Website

Re: nosr: pkgfile reborn

Sweet! smile

Offline

#3 2011-09-10 04:14:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: nosr: pkgfile reborn

Not actually nosr-related, but maybe you know why some repos don't provide files.tar.gz?
I've asked on the wiki and I've e-mailed a few maintainers asking them why they don't provide files db but got zero response <sad panda>

Offline

#4 2011-09-10 04:50:33

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,503
Website

Re: nosr: pkgfile reborn

karol wrote:

Not actually nosr-related, but maybe you know why some repos don't provide files.tar.gz?
I've asked on the wiki and I've e-mailed a few maintainers asking them why they don't provide files db but got zero response <sad panda>

Because it requires more work...   I doubt I will ever provide one for my repo.

Offline

#5 2011-09-10 05:00:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: nosr: pkgfile reborn

Allan wrote:
karol wrote:

Not actually nosr-related, but maybe you know why some repos don't provide files.tar.gz?
I've asked on the wiki and I've e-mailed a few maintainers asking them why they don't provide files db but got zero response <sad panda>

Because it requires more work...   I doubt I will ever provide one for my repo.

So it's a bit like changelogs? Makes sense.

Offline

#6 2012-01-06 23:44:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: nosr: pkgfile reborn

I like the % counting when running 'nosr -u' - very neat :-)

[karol@black ~]$ nosr -u
  testing.files.tar.gz                      149.02 KiB [100.00%]
  community-testing.files.tar.gz             15.42 KiB [ 55.55%]
...


I have a little question: pacman got updated and I had to rebuild nosr due to soname bump. Are you using any automated way of doing this?

Offline

#7 2012-01-07 00:41:55

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: nosr: pkgfile reborn

libarchive was updated, forcing a rebuild. My policy is: when it breaks, I rebuild it.

Last edited by falconindy (2012-01-07 00:42:09)

Offline

#8 2012-01-07 00:57:16

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: nosr: pkgfile reborn

falconindy wrote:

libarchive was updated, forcing a rebuild.

My New Year's resolution was to drink less coffee but I somehow don't think it's going to work ;P
Thanks for your patience & sorry for my slip-ups.

Offline

#9 2012-07-06 16:53:58

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: nosr: pkgfile reborn

Shameless self bump. I've spent some time over the past few days looking for performance improvements in nosr and cleaned up a few bugs. Results have yielded a ~40-60% reduced runtime, making it now 5-10x faster than pkgfile.

For those curious, the major changes:
- backport fixes in alpm's archive_fgets() function (we had a really silly bug that trounced throughput here)
- repack downloaded repo files as uncompressed CPIO archives.
- read repo files with mmap (and prefault the mapped pages with MAP_POPULATE).
- use PCRE's JIT option for pre-compiling regexes.
- avoid matching binaries such as /opt/bin/foo/bar/baz. Only match binaries which are in an immedate bin directory (like /bin/baz).
- new feature: -d, --directory: enable matching/printing directories

Still only available as a -git package.

Last edited by falconindy (2012-07-06 19:47:25)

Offline

#10 2012-07-29 18:03:04

dodo3773
Member
Registered: 2011-03-17
Posts: 818

Re: nosr: pkgfile reborn

Great application. Really like it (assuming nosr has actually been renamed back to pkgfile?). I was writing a command not found function for it last night ( https://bbs.archlinux.org/viewtopic.php … 0#p1138610 ) and realized this morning that you had already done so haha. I have a question about the function though. Why does it return 0 error code instead of 127 when the command is found? So that you know pkgfile itself is working correctly? Or did you do it that way to suppress the "bash: $1: command not found" message?

Offline

Board footer

Powered by FluxBB