summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2019-08-18 13:49:13 +0000
committerrillig <rillig@pkgsrc.org>2019-08-18 13:49:13 +0000
commite5a82a87ae0e55a5b60465d631068a7de1b5343f (patch)
treea217c512486d6f2c968504f524f4cba3bf5f54f3 /pkgtools
parentb6ab92b5f44fd83a54b3091b8b9807e3cbb57839 (diff)
downloadpkgsrc-e5a82a87ae0e55a5b60465d631068a7de1b5343f.tar.gz
pkgtools/url2pkg: consistently use double quotes for string literals
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/url2pkg/files/url2pkg.pl34
-rw-r--r--pkgtools/url2pkg/files/url2pkg.t32
2 files changed, 33 insertions, 33 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg.pl b/pkgtools/url2pkg/files/url2pkg.pl
index c7a8363e319..3d8726cbdc6 100644
--- a/pkgtools/url2pkg/files/url2pkg.pl
+++ b/pkgtools/url2pkg/files/url2pkg.pl
@@ -1,5 +1,5 @@
#! @PERL5@
-# $NetBSD: url2pkg.pl,v 1.57 2019/08/18 13:32:21 rillig Exp $
+# $NetBSD: url2pkg.pl,v 1.58 2019/08/18 13:49:13 rillig Exp $
#
# Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -37,9 +37,9 @@ use warnings;
# Build-time Configuration.
#
-my $make = '@MAKE@';
-my $libdir = '@LIBDIR@';
-my $pythonbin = '@PYTHONBIN@';
+my $make = "@MAKE@";
+my $libdir = "@LIBDIR@";
+my $pythonbin = "@PYTHONBIN@";
use constant true => 1;
use constant false => 0;
@@ -115,15 +115,15 @@ sub find_package($) {
sub update_var_append($$$) {
my ($lines, $varname, $value) = @_;
- return if $value eq '';
+ return if $value eq "";
my $i = 0;
foreach my $line (@$lines) {
if ($line =~ qr"^\Q$varname\E(\+?=)([ \t]+)([^#\\]*)(#.*|)$") {
my ($op, $indent, $old_value, $comment) = ($1, $2, $3, $4);
- my $before = $old_value =~ qr'\S$' ? ' ' : '';
- my $after = $comment eq '' ? '' : ' ';
+ my $before = $old_value =~ qr"\S$" ? " " : "";
+ my $after = $comment eq "" ? "" : " ";
$lines->[$i] = "$varname$op$indent$old_value$before$value$after$comment";
return;
}
@@ -193,7 +193,7 @@ my @todos;
my $pkgname = "";
# Example:
-# add_dependency('DEPENDS', 'package', '>=1', '../../category/package');
+# add_dependency("DEPENDS", "package", ">=1", "../../category/package");
#
sub add_dependency($$$$) {
my ($type, $pkgbase, $constraint, $dep_dir) = @_;
@@ -310,8 +310,8 @@ sub adjust_python_module() {
return unless -f "$abs_wrksrc/setup.py";
my %old_env = %ENV;
- $ENV{'PYTHONDONTWRITEBYTECODE'} = 'x';
- $ENV{'PYTHONPATH'} = $libdir;
+ $ENV{"PYTHONDONTWRITEBYTECODE"} = "x";
+ $ENV{"PYTHONPATH"} = $libdir;
my @dep_lines;
open(DEPS, "cd '$abs_wrksrc' && $pythonbin setup.py build |") or die;
@@ -451,8 +451,8 @@ sub generate_initial_package_Makefile_lines($) {
$homepage = "https://github.com/$org/$proj/";
$github_project = $proj;
if (index($tag, $github_project) == -1) {
- $pkgname = '${GITHUB_PROJECT}-${DISTNAME}';
- $dist_subdir = '${GITHUB_PROJECT}';
+ $pkgname = "\${GITHUB_PROJECT}-\${DISTNAME}";
+ $dist_subdir = "\${GITHUB_PROJECT}";
}
$distfile = "$tag$ext";
@@ -463,9 +463,9 @@ sub generate_initial_package_Makefile_lines($) {
$homepage = "https://github.com/$org/$proj/";
if (index($base, $proj) == -1) {
$github_project = $proj;
- $dist_subdir = '${GITHUB_PROJECT}';
+ $dist_subdir = "\${GITHUB_PROJECT}";
}
- $github_release = $tag eq $base ? '${DISTNAME}' : $tag;
+ $github_release = $tag eq $base ? "\${DISTNAME}" : $tag;
$distfile = "$base$ext";
} else {
@@ -559,8 +559,8 @@ sub adjust_package_from_extracted_distfiles()
no if $] >= 5.018, warnings => "experimental::smartmatch";
given ($f) {
next when qr"^\.";
- next when 'pax_global_header';
- next when 'package.xml';
+ next when "pax_global_header";
+ next when "package.xml";
next when qr".*\.gemspec";
default { push(@files, $f) }
}
@@ -640,7 +640,7 @@ sub adjust_package_from_extracted_distfiles()
close(MF1);
- update_var_append(\@lines, 'CATEGORIES', join(' ', @categories));
+ update_var_append(\@lines, "CATEGORIES", join(" ", @categories));
write_lines("Makefile-url2pkg.new", @lines);
diff --git a/pkgtools/url2pkg/files/url2pkg.t b/pkgtools/url2pkg/files/url2pkg.t
index 9659b74f773..c882a0c93c7 100644
--- a/pkgtools/url2pkg/files/url2pkg.t
+++ b/pkgtools/url2pkg/files/url2pkg.t
@@ -1,7 +1,7 @@
# -*- perl -*-
-# $NetBSD: url2pkg.t,v 1.1 2019/08/18 13:32:21 rillig Exp $
+# $NetBSD: url2pkg.t,v 1.2 2019/08/18 13:50:32 rillig Exp $
-require 'url2pkg.pl';
+require "url2pkg.pl";
use Test::More;
@@ -12,14 +12,14 @@ sub test_add_section__simple() {
my $lines = [];
add_section($lines, [
- var('1', '=', 'one'),
- var('6', '=', 'six'),
+ var("1", "=", "one"),
+ var("6", "=", "six"),
]);
is_deeply($lines, [
"1=\tone",
"6=\tsix",
- '',
+ "",
]);
}
@@ -27,14 +27,14 @@ sub test_add_section__alignment() {
my $lines = [];
add_section($lines, [
- var('short', '=', 'value'),
- var('long_name', '=', 'value # comment'),
+ var("short", "=", "value"),
+ var("long_name", "=", "value # comment"),
]);
is_deeply($lines, [
"short=\t\tvalue",
"long_name=\tvalue # comment",
- '',
+ "",
]);
}
@@ -42,19 +42,19 @@ sub test_add_section__operators() {
my $lines = [];
add_section($lines, [
- var('123456', '+=', 'value'),
+ var("123456", "+=", "value"),
]);
is_deeply($lines, [
"123456+=\tvalue",
- '',
+ "",
]);
}
sub test_var_append__not_found() {
my $lines = [];
- update_var_append($lines, 'VARNAME', 'value');
+ update_var_append($lines, "VARNAME", "value");
is_deeply($lines, []);
}
@@ -62,7 +62,7 @@ sub test_var_append__not_found() {
sub test_var_append__only_comment() {
my $lines = ["VARNAME=\t\t\t# none"];
- update_var_append($lines, 'VARNAME', 'value');
+ update_var_append($lines, "VARNAME", "value");
is_deeply($lines, ["VARNAME=\t\t\tvalue # none"]);
}
@@ -70,7 +70,7 @@ sub test_var_append__only_comment() {
sub test_var_append__value_with_comment() {
my $lines = ["VARNAME=\tvalue # comment"];
- update_var_append($lines, 'VARNAME', 'appended');
+ update_var_append($lines, "VARNAME", "appended");
is_deeply($lines, ["VARNAME=\tvalue appended # comment"]);
}
@@ -78,14 +78,14 @@ sub test_var_append__value_with_comment() {
sub test_var_append__value_without_comment() {
my $lines = ["VARNAME+=\tvalue"];
- update_var_append($lines, 'VARNAME', 'appended');
+ update_var_append($lines, "VARNAME", "appended");
is_deeply($lines, ["VARNAME+=\tvalue appended"]);
}
sub test_generate_initial_package_Makefile_lines__GitHub() {
- my $url = 'https://github.com/org/proj/archive/v1.0.0.tar.gz';
- my $pkgsrcdir = $ENV{'PKGSRCDIR'} or die;
+ my $url = "https://github.com/org/proj/archive/v1.0.0.tar.gz";
+ my $pkgsrcdir = $ENV{"PKGSRCDIR"} or die;
chdir("$pkgsrcdir/pkgtools/url2pkg") or die;
my @lines = generate_initial_package_Makefile_lines($url);