Tag Archive for 'patch'

03
Sep

Patch “how-to”, patch files fixed

I don’t really do much Unix development, but I’ve recently been learning more due to the care and feeding of my blog. Lately I’ve been figuring out some things about the patch utility, especially creating and applying patches. I found a decent tutorial on patch and diff which are the two tools needed to apply and create (respectively) patch files. The tutorial goes into much more depth than I would ever attempt. It’s also well written, so I’ll just point people there instead of re-inventing the wheel. But I think a “diff & patch” nutshell usage would be appropriate, so here it is.

Creating a patch (individual files) diff -u old-file new-file >patch-file

Creating a patch (whole directory/tree) diff -urN old-directory new-directory >patch-file

Applying a patch (individual file or whole directory/tree) patch <patch-file

While reading the article, I discovered that I had made some mistakes when I created at least one of my patchfiles, so I went through all my patch-related posts and re-created everything. I’m very glad I did! I found a whole bunch of small corrections I had made to BorderlineChaos which I’d forgotten to document and/or release in my post on Borderline Chaos’s date format. Likewise, I made many minor changes which I didn’t document in my journalized-blue post. Finally, the patch for Felix Wong’s tags plugin was definitely broken. I’ve corrected it and updated the original article.

02
Sep

Upgraded to WordPress 1.5.2, patches [re-]applied

I finally got around to upgrading my WordPress blog software to version 1.5.2 today. I also took this opportunity to apply Kimmo’s entity patch, which takes care of HTML entities ½ and ¾, and probably some others as well. At least I remembered to reapply the tags patch this time!

Applying these patches got me thinking about folks that aren’t “patch-aware”, i.e. don’t know how to apply patches. It’s almost trivially simple. On a Unix (or Unix-like) system, the command is: patch original-file patch-file where patch-file is the name of the file containing the patch(es), while original-file is the file that you are going to fix. This works fine as long as only one file is affected, as is the case with Kimmo’s patch. You can tell this by reading the patch file and looking for long lines of punctuation such as *************** or =================================================================== If you see more than one of these lines, there are multiple files affected. Such is the case with Felix Wong’s tags patch. For this one, the command is: patch -p1 <patch-file which should be executed from your wordpress directory. Explaining this command requires knowledge of directories/file structures, which I don’t want to cover right now.

23
Jun

New parameter for list_tags() cleaned up Sharepoint theme

A bit of hacking on Felix’s tags plugin (version 0.3.0) has cleaned up the Sharepoint theme. I added a new parameter, “countposts” (default true), to the listtags() function. This controls the display of number of posts. The patch is here, just right-click and save locally or use your browser’s “view source” command.

This code could probably be much cleaner, but it gets the job done for me right now. Enjoy!

Update: 2005-09-03 05:36 UTC–the patchfile has been fixed. See this article for more info.

23
Jun

Tags support finished on J-blue

I finished hacking up Journalized-Blue to support the tags plugin. Since this is the only theme I have finished (wrt tags), I have made this the default theme for my blog.

Replacing categories with tags for this theme turned out to involve only two files, index.php and leftcolumn.php. Patches for both files are below. I made the theme “tags aware”, so if you have the tags plugin, the theme will show tags wherever it now shows categories. If you want both tags and categories, it’d be very simple to hack the patched files so that categories were always displayed.

The patches are .txt files. I can’t recall how to force these to display “as is” (my http-fu is weak, I’ll admit), but you can either right-click on these links and save the files locally or simply click on the links and then use your browser’s “view source” command to see the straight .txt files.

Update: 2005-09-03 05:32 UTC I’ve created a single patchfile of all the changes I’ve made to Journalized-blue. More information is available in this article.

17
Jun

Borderline Chaos not honoring date format?

A fix to the awesome Borderline Chaos theme. I started noticing that my blog’s date format wasn’t being used, so I started poking around some more in the theme files. I found a couple of places where hard-coded date formats had been used. The following patches take care of these issues. Careful! I have been fiddling with the theme files already, so my line numbers may not match the master files’. A little human intervention may be needed, and the patches only involve three or four lines of code changes so it’s no biggee to take care of this manually.

index.php patch single.php patch

I tried using the function “the_date()” out of template-functions-general, but it’s a little too smart for its own good–this function automagically hides the date if it’s the same as the “previousday”, i.e. if the first two posts are dated the same, the date will show up on the first one but it will be suppressed on the second one.

Update: 2005-09-03T05:26 UTC As mentioned in this article, I created a single patchfile containing all the changes I made to Borderline Chaos. I’ll document these later.




December 2008
M T W T F S S
« Nov    
1234567
891011121314
15161718192021
22232425262728
293031  

Tags

abramoff accessibility acetylene activism aerial photo afrofunk aim4tree air america airport express alite alito amtrak andante andy anti failure any browser apache apple apple pie applescript arden arcade arden park ariana arnold ashland astronomy attic attika audio avid reader backup baen bart bathroom bbq bee beef begonia bgg bike bike hikers bike journal bikejournal biketalk bill oreilly bittorrent blacklist blog bloggercode blogroll blueberry boardgamegeek boardgames bonjour book bookcrossing boot failure bootcamp borderline chaos bugmenot bush business card cabinetry caira caitlin california candamir caroline carpet cat cateye cdrom celebration cellular phone century cheese chicken chico chimney chinese chipotle chocolate christmas chumby city bikes civilization cjd claire club club fed co op coconut coffee comfort food community computer concord congress conquest conservation consumer reports copyright costco crazybikerchick crepe crock pot cruftbox css csus curl currency custard cvntrak dagoba daniel goetz darwinports datarescue date format death delicious monster democracy now Democrat demolition dessert dickens diff disaster discrimination discworld dishwasher diskwarrior dixie belle dock doors downing street memo drm dryer drywall dump ed burke eff eggs eject election electric car electric truck electrical electricity elvgren email energy efficiency eric meyer esr etext euthanasia facebook family faq faux news feed feedreader fence finder firefox first4internet first amendment fishmeal flash flickr flooring foreign exchange foundation fox and goose framing freebsd freedback fyq garage garden geek geotag geourl gnutar go gonuls google google earth google maps gpl gracenote graywater greek green group concat gtd gunthers gutters gwbush gymnastics hacking halloween ham handspring hardwood harry potter headmeta high speed photograph high tech inv hoax hobbies hobby hodgins holiday holly home power magazine horcrux houseblogs how to html humor hvac ilovejackdaniels impeach inspection insulation intel internet ipod ipodder iq iraq isight itunes ivins iwantsandy java city javascript joint chiefs joseph jott journalized blue judges cup kctc khs kimkerry kitchen kyocera la salles la times labor landscape laundry law leatherbys legal lego leopard lhc liberal library linkedin ljurban lodi logic logo lungren maaloufs mac macaroni macbook mailinator malware map marin markdown mason media media clip media reform meetup metric mexican microsoft mike comfort military milonic mindstorms mlk model railroading modoc hall monterey morning sedition motorcycle movie moving munchkin murray mushroom music mynetflix mysql naked lounge nerd score netflix network new urbanism new year New Yorker nofollow nutella oatmeal obama obcz occidental occupation omni openssl oracle organic osx owp paint pair palast palm panasonic parallels party patch peak adventures peak oil pear pedestrian village perl petaluma php ping pingback pingomatic pingomation pingqueue pirate pl sql planet bike plasma playroom entertainment plugin plugin:preview theme plugin:text control plugin:ultimate tag warrior plumbing podcast podsite politics portupgrade potato powerbook printer programming project gutenberg pryde punk puzzle qiana quilt quilt shop quiz quote r5 records racism radio railroad recent comments recipe redalt remodel resaurant resolution restaurant restore review richmond rio americano robotics roger niello ron montana roof rootkit rss sacbee sacog sacramento sacramento spotlight magazine salad san francisco sandwich santa cruz scam scandal school days scplugin security session report shakespeare shuffle sigma siriradha sitemap snl snopes social social network software soma somafab sonicchicken sonicchicken blog sony spam spam karma spellcheck spinach spirit spoiler etiquette spring hill cheese sql sqlserver stairs standards statcounter stephen king stop loss stucco stunt subversion sudoku superbowl superhero supreme court sushi svn sysadmin tacoma tags plugin takara technology telephone television template terms and conditions textcontrol thai kitchen thanksgiving theater theme theme:borderline chaos theme:elvgren theme:elvgren wordpress google code theme:fluid blue theme:fullwidth theme:head theme:journalized theme:journalized blue theme:psycho theme:redoable theme:sharepoint like theme:simple green theme:spirit theme:steam theme:wuhan theme:yadda theme switcher thomas tigris euphrates tile tinfoil hat toc tofu tower theater training transit transit oriented development tribute u haul uneasy rhetoric university village van zant veterans day video vie viking hobby vote smart w3c wall warboss washer washington post weather web web developer web server wikipedia windows wishlist woodworking wordpress workplace wpblacklist wpgatekeeper wsj yaaarr yard