coldguy
Posts: 23
Joined: Mon Jul 02, 2012 9:22 pm

Contents file in repository?

Tue Jul 17, 2012 3:23 am

Would it be possible to generate a Contents file and place it in the Raspbian repository? This file is optional metadata that can be included in an apt repo that indexes the filenames contained within the packages in the repository. There are several tools that make use of it, but the reason I really want it is for command-not-found; after it's installed, typing in an unknown command produces this message:

Code: Select all

Could not find the database of available applications, run update-command-not-found as root to fix this
Running update-command-not-found (which just runs apt-file update, really) gives me this:

Code: Select all

Ignoring source without Contents File:
  http://archive.raspbian.org/raspbian/dists/wheezy/main/Contents-armhf.gz
I'm not sure what tool is being used to maintain the Raspbian repo, but I use reprepro at work and I know it can automatically generate the Contents file for you when you add packages.

plugwash
Forum Moderator
Forum Moderator
Posts: 3439
Joined: Wed Dec 28, 2011 11:45 pm

Re: Contents file in repository?

Tue Jul 17, 2012 7:45 am

coldguy wrote: I'm not sure what tool is being used to maintain the Raspbian repo, but I use reprepro at work and I know it can automatically generate the Contents file for you when you add packages.
We also use reprepro. Would you happen to know the configuration setting to make it generate contents files or do I have to dig through the documentation to find it?

coldguy
Posts: 23
Joined: Mon Jul 02, 2012 9:22 pm

Re: Contents file in repository?

Tue Jul 17, 2012 3:33 pm

We use:

Code: Select all

Contents: udebs percomponent allcomponents
..in conf/distributions for our repos, which is the maximal setting and generates an index for the udebs, one per "component" the repo, and then one for the entire repo. That is possibly overkill, though; reprepro's documentation indicates that pre-wheezy, allcomponents was the norm, and for wheezy and beyond, percomponent is the default. Based on the URL apt-file was looking for, it's going the percomponent way. So:

Code: Select all

Contents: percomponent
...may be sufficient, but the official Debian repo appears to do all three, so if you want to look the most like that, that's probably the way to go. Note that it does take a bit of time for reprepro to generate and maintain these files, so it's going to slow things a bit when you're changing things in the repo, but the performance hit didn't seem to be TOO awful to me. Your mileage may vary.

Run "reprepro export $DIST" after adding the line to conf/distributions to generate them for the first time.

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Contents file in repository?

Tue Jul 17, 2012 9:50 pm

The Content files have been generated and should be part of the next update of the Raspbian public repositories in the next few hours.

coldguy
Posts: 23
Joined: Mon Jul 02, 2012 9:22 pm

Re: Contents file in repository?

Thu Jul 19, 2012 5:46 am

Thanks, command-not-found is happily correcting my typos now :)

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Contents file in repository?

Thu Jul 19, 2012 6:47 pm

Can someone confirm that the Contents files are now being generated in the repository as expected? If so, I just want to close this issue. Thanks.

coldguy
Posts: 23
Joined: Mon Jul 02, 2012 9:22 pm

Re: Contents file in repository?

Fri Jul 20, 2012 2:51 am

Everything appears to be in the right place. apt-file is happy, so is update-command-not-found. I'm getting suggestions for packages I haven't installed yet, as expected. It looks like the timestamps on the Contents files are later than the timestamps on the associated Packages files. You might want to have someone else spot check it, but everything looks good to me.

Return to “Raspbian”