PHP and DEB (AR) Files.
Moderator: General Moderators
PHP and DEB (AR) Files.
Hey.
I'm working on a project that requires the breakdown of Deb files.
Basically, all I need to do is extract the "icon.png" from the deb file.
Is it possible with PHP? I've tried searching - googling, everything.
Thanks.
I'm working on a project that requires the breakdown of Deb files.
Basically, all I need to do is extract the "icon.png" from the deb file.
Is it possible with PHP? I've tried searching - googling, everything.
Thanks.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: PHP and DEB (AR) Files.
You can unarchive the deb with the 'ar' command. Then the icon you need is in the data file (either data.tar, data.tar.gz or data.tar.bz2). You use tar and if needed use switches to have it run through bunzip2 or gunzip.
-Shawn
-Shawn
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: PHP and DEB (AR) Files.
Thanks Shawn!
Could you link me to a tutorial that demonstrates the ar commands?
Could you link me to a tutorial that demonstrates the ar commands?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: PHP and DEB (AR) Files.
If you are on linux just type 'man ar' or check here: http://linuxmanpages.com/man1/ar.1.phpmofolo wrote:Thanks Shawn!
Could you link me to a tutorial that demonstrates the ar commands?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: PHP and DEB (AR) Files.
Is there anyway of doing this thru php?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: PHP and DEB (AR) Files.
Try using php.net as a resource: exec()mofolo wrote:Is there anyway of doing this thru php?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: PHP and DEB (AR) Files.
wow! it works!
Thanks for that Shawn!
Thanks for that Shawn!
Re: PHP and DEB (AR) Files.
I've got a new Problem with this...mofolo wrote:wow! it works!
Thanks for that Shawn!
After I unpack the .DEB file, I also decompress the TAR files with gzip.
One of the Tar files have a "postinst" file which chmods my directory to 777, thus giving me 500 errors.
Here is what im doing:
Code: Select all
exec("gzip -dc control.tar.gz | tar xf -");Thanks.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: PHP and DEB (AR) Files.
You don't need the control file, just the data file.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: PHP and DEB (AR) Files.
Thats true, but it still is being extracted from the TAR file.AbraCadaver wrote:You don't need the control file, just the data file.
And as that is happening, it is been executed! How can i avoid extracted this file?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: PHP and DEB (AR) Files.
Something like:
Code: Select all
ar x data.tar.gz whatever.deb
tar zxf data.tar.gzmysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.