43 Commits (wip)
 

Author SHA1 Message Date
Johannes 'josch' Schauer cd5dfbbbf2 wip 7 years ago
Johannes 'josch' Schauer ff96767b2f General rewrite of the codebase
0. Overview
===========

This commit message contains the following sections:

 * Rationale
 * Removed features
 * Changed behaviour
 * New features
 * Regressions
 * Code quality improvements

1. Rationale
============

The old code base suffered from:

 * The overuse of global variables (80) which were freely used by
   functions to store their results in as side-effects of their actual
   computation.
 * Underdocumented configuration file settings. Some values are only
   mentioned in the passing while documenting other things in the man
   page. Some values are not mentioned at all.
 * Repetition of code snippets. Some functions only differed slightly
   but were copy-pasted to create new versions. Configuration parsing
   and dumping copy-pasted value conversion multiple times instead of
   working with value types.
 * Abuse of system() and backticks without escaping special shell
   characters instead of passing an array to system().
 * Missing error checks when system() or backticks are used.
 * Non-existence of unit tests.
 * rm -rf your whole filesystem with the right configuration parameters

This commit *reduces* the lines of code in the main program from 1390
down to FIXME while at the same time *increasing* the ratio of comments
to lines of code from 0.06 to FIXME and *adding* additional features and
fixing the problems listed above.

2. Removed features
===================

 * The --source-dir command line option and retainsources configuration
   variable have been removed as the feature of downloading source
   packages corresponding to the installed binary packages was deemed
   out of scope for multistrap
 * The workarounds for dash not configuring (#546528) and absolute
   /lib64 symlinks (#553599) were dropped as they are not needed anymore
 * Removed support for dpkg without multiarch

3. Changed behaviour
====================

 * They keyring setting does not accept packages anymore but either
   keyring files or directories with .gpg files in them. This is so that
   multistrap does not have to install a package on the host system (which
   requires superuser privileges) nor is it anymore required that the apt
   sources of the host system contain the right mirrors to retrieve the
   desired keyring packages nor is it anymore required that the selected
   keyring package stores the keyring at the location where sbuild expects
   them.
 * Any additional keyring package now has to be manually listed in the
   packages setting as they are no longer installed automatically. This
   now also makes it possible to bootstrap a system without the keyring
   packages that were required to install it.
 * Die if setupscripts, configscripts or hook produce an error instead
   of continuing.
 * Die if the specified debconf seed file does not exist.
 * Be more unforgiving about problems. Previous to this commit,
   multistrap would
    - skip loop iterations with invalid values
    - print a warning if errors happen but continue anyways
   Now we die with an appropriate error message immediately.
 * The component now has to be passed explicitly in each section

4. New features
===============

 * Configuration files can now be nested arbitrarily deeply.
 * All configuration variables are documented together with their
   default values and data types.
 * Dumping the configuration settings creates another valid
   configuration file. This can be used to merge multiple configuration
   files into a single one containing the resulting settings.

5. Regressions
==============

 * The translations need updating for the new and changed strings.

6. Code quality improvements
============================

6.1. General
------------

 * Replaced 80 global variables by 2 which are only used for reading.
 * Removed unused variables.
 * Removed unused or superfluous code.
 * Functions have no side-effects on variables anymore. Everything they
   compute is part of their return value.
 * Instead of using "." and join() to create a whitespace delimitered
   string which is then split(), push to an array in the first place.
 * Make file a modulino to let it be used as a program and module at the
   same time. This allows the unit tests to import functions from it.
 * Use Getopt::Long for option parsing.
 * Use Pod::Usage for --help and man output.

6.2. Less dependencies
----------------------

 * Drop dependency on Config::Auto for Config::IniFiles. The latter
   comes with support for all sorts of configuration file formats which
   we do not need. The later offers features not exposed by the former
   (like automatically ignoring case) which in turn simplifies the code.
 * Replace Locale::gettext by Dpkg::Gettext which makes the availability
   of gettext optional. Dpkg::Gettext is available anyway because we
   plan to use Dpkg::Index instead of Parse::Debian::Packages.

6.3. Unit tests
---------------

Add tests:
 - t/config.t for the recursive ini file reader
 - t/critic.t for perlcritic
 - t/perltidy.t for perltidy
7 years ago
Johannes 'josch' Schauer 3f77f992e5 Add some FIXME comments 8 years ago
Johannes 'josch' Schauer 17d528a5c9 remove unused functions our_version and check_multiarch_dpkg 8 years ago
Johannes 'josch' Schauer 59273c1239 Remove $host from global variables 8 years ago
Johannes 'josch' Schauer cb3d6d4655 Do not retrieve and print version 8 years ago
Johannes 'josch' Schauer 2bd1bd4eee remove support for old dpkg without multiarch support 8 years ago
Johannes 'josch' Schauer aa2cfef40b introduce main() function and remove 36 global variables 8 years ago
Johannes 'josch' Schauer 13e9f08da8 Start maintaining Debian packaging in its own branch (make packaging non-native) 8 years ago
Johannes Schauer ea4d9ecd08 release 2.2.8 to unstable 8 years ago
Johannes Schauer ddc8835b42 Install more default configurations (for trusty, wheezy, jessie, stretch, and sid) 8 years ago
Johannes Schauer 0dc5ce4019 Add missing whitespace between arguments in system() command 8 years ago
Johannes Schauer 6b7510ae2f Release 2.2.7 to unstable 8 years ago
Johannes Schauer 76fd93c6fa Since bash completion was moved away from /etc, invoke rm_conffile in maintainer script 8 years ago
Johannes Schauer 530b7db9da Release 2.2.6 to unstable 8 years ago
Johannes Schauer 388d1f032a Add Ubuntu examples for Trusty (closes: #847061) 8 years ago
Johannes Schauer 45d773e38b Fix value for Dir::Etc::Trusted to point at trusted.gpg outside of trusted.gpg.d 8 years ago
Johannes Schauer 34ab336d0f release 2.2.5 to unstable 8 years ago
Johannes Schauer 3ebbfff204 Remove Neil Williams from Uploaders 8 years ago
Johannes Schauer 76683efe48 release 2.2.4 to unstable 8 years ago
Johannes Schauer 1ba0cdddd4 handle keyring download differently:
- do not (re)install keyring package on the host system (closes: #787438 )
 - do not disable SecureApt when using fakeroot (closes: #846776)
8 years ago
Johannes Schauer c826eb7e99 Release 2.2.3 to unstable 8 years ago
Johannes Schauer e41a1a3614 The B-D-A header doesn't make any sense without Architecture:any packages to be built. Move them to B-D-I. 8 years ago
Johannes Schauer a959d16a22 upload 2.2.2 to unstable 8 years ago
Johannes Schauer 67c12d18e3 Stop creating /etc/dpkg/dpkg.cfg.d/multiarch (closes: #819103) 8 years ago
Johannes Schauer 2d1a5dc6fa Allow shell special characters (including spaces) in paths (closes: #803365) 8 years ago
Johannes Schauer 4067756e25 Allow uppercase letters in paths (closes: #751896) 8 years ago
Johannes Schauer 5c106953dc Do not try to feed GPG keybox database version 1 files to apt (closes: #845963) 8 years ago
Johannes Schauer ea21dd0f87 Use dh_bash-completion to install bash completion script 8 years ago
Johannes Schauer 3b2ecc2732 Switch debian/rules to dh and drop cdbs 8 years ago
Johannes Schauer 5288400af3 Bump debhelper compatibility level to 10 8 years ago
Johannes Schauer 299fb8ab88 Move B-D on po4a to Build-Depends-Arch (it's not needed for the clean target) 8 years ago
Johannes Schauer 87df45649f Move development to dgit 8 years ago
Johannes Schauer 55670c1360 New maintainer 8 years ago
Neil Williams bb0e9566a9 release update 9 years ago
Neil Williams ece5596723 Use environment for apt config.
* Use environment variables for apt configuration instead of Dir::Etc.
  Patch from Pip Cet <pipcet@gmail.com> (Closes: #774698)
9 years ago
Neil Williams 5a265f764a Drop old crossbuild support reliant on outdated support. 9 years ago
Neil Williams 08bff7d818 [INTL:pt] Updated Portuguese translation of manpage (Closes: #756217) 9 years ago
Neil Williams 2c179e4ab1 Update for Jessie release 9 years ago
Neil Williams b6308896b4 Switch example mirror in usage information. (Closes: #774476) 9 years ago
Neil Williams 1e5ba3f243 Move to github
No need for a watch file, use the Vcs fields.
9 years ago
Neil Williams b9a7184cff add a watch file for new location 9 years ago
Neil Williams 680a0c6fca Add option to specify the apt default release directly.
* Add option to specify the apt default release directly and
  change the manpage content to advise on how this further
  complicates the permutations of apt configuration. Add
  commands to direct apt at the apt.conf.d and preferences.d
  directories within the chroot. (Closes: #717886)
9 years ago