From 3a14873f716c3c5e506359ef8da14e68c057034b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 20 Nov 2010 10:41:49 +0000 Subject: Call dpkg without involving a shell git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@461 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- sort-deb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sort-deb b/sort-deb index 37e90ad..fc760f1 100755 --- a/sort-deb +++ b/sort-deb @@ -24,9 +24,10 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# change the argument to system calls to a list. -- Peter Palfrader sub dpkgcmp{my ($i,$j)=@_;chomp $i;chomp $j; - return system(" dpkg --compare-versions $i lt $j " ) * 1 - + system(" dpkg --compare-versions $i gt $j " ) *-1; + return system('dpkg', '--compare-versions', $i, 'lt', $j) * 1 + + system('dpkg', '--compare-versions', $i, 'gt', $j) *-1; ;} print (sort {dpkgcmp($a,$b)} <>); -- cgit v1.2.3