summaryrefslogtreecommitdiff
path: root/dselect/methods
AgeCommit message (Collapse)AuthorFilesLines
2015-01-28perl: Switch from legacy File::Path functions to new onesGuillem Jover1-4/+4
Use make_path() instead of mkpath(), and remove_tree() instead of rmtree().
2015-01-28build: Rename perl scripts to have a .pl extensionGuillem Jover5-4/+26
This allows to easily replace the shebang at installation time to use the system perl interpreter and will make it easier to analyze all perl scripts in the source tree.
2014-10-06perl: Use length instead of /^$/ to test for an empty stringGuillem Jover1-2/+2
Addresses RegularExpressions::ProhibitFixedStringMatches. Warned-by: perlcritic
2014-10-06dselect: Quote the FTP package name instead of trying to manually escape itGuillem Jover1-3/+1
2014-10-06scripts: Use named variables instead of using the topic variableGuillem Jover1-12/+12
Switch code that uses roughly more explicit instances of the topic variable than implicit ones. Addresses BuiltinFunctions::ProhibitUselessTopic. Warned-by: perlcritic
2014-10-06dselect: Remove unnecessary handling of obsolete Package_Revision fieldGuillem Jover1-1/+0
This is automatically handled by «dpkg-deb --field» now that it uses the libdpkg deb822 parser.
2014-08-09Use https:// URLs instead of http:// when possible (round two)Guillem Jover1-1/+1
Switch more URLs, now that these services have had SSL enabled.
2014-05-17perl: Fix unused capture groups false positivesGuillem Jover1-2/+2
These are false positives, as when there's no match perl will leave the subpattern variables untouched. We'll just use the opportunity to unconfuse perlcritic, making some of those variable usages more clear by using intermediate variables. Fixes RegularExpressions::ProhibitUnusedCapture. Warned-by: perlcritic
2014-05-17perl: Do not use global match variablesGuillem Jover2-6/+6
Fixes Variables::ProhibitMatchVars. Warned-by: perlcritic
2013-12-07Use https:// URLs instead of http:// when possibleGuillem Jover13-13/+13
2013-12-04perl: Surround FileHandles with braces in print callsGuillem Jover2-2/+2
Fixes InputOutput::RequireBracedFileHandleWithPrint. Warned-by: perlcritic
2013-12-04dselect: Use warn instead of print STDERR in method scriptsGuillem Jover5-8/+8
Addresses InputOutput::RequireBracedFileHandleWithPrint. Warned-by: perlcritic
2013-12-04perl: Use croak instead of die on programming errors in modulesGuillem Jover1-1/+2
Addresses ErrorHandling::RequireCarping. Warned-by: perlcritic
2013-12-04perl: Switch to use low precedence boolean operators for error checksGuillem Jover4-11/+11
This will make it safe to remove parenthesis around builtins.
2013-12-04perl: Try to avoid boolean operators after predicates on error checksGuillem Jover2-10/+16
Using boolean operators after predicates for error checking makes the code flow slightly confusing, do that only after actions, to check if they succeeded and error out otherwise.
2013-11-24perl: Always check open() return valueGuillem Jover1-2/+4
Fixes InputOutput::RequireCheckedOpen. Warned-by: perlcritic
2013-11-24Consistently use regex instead of regexp when possibleGuillem Jover1-1/+1
All changed instances are documentation or private code interfaces. The only remaining variable instance with a regexp name is a publicly exposed variable, which will eventually disappear once it has gone through the deprecation process.
2013-11-24Dselect::Ftp: Uppercase public %config package variableGuillem Jover4-54/+55
This module has a problematic license, so there's no point in doing a more intrusive cleanup, just uppercase the variable and be done with it. Addresses Variables::ProhibitPackageVars. Warned-by: perlcritic
2013-11-24dselect: Make $ftp variable file global in ftp install methodGuillem Jover1-6/+6
The code is already using a $::ftp variable to be able to cleanup on errors, just move the definition of the $ftp variable outside of the download() function. Addresses Variables::ProhibitPackageVars. Warned-by: perlcritic
2013-11-23perl: Do not allow hard tabs anywhere other than leading positionGuillem Jover2-7/+10
Fixes CodeLayout::ProhibitHardTabs. Warned-by: perlcritic
2013-09-19Decapitalize error and warning messagesGuillem Jover5-16/+17
2013-06-22perl: Add a VERSION to all modulesGuillem Jover1-0/+2
Addresses Modules::RequireVersionVar.
2013-06-22perl: Place strict and warning pragma uses as the first thingGuillem Jover1-3/+3
2013-06-22perl: Decapitalize variable namesGuillem Jover1-5/+5
Addresses NamingConventions::Capitalization.
2013-05-08perl: Use my-style lexical loop iterator variablesGuillem Jover3-27/+20
The variables used on a foreach loop are local to that block, so if we wanted to use it after the loop is finished the last value would be gone. Fixes Variables::RequireLexicalLoopIterators. Warned-by: perlcritic
2013-05-08perl: Conditionally include modules with require instead of useGuillem Jover1-2/+2
Fixes Modules::ProhibitConditionalUseStatements. Warned-by: perlcritic
2013-05-08perl: Unify regex delimiters to //, {} or <>Guillem Jover2-4/+4
Fixes RegularExpressions::ProhibitUnusualDelimiters. Warned-by: perlcritic
2013-05-08Remove trailing whitespacesGuillem Jover3-5/+5
Do not fix the shlibs conffiles to avoid possible useless prompts. Fixes CodeLayout::ProhibitTrailingWhitespace. Warned-by: perlcritic
2013-05-08perl: Use correct comparison operator for each typeGuillem Jover1-1/+1
Fixes ValuesAndExpressions::ProhibitMismatchedOperators. Warned-by: perlcritic
2013-05-08perl: Remove unused variablesGuillem Jover3-4/+2
Fixes Variables::ProhibitUnusedVariables. Warned-by: perlcritic
2013-05-04Do not use double-quotes on strings that do not need interpolationGuillem Jover4-92/+94
Using double-quotes imposes a small performance penalty as the perl parser needs to check if any interpolation is needed. Use double-quotes only when the string contains single-quotes. Ideally we'd use double-quotes too for escaped meta-characters that might otherwise be confusing to immediately see if they need interpolation or not, but the policy does not (currently) allow to ignore these. Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
2013-04-30Do not quote simple identifier hash keys in element accessesGuillem Jover6-52/+54
Addresses ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
2013-04-28Fix file descriptor leaks in perl codeGuillem Jover1-0/+1
2013-04-28Use proper variables instead of barewords for filehandlesGuillem Jover2-23/+25
Fixes InputOutput::ProhibitBarewordFileHandles. Warned-by: perlcritic
2013-04-24Use three-argument form of open in perl codeGuillem Jover2-8/+10
Fixes InputOutput::ProhibitTwoArgOpen. Warned-by: perlcritic
2013-04-24dselect: Stop using 'use vars' in method scriptsGuillem Jover3-9/+5
This also fixes a typo ($VAL1 → $VAR1), and adds %config to the Dselect::Ftp module exported variables.
2013-04-24Dselect::Ftp: Inherit Exporter's import methodGuillem Jover1-1/+2
2013-04-23dselect: Remove unused diagnostics pragmasGuillem Jover3-4/+0
2013-04-23Debian::Dselect::Ftp: Move module to Dselect::FtpGuillem Jover5-11/+2
This gets rid of the need to hardcode the perl module path in the scripts. The Dselect methods are not really Debian specific anyway.
2013-04-19Explicitly quote HEREDOC markers in perl codeGuillem Jover3-3/+3
This makes the HEREDOC quoting-style used explicit, so that it's obvious if the code text will get interpolated or not. Fixes ValuesAndExpressions::RequireQuotedHeredocTerminator. Warned-by: perlcritic
2013-04-19Use just 'return' instead of 'return undef' in perl codeGuillem Jover1-2/+2
This makes sure the functions always return the appropriate value independent of the context. Fixes Subroutines::ProhibitExplicitReturnUndef. Warned-by: perlcritic
2013-04-19Remove Emacs and vim modelinesGuillem Jover6-8/+0
These just clutter the code base, as adding modelines for each possible editor out there does not scale, and they are currently not exhaustive anyway.
2013-04-19dselect: Use strict and warnings in perl scriptsGuillem Jover1-0/+2
2013-04-19Debian::Dselect::Ftp: Add a package declarationGuillem Jover1-0/+2
2013-04-19dselect: Add missing license headersGuillem Jover10-3/+122
These do not change any license, they just clarify the current state. For old dselect methods that were already present in the dpkg project, the license remains GPL2+, for files imported from the dpkg-ftp and dpkg-multicd projects the license remains GPL2-only for now.
2012-05-04build: Use MKDIR_P instead of obsolete mkdir_pGuillem Jover1-5/+5
Autoconf provides an AC_PROG_MKDIR_P macro defining MKDIR_P which is called by AM_INIT_AUTOMAKE; the obsolete mkdir_p, currently aliased to MKDIR_P will disappear with automake 1.13.
2012-03-27Do not use `' quote pairs for non-translatable stringsGuillem Jover6-76/+76
2011-12-13Do not use absolute paths for programs in perl and shell codeGuillem Jover5-10/+10
The location of programs on the filesystem is not standardized, and as such using absolute paths is not a portable assumption to make. This causes test suite errors on at least Mac OS X. Use just the program name on perl system() calls, when needing the full path use Dpkg::Path::find_command() in perl code and “which” in shell code. Reported-by: Stuart Ambler <stuart@zulazon.com>
2011-08-20Fix spelling errorsGuillem Jover1-1/+1
Found by codespell.
2010-11-19Cleanup white spacesGuillem Jover3-4/+0
Remove trailing spaces. Remove blank lines not separating different code blocks. Remove blank lines at the end of the file.