GetSnappy.com Technology Blog
Tips & Techniques We've Learned From Practice
Upgrading FreeBSD port java/openjdk6 from b16 to b17
As the maintainer of the java/openjdk6 port for FreeBSD I recently took on the challenge of upgrading the java/openjdk6 port from b16 to the newly released b17. I’ve decided to blog about, partly to document my efforts to review when b18 comes out, but also to share the process with all that are interested.
I started by downloading the new zip from http://download.java.net/openjdk/jdk6/, and updating the distinfo and Makefile for the port to use the b17 bundle.
Next I went to extract and apply patches. I got a weird message during the extraction process that the hotspot/linux/Makefile didn’t exist. This seemed unusual at first, but it turns out there is a post-extract section in the ports Makefile that was copying and running sed expressions, to create bsd files from linux versions. A couple of directories and files needed to be removed, then I moved on to the patching process.
I optimistically tried to patch but patch died complaining about a hunk ordering mismatch. I tried to work with the single patch-set file for several minutes before deciding to take a different approach and split the patch. I separated the single patch file so that every file that required a patch had its own patch file. This allowed me to deal with patches on a file by file basis. I found splitpatch.rb at http://www.clearchain.com/~benjsc/download/splitpatch/splitpatch.rb, and slightly modified the output filename, and quickly got the job done.
Next I seperated patches that applied cleanly from patches that had errors using the following command and parsing the results by hand.
find /usr/ports/java/openjdk6/files/brian1/ -name \*patch\* -print -exec bash -c "patch -lsC < {};" ';' 2&1; | less
Of 288 total files patched, 221 patches merged successfully and 67 patches failed. I started addressing the failed patches by categorizing them. There where 34 makefiles, 13 build files, 12 src files, 6 agent files, and 2 uncategorized files.
My plan was to apply all the clean patches, then hand merge the rest, build, then recreate the patch-set at the very end. I started by making a non-patched work directory using the command make extract. Then I created two copies of this directory called orig and work-progress. I would perform all work inside of work-progress and copy any modified files into the work directory to test my changes. I planned to use orig for creating the patch-set from my modified work-progress copy.
If I made numerous changes, or wanted to verify the entire patch I would start with a fresh copy of my work-progress directory.
# equivalent of a make clean rm -rf work && cp -Rp work-progress work
There was one file that proved to be a pain to patch. hotspot/src/os/bsd/vm/os_bsd.cpp, would not patch with the following error message.
patch: **** misordered hunks! output would be garbled
I started hand merging the patch, and after 15 minutes, I thought to myself there had to be a better way. I decided to split the patch into individual hunks using the splitpatch.rb script, and apply each hunk individually. It worked like a charm, and only one of the hunks had to be hand merged. I did have to instruct patch as to which file these hunks applied to be passing hotspot/src/os/bsd/vm/os_bsd.cpp as an extra argument.
However compiling this file resulted in an error. Some hunks were applied in obviously incorrect locations. Turns out the default fuzz factor of two, was the culprit. I reapplied the patch with a fuzz factor of 0, and this time three hunks failed and needed to be applied by hand. I bet if I tried a fuzz factor of 0, with the original non-split-by-hunk patch that it would have succeeded with the three rejects.
There were lots of small errors that occurred during the building process. All of them were very minor and required small simple changes. Where error lead my to applying patches for PR #138348 and PR #139452. One thing I found very handy for speeding up the porting process was setting the BUILD_
#default BUILD_BUILD_CORBA=true \ BUILD_JAXP=true \ BUILD_JAXWS=true \ BUILD_HOTSPOT=true \ BUILD_MOTIF=true \ BUILD_JDK=true
#only build the hotspot BUILD_CORBA=false \ BUILD_JAXP=false \ BUILD_JAXWS=false \ BUILD_HOTSPOT=true \ BUILD_MOTIF=false \ BUILD_JDK=false
I finally got a clean building work-progress directory after making a lot of little tiny fixes and reapplying some patches.
Below is the script I used to create the patchset from my modified source:
#!/bin/sh
rm -rf /usr/ports/java/openjdk6/work-pristine;
cp -rp /usr/ports/java/openjdk6/work-progress /usr/ports/java/openjdk6/work-pristine;
cd /usr/ports/java/openjdk6/work-pristine;
find ./ -name \*.rej -exec rm '{}' ';'
find ./ -name \*.orig -exec rm '{}' ';'
find ./ -name \*sC -exec rm '{}' ';'
diff -uNr ../orig/ ./ > ../files/make1/patch-set
You can gain early access to this port by downloading it from:
http://www.getsnappy.com/downloads/openjdk6-b17-pr2.tar.gz
To install:
cd /usr/ports/java tar -xjf <path_to_tar_bundle>/openjdk6-b17-pr2.tar.gz cd openjdk6-b17 make
Pre Release 2 features these fixes:
- no more ugly fonts!
- locale data is now correct
- supports building on 9.0 current
- include fastdebug build options creates a mirrored /usr/local/openjdk6-fastdebug installation
March 6, 2010 - 4:46 am
Ewgwergjhvw buy acomplia order diflucan buy lorazepam tramadol hcl alprazolam online purchase generic viagra online order viagra discount fluoxetine buy zithromax order adipex buy sertraline order lamisil buy vardenafil generic diazepam online acomplia online
March 6, 2010 - 5:33 am
Lomwefgbnbv discount lorazepam order generic viagra lorazepam online buy viagra buy azithromycin vardenafil ultram online order viagra soma online buy inderal buy ambien lorazepam buy valtrex purchase fluoxetine discount xanax diazepam online
March 6, 2010 - 6:19 am
Ewgwergjhvw generic viagra fosamax online adipex online acomplia online soma no prescripion buy purchase alendronate sodium retin a online buy generic viagra online discount adipex generic diflucan online order meridia order lorazepam canada generic viagra online generic indera onlinel purchase furosemide purchase valacyclovir lasix order lamisil
March 6, 2010 - 7:06 am
Wefwjnegjjw edición lorazepam lorazepam edición phentermine buy flagyl acomplia generic lorazepam online compare price retin a acomplia online buying sildenafil online viagra online order lamisil purchase reductil purchase generic viagra online buy furosemide cheap adipex
March 7, 2010 - 10:23 am
generic valium 12385 phentermine 1704 antivert pravachol aciphex actos nexium hzsicm 350 carisoprodol domain mgmail333 5029
March 7, 2010 - 11:19 am
valium 8377 aciphex >:]]] retin zoloft
carisoprodol qvac
March 7, 2010 - 1:50 pm
prednisone =-))) doxycycline 212221 doxycycline bzqyo buy propecia online 09027
March 7, 2010 - 2:42 pm
buy cialis 902366 xanax prescriptions gkwnz doxycycline zox tramadol propecia uuvox buy tramadol wholesale :]
March 8, 2010 - 8:01 am
Lomwefgbnbv tramadol on sale buy valium online price viagra meridia online buy valium online order retin a no prescripion buy lorazepam online buy klonopin online clonazepam price zoloft buy prescription tramadol adipex buy brand flagyl inderal buy phentermine pills diazepam online order valium online xanax online
March 8, 2010 - 9:20 am
Jusdbfedfwf buy discount levitra buy diazepam lasix order online diazepam buy valium alprazolam uk sales generic viagra online valium visa phentermine mail order order ultram discount acomplia buy tramadol price phentermine phentermine without prescription buy diazepam
March 8, 2010 - 10:19 am
Ewgwergjhvw price zithromax diazepam sale buy phentermine lasix buy discount lasix buy viagra viagra price zoloft generic viagra no prescripion ativan drugs for sale buy soma order tramadol online klonopin visa lasix online cheap levitra
March 8, 2010 - 11:23 am
Hjuasdfasef compare price lasix buy acomplia online online retin a online klonopin online sale fosamax pills online buy generic viagra buy discount tramadol lorazepam alprazolam order prozac no prescripion buy valium online retin a online phentermine online order cialis alprazolam order viagra buy
March 8, 2010 - 12:19 pm
Lomwefgbnbv propranolol buy propranolol order diazepam online buy discount acomplia buy lasix pills online valtrex acomplia online discount tramadol buy soma tramadol online online lamisil online sale tramadol order diazepam online inderal online adipex order online buy cialis cheap levitra
March 8, 2010 - 2:19 pm
Wefwjnegjjw diazepam online buy adipex online order lorazepam order acomplia buy alprazolam order retin a generic adipex buy inderal online buy cialis from india viagra no prescripion buy valtrex online inderal no prescripion buy lasix lamisil buy tramadol online zithromax online order discount prozac
March 8, 2010 - 3:20 pm
Hjuasdfasef diflucan no prescripion order fosamax inderal order discount soma acomplia online valium online buy discount tramadol buy sertraline buy viagra pills online buy ativan where buy klonopin online buy inderal pills online soma online sale buy reductil compare price xanax order diflucan online diazepam ambien no prescripion buy adipex buy
March 8, 2010 - 4:20 pm
Ewgwergjhvw cheap adipex generic adipex online lamisil online buy fosamax viagra generic viagra online order tramadol buy generic viagra online generic adipex discount carisoprodol buy metronidazole propranolol edición acomplia online buy retin a where discount flagyl online
March 8, 2010 - 8:27 pm
Jusdbfedfwf buy valium indera onlinel generic valium online generic viagra
March 8, 2010 - 9:27 pm
Hjuasdfasef editar generic valium online purchase tadalafil order discount prozac
March 9, 2010 - 5:40 am
Lomwefgbnbv edición generic phentermine online ultram online purchase cheap xanax klonopin diazepam online tramadol hcl buy metronidazole generic lamisil online acomplia online adipex online buy xanax online fosamax online purchase retin-a buy viagra online lorazepam online
March 9, 2010 - 7:40 am
Jusdbfedfwf buy lasix purchase generic ambien buy adipex online indera onlinel order diazepam flagyl online discount tramadol buy zithromax sale ambien online buy fosamax generic lasix online buy diflucan buy ativan soma fosamax online adipex online buy generic cialis acomplia online buy generic viagra online
March 9, 2010 - 8:39 am
Ewgwergjhvw fluoxetine ultram online klonopin online order ativan edición buy cheap xanax generic prozac online order viagra online compare price flagyl buy zolpidem tramadol hcl order soma tramadol generic prozac online discount soma buying viagra online buy sibutramine
March 9, 2010 - 9:38 am
Jusdbfedfwf generic viagra order generic ambien online sale fosamax order xanax online order flagyl purchase cheap adipex order lamisil purchase metronidazole generic viagra online ultram online generic cialis buy valtrex purchase ambien cr lasix online generic soma online lorazepam online valium alprazolam
March 9, 2010 - 10:37 am
Wefwjnegjjw discounting viagra online purchase azithromycin purchase cheap levitra fluoxetine alprazolam without prescription viagra online lasix buy buy alprazolam azithromycin ambien online buy fluoxetine discount meridia buy cheap adipex indera onlinel sertraline
March 9, 2010 - 11:37 am
Wefwjnegjjw order zoloft edición tadalafil buy viagra online purchase cheap adipex order lasix buy lorazepam pills buy cheap phentermine acomplia azithromycin propranolol buy ambien pills generic xanax alprazolam zithromax online purchase terbinafine discount diflucan acomplia online order valtrex
March 9, 2010 - 1:22 pm
buy pills tramadol ownq valium imsle accutane ghzawo cialis on line >:-)))
March 9, 2010 - 2:23 pm
Made the stupid ring up form dusk to not shuffle off this mortal coil completely, earlier checking the scrap time and sickly forcast.
!!!!
woke up to a wads morning and to then know that it was a best 7-9:30am nosh beat .. would own been supreme out there.
Hope some of you got entirely and did the business.
March 9, 2010 - 2:34 pm
Ewgwergjhvw
March 9, 2010 - 3:59 pm
buy 150 tramadol >:-DD generic brands for ultram 1108 generic xanax lyzqm prednisone :-]
March 9, 2010 - 4:28 pm
buy intravenous tramadol kevd accutane qtdirx buy cialis online 089 prednisone online vzmyh
March 9, 2010 - 7:15 pm
tramadol %OO buy accutane 9272 aciphex phentermine alprazolam online pharmacy :[[ doxycycline 0226
March 9, 2010 - 9:46 pm
buy tramadol without priscription rmbmbq aciphex 20mg pnsulw ultram 8-[[ prednisone online vdpk
March 10, 2010 - 12:11 am
valium online =P what is ambien
doxycycline lwoy ultram kucbaq
March 10, 2010 - 2:38 am
tramadol qyr valium xanax bars order cheap pbdnv xanax and grapefruit 538 ambien mdfze
March 10, 2010 - 3:07 am
tramadol 96343 accutane 46639 valium 68472 order doxycycline 153579