whobutdrew: (Default)
Drew ([personal profile] whobutdrew) wrote in [site community profile] dw_dev2009-09-04 09:25 pm

(no subject)

Hi all! I've been tinkering with creating an LJ site of my own on and off for a bit, but as [profile] firefoxfey can tell you, with vanilla LJ, its been made of fail, because manually configuring Apache 1.3.x and I don't mix. So when she told me that DW was Apache2 friendly, I thusly said YAY! And have been excited about getting my hands dirty again.

I've run into my first problem. I saw this, which the same problem that I am running into. Contained within the comments is the link to this patch, which I have saved as foo.patch in my $LJHOME directory. When I try to run

patch -p0 < foo.patch

I get this:

dw@ubuntu:~$ patch -p0 < foo.patch
can't find file to patch at input line 12
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|angeset patch
|# User Andrea Nall <anall@andreanall.com>
|# Date 1247811160 0
|# Branch production
|# Node ID 3c20fe0db2767b39cf1d1594d8e0b3541e83555a
|# Parent a9fbb12e6ff89198ffded1e9235801b2994ce47b
|[mq]: DWFreeOnly
|
|diff -r a9fbb12e6ff8 -r 3c20fe0db276 cgi-bin/LJ/User.pm
|--- a/cgi-bin/LJ/User.pm Thu Jul 16 22:10:15 2009 -0500
|+++ b/cgi-bin/LJ/User.pm Fri Jul 17 06:12:40 2009 +0000
--------------------------
File to patch:

Based on that, I try to give it $LJHOME/cgi-bin/LJ/User.pm, which doesn't exist, so the script failed. I got the same thing when I sudo'd the command. I also tried to run

hg qimport foo.patch

From here: http://wiki.dwscoalition.org/notes/Patches#Applying_Patches

And I got 'parameter not recognized.'

I'm an IT tech by day, so you can drop some technobabble at me, but I am NOT by any means a programmer/developer! I took a class of Perl in college, but that's about it. This is also my first foray into building a server other than a fileserver.

So please. Tell me what probably simple thing I'm doing wrong so I can move on to squeeing about finally getting a webserver workening!
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2009-09-05 04:41 am (UTC)(link)
I've found that you need to be in the ~/dw directory, not ~, and you need to use patch with -p1, not -p0:

cd ~/dw
patch -p1 < ../foo.patch
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2009-09-05 04:58 am (UTC)(link)
Nope -- that just means that the patch is old enough that there have been other changes to the file in the meantime (the patch is a month and a half old, and we make enough changes in any given week that it's pretty likely a patch won't apply cleanly after a week or two).

I've poked the person who came up with the patch in Bugzilla in order to get her to redo the patch! In the meantime, you can manually patch User.pm by finding the sections in question and copying/retyping the patched bits.
kareila: (Default)

[personal profile] kareila 2009-09-05 05:06 am (UTC)(link)
I went ahead and updated the patch. Here's the new version:

http://bugs.dwscoalition.org/attachment.cgi?id=2279
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)

[personal profile] sophie 2009-09-05 05:31 am (UTC)(link)
In your case, the easiest way to revert would be quite simple - simply copy the files from your cvs/ directory:

cd $LJHOME
cp cvs/dw-free/cgi-bin/LJ/User.pm cgi-bin/LJ/User.pm
cp cvs/dw-free/cgi-bin/ljlib-local.pl cgi-bin/ljlib-local.pl
cp cvs/dw-free/htdocs/_config.bml htdocs/_config.bml

...and then try again.

(ljlib-local.pl will be deleted by the patch anyway, but you may as well copy it just so patch gets what it's expecting)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)

[personal profile] pauamma 2009-09-05 12:43 pm (UTC)(link)
Not sure, reading the above comments, whether you still need help with hg qimport, but in case you do:

- Make sure you have the following lines in your ~/.hgrc:
[extensions]
hgext.mq =

- If you still get errors, check the syntax of hg qimport using
hg help qimport

- If none of the above helps, reply with the exact command line and the complete output from hg.
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)

[personal profile] pauamma 2009-09-05 07:25 pm (UTC)(link)
I don't have a ~/.hgrc file in /home/dw. Perhaps that's a problem?
Not you want to use the MQ extension. Then you need to create one with these lines in it.
foxfirefey: A firework bursts over the Las Vegas night skyline. (yay)

[personal profile] foxfirefey 2009-09-05 08:09 pm (UTC)(link)
Hey! Good to see you here and working things out! DW does still have niggling stuff we need to fix for other installations (though I still think we're heads above vanilla LJ code), but we want to fix it as you can see, and we're excited to have other people using our stuff!
Edited 2009-09-05 20:09 (UTC)