Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Kasyx on February 17, 2009, 11:48:27 AM

Title: Package Manager problems
Post by: Kasyx on February 17, 2009, 11:48:27 AM
Hi,

I've recently run into some issues with the package manager. I was originally running SMF1.1.5 (with no problems), however today I decided to update to SMF2.0RC1. Since I did that, I have been unable to install any new packages. What happens is that I would upload the package to be installed from my pc and then have the package manager install it. It would run all the tests successfully, and then I would install it. The package manager then tells me that the package was installed successfully, however upon further inspection it appears that nothing has been changed at all. All the files that are extracted appear, however it doesn't look like the package manager is making any changes to the files that require it. This happens with every package I attempt to install...

I tried now to delete everything off the server and do a full reinstall of SMF2.0RC1 over my current database, however I am still having this problem with the package manager.

Any help would really be appreciated, I am totally stumped.
Title: Re: Package Manager problems
Post by: genix on February 17, 2009, 01:52:38 PM
Yeah, bud, that's problem is bigger and bigger every day =)) More and more people tell here about that in different themes, but there is no solution yet =) I took a look today into Package.php, but didn't understand many things such as mktree function that creates a dir with CHMOD "755" and after that say me that there is a problem =)

I will try again and and again till somebody solve it or maybe me =)
Title: Re: Package Manager problems
Post by: bullbreedluverz on February 17, 2009, 02:04:35 PM
i had this problem updating from 1.1.8 to RC1 and tried a couple of times exporting the database and setting up a live clone of my forum and updating it and came to the same problems and the only way i found to actually upgrade and get the package manager to work was a pain in the butt -


I exported a partial database from my live site;

`smf_boards`
`smf_board_permissions`
`smf_categories`
`smf_collapsed_categories`
`smf_membergroups`
`smf_members`
`smf_permissions`
`smf_personal_messages`
`smf_pm_recipients`
`smf_settings`
`smf_topics`


then created a clean install of 1.1.8
dumped the same tables as i exported above from its database
imported the above tables exported from my live site
upgraded from 1.1.8 to 2 RC1
all works fine now, packages install

havent had a problem installing packages since upgrading this way but it was a annoying having to do this but i never saw any other solutions being put forward to get around the problem

has anyone found an easier way to do this that what i do to help others out ????

Title: Re: Package Manager problems
Post by: genix on February 18, 2009, 02:36:50 PM
Hey, guys, I worked hard two days all day long, but I hope I found a solution for my problem =)

I will make a mod of it, and give you, ok? =) HAHA, I'm kidding - you couldn't install mods at all))))

So, here is my description:

At first, the problem with error message about CHMOD:

Find in Sources/Package.php
if (!mktree($boarddir . '/Packages/temp', 0777))
{
deltree($boarddir . '/Packages/temp', false);
if (!mktree($boarddir . '/Packages/temp', 0777))
{
deltree($boarddir . '/Packages/temp', false);
create_chmod_control(array($boarddir . '/Packages/temp/delme.tmp'), array('destination_url' => $scripturl . '?action=admin;area=packages;sa=' . $_REQUEST['sa'] . ';package=' . $_REQUEST['package'], 'crash_on_error' => true));

deltree($boarddir . '/Packages/temp', false);
if (!mktree($boarddir . '/Packages/temp', 0777))
fatal_lang_error('package_cant_download', false);
}
}


Replace it with
mkdir($boarddir . '/Packages/temp', 0777);
/*
if (!mktree($boarddir . '/Packages/temp', 0777))
{
deltree($boarddir . '/Packages/temp', false);
if (!mktree($boarddir . '/Packages/temp', 0777))
{
deltree($boarddir . '/Packages/temp', false);
create_chmod_control(array($boarddir . '/Packages/temp/delme.tmp'), array('destination_url' => $scripturl . '?action=admin;area=packages;sa=' . $_REQUEST['sa'] . ';package=' . $_REQUEST['package'], 'crash_on_error' => true));

deltree($boarddir . '/Packages/temp', false);
if (!mktree($boarddir . '/Packages/temp', 0777))
fatal_lang_error('package_cant_download', false);
}
}
*/

I don't know why they do so hard manipulation with this directory, maybe I miss smth, but for me it works.


Next, if packages installed OK but nothing changed, try this manipulations:
Find in Sources/Subs-Package.php
if ($search['position'] === 'before')
{
$actual_operation['searches'][$i]['preg_search'] = '(' . $actual_operation['searches'][$i]['preg_search'] . ')';
$actual_operation['searches'][$i]['preg_replace'] = '$1' . $actual_operation['searches'][$i]['preg_replace'];
}
// After, after what?
elseif ($search['position'] === 'after')
{
$actual_operation['searches'][$i]['preg_search'] = '(' . $actual_operation['searches'][$i]['preg_search'] . ')';
$actual_operation['searches'][$i]['preg_replace'] .= '$1';
}

Replace with
if ($search['position'] === 'before')
{
$actual_operation['searches'][$i]['preg_search'] = '(' . $actual_operation['searches'][$i]['preg_search'] . ')';
$actual_operation['searches'][$i]['preg_replace'] = '\\1' . $actual_operation['searches'][$i]['preg_replace'];
}
// After, after what?
elseif ($search['position'] === 'after')
{
$actual_operation['searches'][$i]['preg_search'] = '(' . $actual_operation['searches'][$i]['preg_search'] . ')';
$actual_operation['searches'][$i]['preg_replace'] .= '\\1';
}


And one more:
Find
// Finally, we're doing some replacements.
$working_data = preg_replace('~' . $actual_operation['searches'][$i]['preg_search'] . '~s', $actual_operation['searches'][$i]['preg_replace'], $working_data);

And replace with
$working_data = ereg_replace($actual_operation['searches'][$i]['preg_search'], $actual_operation['searches'][$i]['preg_replace'], $working_data);


I think that's it... Maybe I missed something because I did so many edition till I was trying and now I don't remember maybe there was one more))

And one more thing - make files wich need to be changed permissions 666 =)

I even don't know maybe it will not work with many file operations in mod, but with the simple mod it was ok =)
Title: Re: Package Manager problems
Post by: bullbreedluverz on February 18, 2009, 02:44:11 PM
hope your edits work well for people as my way was a right pain in the butt
Title: Re: Package Manager problems
Post by: JimM on March 11, 2009, 10:29:35 PM
@Kasyx - Is this issue solved or do you still require assistance?  If this is solved feel free to mark it as solved otherwise reply with some details of what isn't working.