diff options
author | Peter Palfrader <peter@palfrader.org> | 2010-11-20 10:41:49 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2010-11-20 10:41:49 +0000 |
commit | 3a14873f716c3c5e506359ef8da14e68c057034b (patch) | |
tree | 1ae5b7e600c75139c648b0d86e57f87d5d613a69 | |
parent | bbc72ece8a62d9c3c159b84acfb0543d434db697 (diff) |
Call dpkg without involving a shell
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@461 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-x | sort-deb | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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)} <>); |