[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to test for architecture in perl base pre/postinst scripts ?



On Mon, Feb 23, 2004 at 11:20:10AM -0800, Don Armstrong wrote:
> On Mon, 23 Feb 2004, Sven Luther wrote:
> > Yeah, seems reasonable, now i only need to find out how to call it
> > from perl.
> 
> %arch = split /[=\n]/, qx(dpkg-architecture) or die q(dpkg-architecture failed);
> 
> should do nicely. [dpkg-architecture should exist once dpkg has been
> unpacked...]

Mmm, the following was recomended to me :

  # Get the architecture we are running on, to set silent_modules on powerpc.
  open(FILE, "dpkg-architecture -qDEB_HOST_ARCH |");
  undef $/;
  $arch = <FILE>;
  close(FILE);

As said, i am no perl expert, is this better or worse than your solution ? 

Friendly,

Sven Luther



Reply to: