FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian dpkg

 
 
LinkBack Thread Tools
 
Old 02-28-2011, 10:55 PM
Jonathan Nieder
 
Default Getting to know dpkg's src/processarc.c

Hi again,

Sorry, my last message was much less helpful than it ought to be. Let
me try again.

First, I should have said _how_ to get the latest version of a Debian
package's source. I tend to use the 'debcheckout' command from the
devscripts package, like so:

debcheckout dpkg

Internally, this looks up the Vcs-Git (or Vcs-Bzr, Vcs-Svn, etc) field
in the control file for that package and grabs the sources from the
development repository.

Next, I should have noticed that you were talking about
src/processarc.c, a behemoth which begins with the text

* processarc.c - the huge function process_archive

So you are right to get lost there! A typical complex function should
fit in a 24-line terminal (simple functions can be longer), and
process_archive is certainly a complex function.

How can one make sense of it? One answer is to say, "You don't really
have to make sense of the entire function", to find the behavior
you're interested, and grapple with the relevant lines. I've already
given some hints towards doing that. Another answer is to split it
up into bite-sized (24-line, say) pieces which make sense
individually. Would you be interested in doing that?

If you run "gitk src/processarc.c" or "git log --patch
src/processarc.c", then you should be able to see a few examples of
patches that split interesting pieces of functionality out from the
process_archive function. If anyone wants to write patches making
such splits (one patch per new function, please, unless they are very
small) then I would be happy to review them.

Finally, I should have mentioned that it is possible process_archive
is not the right place for your plans. I simply haven't thought
deeply about it. (It seems more likely that archivefiles() is the
place for your hook.) So you should keep in mind that investing time
on process_archive might not bring you much closer to the immediate
goal if you are unlucky --- but no matter what, it would be helpful
for understanding dpkg's behavior.

Cheers.
Jonathan


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110228235509.GH1942@elie">http://lists.debian.org/20110228235509.GH1942@elie
 

Thread Tools




All times are GMT. The time now is 12:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org