Skip to content

yaobinwen/dpkg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dpkg: Annotated Version

Overview

I've added comments to the code for a learning purpose. See the package's original README for more details.

When installed on a machine, the main dpkg scripts (e.g, dpkg-buildpackage) are installed by the package dpkg (in /usr/bin), but the Dpkg module is installed by libdpkg-perl (in /usr/share/perl5/Dpkg).

Quick Pickup

If you haven't looked at the source code for a wile, you will likely have forgotten what you had learned earlier. Here is the list to help you quickly pick up what you learned about dpkg before:

  1. Start with scripts/dpkg-buildpackage.pl because this file has many notes about basic syntax and usage of Perl. Find the comments with NOTE(ywen) and read through them from top to bottom.
  2. .pl files are Perl scripts; .pm files are Perl modules. If you want to find some code, e.g., a subroutine, do find in both kinds of files.
  3. The module Dpkg::ErrorHandling defines the subroutine error (see sub error($;@)) that prints a message and exits. You can use this function to test the behavior of the code.
  4. Perl uses print to print a message. For example: print "SOURCE_DATE_EPOCH = $ENV{SOURCE_DATE_EPOCH}\n";. See this doc and this tutorial for more details.
  5. Perl requires ; to end a statement. Make sure you write it.

Packages

No packages published

Languages

  • C 41.7%
  • Perl 33.9%
  • Roff 7.6%
  • C++ 6.2%
  • Makefile 6.1%
  • Shell 2.5%
  • Other 2.0%