[Hackage] #576: Show reverse dependencies

Hackage trac at galois.com
Fri Oct 2 08:06:50 EDT 2009


#576: Show reverse dependencies
--------------------------------+-------------------------------------------
  Reporter:  Lenny222           |        Owner:                 
      Type:  enhancement        |       Status:  new            
  Priority:  normal             |    Milestone:  HackageDB      
 Component:  hackageDB website  |      Version:  1.6.0.1        
  Severity:  normal             |   Resolution:                 
  Keywords:  dependencies       |   Difficulty:  easy (<4 hours)
Ghcversion:                     |     Platform:                 
--------------------------------+-------------------------------------------
Comment (by Roel van Dijk):

 A description of what my patch adds to hackage:

 An executable called pkg-rev-deps calculates the reverse
 dependencies of every package. It writes this information to a
 file called "revdeps.csv" inside the directory of a package.

 The package CGI script is modified to read this file. It will
 display the number of reverse dependencies right after the normal
 dependencies. The number of reverse dependencies is a link which
 will take you to a page containing a listing of all the reverse
 dependencies, direct and indirect. This page is rendered by a new
 CGI script called "revdeps".

 If you do not run pkg-rev-deps to generate the revdeps.csv files
 then package and revdeps will simply claim that there are no
 reverse dependencies.

 I have NOT added pkg-rev-deps to the post-upload-hook script,
 because I can't judge if the additional overhead will be to
 large. On my system pkg-rev-deps takes about 4.5 times as long as
 pkg-list to complete its run. About 60% of this time is spent
 parsing all the package descriptions. Memory usage is fairly low:
 around 10MB.

 New files:
  * !RevDepMap.hs    -- calculates reverse dependencies
  * pkg-rev-deps.hs -- generates revdeps.csv files
  * revdeps.hs      -- CGI script that lists reverse dependencies
  * !RevDepsPage.hs  -- implementation of the revdeps script

 Utils now contains a function to load the revdeps.csv file and
 some functions to calculate revdep related URLs. I also updated
 the .cabal and Makefile.

 I don't know if pkg-rev-deps should be added to the
 post-upload-hook. It already takes some time to upload a
 package. Perhaps it can be run in a cron-job 4 times a day.

 Some feedback would be really appreciated. I think that this is a
 feature which will really add some value to hackage. It can help
 you when deciding which package to use for you next project. It
 is also useful for developers as you get an idea how your
 package is being used.

-- 
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/576#comment:3>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects


More information about the cabal-devel mailing list