diff -Nru daptup-0.12.2/daptup daptup-0.12.5/daptup --- daptup-0.12.2/daptup 2011-11-12 18:50:05.000000000 +0000 +++ daptup-0.12.5/daptup 2011-12-02 16:50:08.000000000 +0000 @@ -58,23 +58,16 @@ my $filter = main::get_pkg_list_description_filter(); my $binary_name = $self->get_cache_binary_name(); - system(qq/$binary_name search ".*" $filter 2>$errors_file | sort | uniq > $output_file/); + system(qq/$binary_name search ".*" 2>$errors_file $filter | sort | uniq > $output_file/); } sub get_updates { my ($self, $output_file) = @_; - my @installed_package_names; - my $dpkg_query_output = `dpkg-query -l`; - foreach my $dpkg_output_line (split("\n", $dpkg_query_output)) { - if ($dpkg_output_line =~ m/^ii..(.+?) /) { - push @installed_package_names, $1; - } - } - - my $installed_package_names_string = join(' ', @installed_package_names); my $binary_name = $self->get_cache_binary_name(); - my $policy_output = `$binary_name policy $installed_package_names_string 2>/dev/null`; + my $get_installed_package_names_command = q/dpkg -l | grep "^ii" | awk '{ print $2 }'/; + # shell may reject too long lists of arguments, xargs automatically handles that + my $policy_output = `$get_installed_package_names_command | LC_MESSAGES=C xargs $binary_name policy 2>/dev/null`; # 'apt-cache policy' somewhy outputs blocks in random order, not as # specified in the command line (#......), use hash @@ -107,7 +100,7 @@ open(my $output_file_fd, '>', $output_file); foreach my $package_name (@watched_packages) { - my $policy_output = `$binary_name policy $package_name 2>/dev/null`; + my $policy_output = `LC_MESSAGES=C $binary_name policy $package_name 2>/dev/null`; my ($version_string) = ($policy_output =~ m/$preferred_version_sub_regex/o); chomp($version_string); say $output_file_fd "$package_name $version_string"; @@ -156,7 +149,7 @@ my $command = qq/aptitude search "~n($regex)"/; $command .= qq/ --display-format $ENV{DAPTUP_WATCH_DISPLAY_FORMAT}/; $command .= qq/ --width "$ENV{DAPTUP_WATCH_DISPLAY_WIDTH}"/; - $command .= qq/ $ENV{DAPTUP_EXTRA_APTITUDE_ARGUMENTS} > $output_file/; + $command .= qq! $ENV{DAPTUP_EXTRA_APTITUDE_ARGUMENTS} 2>/dev/null > $output_file!; system($command); } } @@ -439,7 +432,7 @@ lprint("Building old list of packages... "); $backend->get_avail_pkg_list($new_before_file, $errors_file_path); - if (-s $errors_file_path) { + if (-s $errors_file_path and -z $new_before_file) { if (system("grep '^E:' $errors_file_path") == 0) { lsay("errors present. Is apt/dpkg running?"); exit 8; diff -Nru daptup-0.12.2/debian/changelog daptup-0.12.5/debian/changelog --- daptup-0.12.2/debian/changelog 2011-11-12 18:50:05.000000000 +0000 +++ daptup-0.12.5/debian/changelog 2011-12-02 16:50:08.000000000 +0000 @@ -1,3 +1,29 @@ +daptup (0.12.5) unstable; urgency=low + + * Apt and Cupt back-end: don't pass long strings to 'echo' commands as well. + (Closes: #650517) + + -- Eugene V. Lyubimkin Fri, 02 Dec 2011 18:49:17 +0200 + +daptup (0.12.4) unstable; urgency=low + + * Apt and Cupt back-ends: don't pass too long list of arguments to + the shell. (Closes: #650517) + + -- Eugene V. Lyubimkin Thu, 01 Dec 2011 21:13:29 +0200 + +daptup (0.12.3) unstable; urgency=low + + * Don't error out at building old list of packages when a package manager + throw errors but a result is not empty. (Closes: #637738, #649244) + * Aptitude back-end: searching for watched packages: fixed suppressing the + standard error stream. + * Always prefix 'apt-cache policy' and 'cupt policy' calls with LC_MESSAGES. + * Apt and Cupt back-ends: fixed suppressing the standard error stream at + building lists of packages when showing short descriptions is turned off. + + -- Eugene V. Lyubimkin Sun, 27 Nov 2011 16:45:42 +0200 + daptup (0.12.2) unstable; urgency=low * The action '--last' does not require root privileges anymore.