modify code in ports, but `make` doesn't know

When I do as below:

Code:
cd /usr/ports/www/larbin
make fetch
make extract
make patch
cd work/larbin-2.6.3
// modify options.h
cd ../..
make
// the progress is showed
// then modify options.h and make again as above, but nothing is made,
// all the *.o and larbin in working/larbin-2.6.3/src stay the same

What's the proper way to rebuild?
 
Oh ok. In that case make a custom patch from the modified source and drop it in the files directory of the port.
 
kpa said:
Oh ok. In that case make a custom patch from the modified source and drop it in the files directory of the port.
Please forgive a really dumb question, but how does one go about doing that? My alternative now is to just copy off the modified files and drop them back in later after an update.
 
Code:
# cd /usr/ports/<whatever>/<whatever>
# make patch
# cd work/<srcdir>
# cp options.h options.h.orig
# ee options.h
# diff -u options.h.orig options.h > ../../files/patch-options.h
# cd ../..
# make clean
# make patch
<check that options.h got patched correctly>
# make build
<repeat the patch, edit, diff, clean, build steps as needed>
 
If you want to create a patch for a file, make a copy of that file with .orig extension. Then edit the file and apply your changes. Finaly run make makepatch in the port directory. The patch file will be saved in the files directory.

For example, I want to create a patch for something.c:

% make extract
% cd work/src # ${WRKSRC}
% cp something.c something.c.orig
% ee something.c
% cd /path/to/port/directory
% make makepatch

EDIT: Sorry, posted at same time with @phoenix.
 
Last edited by a moderator:
phoenix said:
Code:
# cd /usr/ports/<whatever>/<whatever>
# make patch
# cd work/<srcdir>
# cp options.h options.h.orig
# ee options.h
# diff -u options.h options.h.orig > ../../files/patch-options.h
# cd ../..
# make clean
# make patch
<check that options.h got patched correctly>
# make build
<repeat the patch, edit, diff, clean, build steps as needed>

# diff -u options.h options.h.orig > ../../files/patch-options.h
should be
# diff -u options.h.orig options.h > ../../files/patch-options.h
 
bkouhi said:
If you want to create a patch for a file, make a copy of that file with .orig extension. Then edit the file and apply your changes. Finaly run make makepatch in the port directory. The patch file will be saved in the files directory.

For example, I want to create a patch for something.c:

% make extract
% cd work/src # ${WRKSRC}
% cp something.c something.c.orig
% ee something.c
% cd /path/to/port/directory
% make makepatch

EDIT: Sorry, posted at same time with @phoenix.

I think makepatch is a good interface, but the implementation that hard coding the file name as *.orig is not very good, I preferred the diff way.
 
Last edited by a moderator:
jronald said:
Code:
# diff -u options.h options.h.orig > ../../files/patch-options.h
should be
Code:
# diff -u options.h.orig options.h > ../../files/patch-options.h

Oh. Good catch. Thanks. Was going by memory.
 
wblock@ said:
Yes, but last I looked it gives patches poor names. The Porter's Handbook shows the preferred style, using the path as part of the name.

Yeah, but can't you just rename the patch file after its created? I've never used makepatch, or even heard of it until now, so not sure exactly how I works.
 
Back
Top