#!/bin/csh # http://berklix.com/~jhs/bin/.csh/customise # NAME # ~/bin/.csh/customise # SEE ALSO # ~/bin/.sh/customise_more_links # SYNOPSIS: customise [src_or_ports [release]] # Feeds from http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/ # EXAMPLES OF GOOD SYNTAX # customise # assumes /usr/src & /usr/ports # customise src # customise ports # customise src 9.2-RELEASE # customise ports 9.3-RELEASE # customise /usr/src 6.4-RELEASE # customise /usr/src 12.2-STABLE # customise /usr3/ports CURRENT # customise /usr4/src # EXAMPLE OF BAD SYNTAX # customise src ports 9.3-RELEASE # AUTHOR "Julian H. Stacey" # COPYRIGHT # Copyright Julian H. Stacey, Munich 1993-2021. # Free Software. All Liability Disclaimed. # DESCRIPTION # This Cshell script starts with a standard FreeBSD src &/or ports tree, # then applies my tree of local customisations, # - Directories ending _imp are imports # - Directories ending _gen contain code of generic interest. # - Directories ending _jhs contain code of personal interest. # JJLATER I should canonise that eg change all _jhs to _personal # - File ending .diff are used to patch the target tree. # only patch if release matches. # - ending eg *.REL=ALL.diff are used to patch regardless of release. # - Files ending .cust_rel These are # - Not patch files to be applied by this customise script, # - Not random raw data files to be installed regardless # of version, # - but are files, typically containg ports/*/*/files/patch-* # only, to be installed if the release name matches. # ASSUMPTIONS # I assume /usr/src & /usr/ports point to valid trees. # ANNOYANCES, NOT EXACTLY BUGS: # Produces links like this: # /usr1/work/freebsd/2.2.8-RELEASE/src/contrib/nvi/\ # LN.README.JHS -> \ # /.amd_mnt/user/usr/home/jhs/public_html/src/bsd/fixes/FreeBSD/\ # src/gen/./contrib/nvi/README.JHS # If run on a laptop in standalone mode one gets a pointer to # /usr/backup/host/user/usr/home/jhs/...... # which will be out of date when returning to work @ main site. # In both cases it would be better to do a x=`cd ~;pwd` # & then replace all future path containing $x with the # meta path /usr/home/jhs # If run on laptop it produces eg # /sys/i386/conf/HOLZ.LN@ -> # /usr/home/jhs/._/public_html/src/bsd/fixes/\ # FreeBSD/src/jhs/./sys/i386/conf/HOLZ # which later takes the obsolete frozen config., # not newer one on home site master host=user. # FILES: # http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen # http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/jhs # http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/ports/gen # http://www.berklix.com/~jhs/src/bsd/fixes/FreeBSD/ports/jhs # SEE ALSO # Alternate approaches that do similar but not the same: # Mk/ patches: # http://lists.freebsd.org/pipermail/freebsd-ports/2016-May/103179.html # Mount overlays: # mount -t nullfs -o ro /pub/FreeBSD/SVN/ports /usr/ports # mount -t unionfs -o ro /usr/local/ports /usr/ports # Mk/bsd.port.mk: EXTRA_PATCH_TREE new in 2017Q2 # ----- # I wonder how others manage, & whether I should offer my script to # a list, &/or whether FreeBSD might benefit from some standard out # of tree naming conventions, so that one could import other people # patch tree[s] easier. # ----------------------------------------------------------------------------- set Item_Log = "`printenv HOME`/tmp/customise_host=`hostname -s`.log" # Warning Do Not Normal Create ${Item_Log} # Because if it exists , after every install & after every patch # that matches the release, another cycle will be run of: { cd # /usr/src ; make all ; make install } which is an extreme debugging # measure only for the desperate, (added 2019-05 for tracing, after builds # failed after customising src/ ). set Item_Start = "Test Starting {" set Item_End = "Test Ending }" set ECHOINFO = "echo" # one off initial info: noisier # set ECHOINFO = "true" # one off initial info: quieter # set ECHOCOPYING = "echo" # per item report of copying: noisier set ECHOCOPYING = "true" # per item report of copying: quieter # set ECHOIGNORING = "echo" # per item report of ignoring: noisier set ECHOIGNORING = "true" # per item report of ignoring: quieter # set ECHOINSTALLING = "echo" # per item report of installing: noisier set ECHOINSTALLING = "true" # per item report of installing: quieter set ECHOPATCHING = "echo" # per item report of patching: noisier # set ECHOPATCHING = "true" # per item report of patching: quieter # set ECHOSKIPPING = "echo" # per item report of skipping: noisier set ECHOSKIPPING = "true" # per item report of skipping: quieter # set ECHOCREATED = "echo" # per item report of skipping: noisier set ECHOCREATED = "true" # per item report of skipping: quieter # set ECHOBLANK = "echo" # per item report of skipping: noisier set ECHOBLANK = "true" # per item report of skipping: quieter set ECHOERROR = "echo" # set ECHODEBUG = "echo" set ECHODEBUG = "true" $ECHOINFO "Parameters: $*" $ECHOINFO "Number of parameters: $#" if ( "$#" == "3" ) then # JJLATER improve to >= 3. echo "Error: More than 2 parameters not allowed, " echo "[optional src_or_ports [and optional release number]]." exit 1 endif set OS_NAME = `uname -s` set UNAME_R = `uname -r` # Or cheat & modify newvers.sh # Cludge list can assign a provisional patch set if I have not yet had time to # go through the path directory making explicit links from an old to a new release, # (& later removin links that fail to apply to new, copying links to files, & updating patches) # for faster moving stable, I may sometimes below switch back to last release. echo "uname -r | grep STABLE : `uname -r | grep STABLE`" echo "uname -r | grep '\-p' : `uname -r | grep '\-p'`" echo "Caution: If you are running a stable, or a patch level (hosts klio & land)" echo "and if customising ports/ , beware that there are no ports trees with" echo "the stable tag (except 12.2-STABLE)." echo "Unrecognnised values will cause switch below to exit." switch (${UNAME_R}) # { #---------------------- # Releases https://www.freebsd.org/releases/ #---------------------- # 1 name exists using REL=4.8-RELEASE #---------------------- case 4.11-RELEASE : # 62 names exists using REL=4.11-RELEASE breaksw #---------------------- # 22 names exists using REL=5.5-RELEASE #---------------------- # 1 name exists using REL=6.2-RELEASE #---------------------- case 6.4-RELEASE : # 108 names exists using REL=6.4-RELEASE breaksw #---------------------- # 1 name exists using REL=7.0-RELEASE #---------------------- # 1 name exists using REL=7.1-RELEASE #---------------------- case 7.4-RELEASE : # 103 names exists using REL=7.4-RELEASE breaksw #---------------------- # 8 names exists using REL=8.2-RELEASE #---------------------- # 2 names exists using REL=8.3-RELEASE #---------------------- case 8.4-RELEASE : # 142 names exists using REL=8.4-RELEASE breaksw #---------------------- # 4 names exists using REL=9.0-RELEASE #---------------------- # 8 names exists using REL=9.1-RELEASE #---------------------- case 9.2-RELEASE : # 123 names exists using REL=9.2-RELEASE breaksw #---------------------- case 9.3-RELEASE : # 127 names exists using REL=9.3-RELEASE breaksw #---------------------- # 1 name exists using REL=10.0-RELEASE #---------------------- # 14 names exists using REL=10.2-RELEASE #---------------------- case 10.3-RELEASE : # 108 names exists using REL=10.3-RELEASE breaksw #---------------------- case 10.3-STABLE : # 63 names exists using REL=10.3-STABLE breaksw #---------------------- case 10.4-RELEASE : # 110 names exists using REL=10.4-RELEASE breaksw #---------------------- # 11 names exists using REL=11.1-RELEASE #---------------------- case 11.2-RELEASE : # 98 names exists using REL=11.2-RELEASE breaksw #---------------------- case 12.0-RELEASE : # 96 names exists using REL=12.0-RELEASE breaksw #---------------------- case 12.0-STABLE : # no names exists using 12.0-STABLE breaksw #---------------------- case 12.1-RELEASE : # 108 names exists using REL=12.1-RELEASE breaksw #---------------------- case 12.1-STABLE : # no names exists using 12.1-STABLE set UNAME_R = 12.1-RELEASE breaksw #---------------------- case 12.2-RELEASE : breaksw #---------------------- case 12.2-STABLE : breaksw # cd ~/public_html/src/bsd/fixes/FreeBSD ; \ # find . -name \*12.2-STABLE\* | wc -l # 108 #---------------------- case 12.3-RELEASE : breaksw # cd ~/public_html/src/bsd/fixes/FreeBSD ; \ # find . -name \*12.3-RELEASE\* | wc -l # 0 # customise_more_links 12.2-RELEASE 12.3-RELEASE # & # customise_more_links 12.2-STABLE 12.3-RELEASE_FROM_STABLE # & manually pruned # find . -name \*12.3\* | wc -l # 110 #---------------------- case 12.3-STABLE : set UNAME_R = 12.3-RELEASE # cd ~/public_html/src/bsd/fixes/FreeBSD ; \ # find . -name \*12.3-STABLE\* | wc -l # 0 breaksw #---------------------- # JJLATER for an example set of links: # cd ~/p*l/src/bsd/fixes/FreeBSD/src/gen/etc/mtree ; \ # ls -l BSD.root.dist.REL=* case 13.0-RELEASE : breaksw # created by # customise_more_links 12.2-RELEASE 13.0-RELEASE # customise_more_links 12.2-STABLE 13.0-RELEASE-X1 # customise_more_links 13.0-CURRENT 13.0-RELEASE-X2 # customise_more_links CURRENT 13.0-RELEASE-X3 # & manually pruned. #---------------------- case 13.0-RELEASE-p8 : set UNAME_R = 13.0-RELEASE # For land.berklix.org 2022-04-11 breaksw #---------------------- case 13.0-RELEASE-p11 : set UNAME_R = 13.0-RELEASE # For land.berklix.org 2022-04-16 breaksw #---------------------- # Example ready for future, but not yet any names with 13.1-RELEASE # case 13.1-RC2 : # set UNAME_R = 13.1-RELEASE # breaksw # #---------------------- # Example ready for future, but not yet any names with 13.1-RELEASE # case 13.1-PRERELEASE : # set UNAME_R = 13.1-RELEASE # breaksw #---------------------- case 14.0-CURRENT : # 118 names exists using REL=CURRENT echo -n "Patches for ${UNAME_R} " set UNAME_R = CURRENT echo "Will be taken as for ${UNAME_R}" breaksw #---------------------- default : echo "Error this version ${UNAME_R} probably has no patches." echo "Consider creating a patch set with customise_more_links" echo -n "Then apply patches to src/ & port/ & where they " echo "fail to apply, move the link," echo -n "copy link to old name, " echo "remove link, edit patch file." exit 1 breaksw # JJLATER I could (but probably never will) # add code to automaticaly extend this table: # - A *-BETA[0-9] or a *-RC[0-9] takes lower number # of a previous release. # - A *-RELEASE-p[0-9] takes the same number as release. # (If uname -r changes unexpectedy on host # land.berklix, maybe np@ might have updated the # kernel within which the jail runs). #---------------------- endsw # } # ssh -l mailnull-csh localhost logname Reports mailnull-csh # ssh -l mailnull-csh localhost whoami Reports mailnull # xs logname Reports jhs # xs whoami Reports root # xs logname Reports root # xs whoami Reports root set USER = `logname` # Name such as "jhs" under which are patches. set USERIFROOT = `whoami` # whoami Better than logname at testing if root. set USERPATCHES = "jhs" # owner of patch tree, if you want to # find patches automatically while running this script # logged in as mailman-csh to have write access to # src & ports trees also write updated by ctm_rmail. switch ($USERIFROOT) #{ # USERIFROOT rather than USER to more likely abort on root. case jhs : # Add | YourName # echo "A usual user $USERIFROOT who has a patch tree." # Proceed un-hindered. breaksw case root : echo "Error: No need to run this as $USERIFROOT" # I have run this script as root by accident, # (with no harm recalled) # but there should not be a reason to run as root, & if it were # to go wrong I do not want the blame. echo "Sleeping, Please abort with Control C" sleep 10 echo "Before $0, you might want to run something like:" echo " cd /usr; chown -R $USER src ports ~/" exit 1 breaksw case mailnull-csh : # An extra ID I added on top of FreeBSD defaults. # to own & apply incoming ctm deltas echo "Warning: Running as $USERIFROOT" if ( $USERPATCHES.x == .x ) then #{{ else #}{ set USER "$USERPATCHES" endif #}} breaksw case mailnull : echo "Warning: Running as $USERIFROOT" if ( $USERPATCHES.x == .x ) then #{{ else #}{ set USER "$USERPATCHES" endif #}} breaksw case default : echo "Warning: If you do not have a patch tree this will fail." echo "See the ~jhs/ patch tree for an example" breaksw endsw #} $USERIFROOT unset USERIFROOT # Not used beyond here. unset USERPATCHES # Not used beyond here. set FIXES = ~$USER/public_html/src/bsd/fixes/$OS_NAME set PATCH_FLAGS = if ( $1.x == .x ) then #{{ switch ($OS_NAME) #{ case FreeBSD : set SRC_PORTS = "/usr/src /usr/ports" breaksw case NetBSD : set SRC_PORTS = "/usr/src" set PATCH_FLAGS = -N # patch -N appropriate for pc532 same src tree, # never new, not appropriate for i486, always # new tree. breaksw case default : echo "Error no default for this operating system" exit 1 breaksw endsw #} else #}{ set SRC_PORTS = "$1" endif #}} if ( $2.x != .x ) then #{ # Add a fix to allow human to specify a version, to over-ride # ${UNAME_R} to support eg # - 5.1 to use latest 5.3 fixes. eg for ports/*/Makefile # - 5 stable to be able to install a # 5.4-RELEASE pre make world. # - Forcing 6.0-BETA4 to use 6.0-BETA2 older patches, or # 6.0-RELEASE pre named patches. $ECHOINFO "Will use patches for $2 and not ${UNAME_R}" set UNAME_R = "$2" endif #} $ECHOINFO "Targets SRC_PORTS: $SRC_PORTS" $ECHOINFO "Patches: $FIXES" $ECHOINFO "Ignore the next /nonexistent: No such file or directory." set NoDir = `cd /nonexistent;pwd` $ECHODEBUG "NoDir is: xx $NoDir xx" foreach SrcOrPorts ( $SRC_PORTS ) #{ set BASE = `basename $SrcOrPorts` ls -l "`pwd`/.customise" sleep 5 # Allow time to break test -e .customise # True if file exists (regardless of type). # Code to add JJLATER get syntax right # if $? # man csh: $? Equivalent to $status. (+) # echo "`pwd`/.customise" Exists, Maybe you should kill this" # sleep 5 # echo maybe exit 1 # else # echo "`pwd`/.customise" Does Not Exist, Continuing" # endif echo "Writing `pwd`/.customise" # Into cwd which might or not be a src/ or ports/ cp /dev/null .customise # Check $BASE is src or ports, if it is not, abort. if (( $BASE.x == src.x ) || ( $BASE.x == ports.x )) then #{{ $ECHOINFO "Passed check for src or ports: $BASE" else #}{ echo "Error: $SrcOrPorts must end as src or ports" # Before this check was added, if $BASE was for example # /usr/src.current, every file in my home directory # was copied into /usr/src.current ! exit 1 endif #}} set CUSTOMISATIONS = "" # Add generic (gen) then personal patches. set CUSTOMISATIONS = "$CUSTOMISATIONS gen $USER" # Generic customisations precede user specific ones. $ECHOINFO "Customisations: $CUSTOMISATIONS" foreach GenOrUser ( $CUSTOMISATIONS ) #{ # Shorten the path, by jumping through any symbolic links. echo "Patches to inspect: $FIXES/$BASE/$GenOrUser" pushd $FIXES/$BASE/$GenOrUser ; set patches=`pwd_no_amd` ; popd if ( $patches.x == $NoDir.x ) then #{ echo "Fatal error: Cannot access patches directory" echo " $FIXES/$BASE/$GenOrUser" exit 1 endif #} # JJLATER Enhancement Pending: # Add some sed code to convert leading /.amd_mnt/ to /host/" echo "Patches inspected: $patches" echo "Target to inspect: $SrcOrPorts" # Shorten the path, by jumping through any symbolic links. cd $SrcOrPorts ; set src_or_ports=`pwd_no_amd` if ( $src_or_ports.x == $NoDir.x ) then #{ echo "Fatal error: Cannot access $src_or_ports" exit 1 endif #} # JJLATER Enhancement Pending: # Add some sed code to convert leading /.amd_mnt/ to /host/" echo "Target inspected: $src_or_ports" # Create space to hold typescripts (that should not be held in # the top /usr/src, as this may be nfs mounted & shared by # multiple hosts) mkdir -p host/`hostname` echo "Directory created for typescript: `pwd`/host/`hostname`" echo -n "(So you can abort $0 then restart first " echo "with script)." $ECHOINFO "Ensuring directories in: $src_or_ports" $ECHOINFO "to install files from: $patches" # Netbsd kept being received with directories in share/doc # missing, this broke the mk macros when used with make -i, # ending with cannot fork, or a crash if a superuser. # So I create empty directories here foreach dirs ( `cd $patches ; find . -type d -print` ) #{ $ECHODEBUG -n "Considering doing mkdir $dirs, " if ( -d $dirs ) then #{{ $ECHODEBUG "Directory exists : `pwd`/$dirs" else #}{ if ( -e $dirs ) then #{{ $ECHOERROR "Error: non-directory exists:$dirs" else #}{ mkdir -p $dirs $ECHOCREATED "Directory created: `pwd`/$dirs" endif #}} endif #}} end #} $ECHOINFO "Installing new and replacement files:" # 'find -L' to 'find' # after seeing lots of gifs/Inc installed in ports/ foreach files ( `cd $patches ; find . \( -type f -o -type l \)\ \! -name \*.diff \! -name \*.no_customise \! -name \ \*.send-pr \! -name \*.cust_rel -print | \ grep -v no_customise | sort` ) #{ # The 2nd | grep -v no_customise is to remove whole # directories that contain that string in name. $ECHOINSTALLING "___Installing: `pwd`/$files" # - Just doing ln -s $patches/$files $files # is too dangerous, as linked originals can get # damaged when /usr/src is changed (eg by vi, or # when the src tree is overlayed by a newer src tree.) # - Can not append a .ORIG with # do mv -f $files $files.ORIG # as /usr/ports/*/*/patches/patch* will get # run twice, & cause errors, so must prepend the ORIG. if ( -e ${Item_Log} ) then #{ echo -n "${Item_Start} Installing new and " \ >> ${Item_Log} echo "replacement: $files `date -u +%Y-%m-%dT%H:%M:%SZ`">> ${Item_Log} endif #} if ( -e $files ) then #{{ (mv -f $files \ `dirname $i`/ORIG.`basename $files` ) \ >& /dev/null # mv must be in brackets, as eg # sys/Makefile_sub.c is not in tree # On 2nd run ORIG.$files gets overwritten. # but can recover it from master tree if req. else #}{ # echo -n "There was no $files to mv to " # echo "`dirname \ # $files`/ORIG.`basename $files`" endif #}} cp -R $patches/$files $files # -R added 2015-09-17 to allow for directories # ~/public_html/src/bsd/fixes/FreeBSD/src/gen/\ # usr.bin/calendar/calendars/de_DE.ISO8859-1/\ # bavaria/muenchen # /bayern # TEST(1) shows -h, but if I use -h below # instead of -e I get if: Badly formed number. set BLA = `dirname $files`/LN.`basename $files` if ( -e ${BLA} ) then #{{ echo "Pre-exists: ${BLA}" else #}{ ( ln -s $patches/$files ${BLA} ) endif #}} if ( -e ${Item_Log} ) then #{ echo -n "Skiping Checking if Installing new: " echo " $files might have broken src/." pushd /usr/src #{ echo skiping nice xs make all >> ${Item_Log} echo skiping nice xs make install >> ${Item_Log} popd #} echo "${Item_End} Installing $files `date -u +%Y-%m-%dT%H:%M:%SZ`" \ >> ${Item_Log} endif #} $ECHOINSTALLING "___Installing: End Of: `pwd`/$files" end # } $ECHOBLANK "" # Install FreeBSD version dependent files, # eg ports/*/*/files/patches-* . foreach files ( `cd $patches ; find . \( -type f -o -type l \)\ -name \*.cust_rel -print | sort` ) #{ $ECHOBLANK "" $ECHODEBUG "Considering: $patches/$files" # Determine if this file is to be installed # for ALL releases or just one release eg # 4.11-RELEASE set rel = `basename $files .cust_rel|sed 's/REL=/ /' |\ awk '{printf "%s\n",$2}'` $ECHODEBUG "Debug 11${rel}22" if ( ( ${rel} == ALL ) || ( ${rel} == ${UNAME_R} ) ) \ then #{ $ECHODEBUG "Version match: $patches/$files" if ( -e $files ) then #{{ (mv -f $files `dirname \ $files`/ORIG.`basename $files` ) \ >& /dev/null # mv must be in brackets, as eg # sys/Makefile_sub.c is not in tree # On 2nd run ORIG.$files gets # overwritten. But can recover it from # master tree if req. else #}{ # echo -n "There was no $files to mv \ # to " # echo "`dirname \ # $files`/ORIG.`basename $files`" endif #}} # Map files from eg: # patch-js-HP_ScanJet_4400c.\ # REL=6.2-RELEASE.cust_rel # to eg: patch-js-HP_ScanJet_4400c set rel = \ `basename $files .diff|sed 's/REL=/ /' | \ awk '{printf "%s\n",$2}'` $ECHOCOPYING "___Copying $patches/$files \ `dirname $files`/`basename $files .REL=$rel`" cp $patches/$files \ `dirname $files`/`basename $files .REL=$rel` else #}{ $ECHOSKIPPING \ "___Skipping1: $patches/$files" endif # } end # } $ECHOBLANK "" # Apply patches # Sort ensures predictable order of src/Makefile.[12].diff etc foreach files ( `cd $patches ; find . \( -type f -o \ -type l \) -name \*.diff -print | sort` ) #{ $ECHOBLANK "" $ECHODEBUG "Considering: $patches/$files" # Determine if patch for ALL releases or just eg # 4.9-RELEASE or 5.0-DP2 set rel = `basename $files .diff|sed 's/REL=/ /' | \ awk '{printf "%s\n",$2}'` $ECHODEBUG "Debug 11${rel}22" if ( ( ${rel} == ALL ) || ( ${rel} == ${UNAME_R} ) ) \ then #{ $ECHODEBUG "__In_CWD: `pwd`" $ECHOPATCHING \ "__-Patching From: $patches/$files" if ( -e ${Item_Log} ) then #{{ echo "${Item_Start} diffs $files `date -u +%Y-%m-%dT%H:%M:%SZ`" \ >> ${Item_Log} endif #}} # All of ___Ignoring ___Skipping # ___Installing_* are named that way, # so it is easier to delete them from # a log with a single edit, leaving # a shorter log before visually # scanning for __-Patching to see if # any patch failed. patch -s -p2 ${PATCH_FLAGS} -V t < \ $patches/$files # To allow for local shortname patches. # I should detect diff path length from header, # and then dynamicly decide whether to # instead do a # ( cd `dirname $files` ; patch -s -p2 \ # ${PATCH_FLAGS} -V t < $patches/$files ) if ( -e ${Item_Log} ) then #{ pushd /usr/src #{ echo -n "Checking if patch $files " echo "might have broken src/." nice xs make all >> ${Item_Log} # Expect it to build OK. nice xs make install >> ${Item_Log} # Expect it to install OK. nice xs make all >> ${Item_Log} # Testing if system broken, # or if it can still rebuild ? popd #} echo "${Item_End} diffs $files `date -u +%Y-%m-%dT%H:%M:%SZ`"\ >> ${Item_Log} endif #} else #}{ $ECHOSKIPPING "___Skipping2: $patches/$files" endif # } end # } $ECHOBLANK "" foreach files ( `cd $patches ; find . \( -type f -o -type l \)\ -name \*.no_customise -print | sort` ) #{ # $ECHOIGNORING "___Ignoring: $files" end # } $ECHOBLANK "" $ECHOINFO "Appending $GenOrUser to `pwd_no_amd`/.customise" # JJLATER $ECHOINFO -n " $GenOrUser" >> .customise # JJLATER foreach files ( `cd $patches ; find . -type f -name \ \*.no_customise -o -name \*.send_pr -print |sort` ) #{ # JJLATER should I add \*.cust_rel above ? $ECHOSKIPPING "___Skipping3: $patches/$files" end # } $ECHOINFO "Finished all patches from tree $BASE/$GenOrUser." end # } if ( $BASE.x == ports.x ) then #{ $ECHOINFO "Consider this:" $ECHOINFO "ln -s /usr/public/freebsd/distfiles/links \ $BASE/distfiles" endif #} echo "Appending blank line to `pwd`/.customise" # JJLATER echo "" >> .customise # CR # JJLATER end #} ( cd / ; ln -s usr/src/sys /sys ) # rm -rf games # save space & time ! $ECHOINFO "Starting user & OS specific stuff" switch ($USER) #{ case `whoami`: #{ switch ($OS_NAME) #{ case FreeBSD: #{ #( cd /sys ; ./SELECT research ) #( cd /usr/src ; rm -f sys/compile/.keep_me ) breaksw #} case NetBSD: #{ $ECHOINFO "Calling netbsd_purge" netbsd_purge # scrap other architectures chmod +x /usr/src/usr.bin/lex/mkskel.sh breaksw #} case default: #{ echo "Warning no default for this system" breaksw #} endsw #} breaksw #} case default: #{ echo "Warning no default for user $USER" breaksw #} endsw #} $ECHOINFO "Ending host specific stuff" echo "Suggestion for ports:" echo "rm -rf /var/db/pkg/*" # remove brackets.c: "*/" echo "rm -rf /var/db/ports/*" # remove old options brackets.c: "*/" cat << EOF cd /usr/ports setenv DUDS "`printenv DUDS` kdirstat texinfo kde3" xs make BERKLIX_MINIMAL=YES BERKLIX_CLIENT=YES BERKLIX_GATE=YES \ BERKLIX_SERVER=YES BERKLIX_AMBITIOUS=YES fetch checksum \ configure configure-recursive Repeat until you get no more dialog screens. Doing configs in advance may help makes to not hang on input later during a mega make job. Consider: rm /usr/sbin/ctm* ; cd /usr/ports/misc/ctm ; make install (As the old ctm does not create symbolic links). EOF exit 0 # This belongs somewhere else: # after installing new binaries, I will want to do this: cd /usr mv local/lib/X11/fvwm/system.fvwmrc local/lib/X11/fvwm/system.fvwmrc.orig ln -s ../../../../../etc/system.fvwmrc local/lib/X11/fvwm/system.fvwmrc mv local/lib/X11/xdm/Xservers local/lib/X11/xdm/Xservers.orig ln -s ../../../../../etc/Xservers local/lib/X11/xdm/Xservers mv local/lib/X11/xdm/xdm-config local/lib/X11/xdm/xdm-config.orig ln -s ../../../../../etc/xdm-config local/lib/X11/xdm/xdm-config mv local/etc/apache local/etc/apache.orig ln -s ../../../site/usr/local/etc/apache local/etc/apache mv local/etc/mailcap local/etc/mailcap.orig ln -s ../../../site/usr/local/etc/mailcap local/etc/mailcap echo "Reccomendation: rm -rf /var/db/ports/*" brackets.c: "*/" echo "Is SENDMAIL_MC restored in /etc/motd `grep SENDMAIL_MC /etc/make.conf`" # JJLATER # Installing_* have numbers to trace where I may need to # add code, for If or If Not a directory is [not] copied; Some test cases: # public_html/src/bsd/fixes/FreeBSD/ports/jhs/Inc LINK # public_html/src/bsd/fixes/FreeBSD/ports/jhs/x11-wm/gifs NOT EXISTANT # public_html/src/bsd/fixes/FreeBSD/ports/ports/jhs/gifs NOT EXISTANT # public_html/src/bsd/fixes/FreeBSD/src/gen/usr.bin/calendar/calendars/de_DE.ISO8859-1/bavaria DIR # public_html/src/bsd/fixes/FreeBSD/src/gen/usr.bin/calendar/calendars/de_DE.ISO8859-1/bavaria/muenchen LINK # public_html/src/bsd/fixes/FreeBSD/src/gen/usr.bin/calendar/calendars/de_DE.ISO8859-1/bavaria/munich DIR # public_html/src/bsd/fixes/FreeBSD/src/gen/usr.bin/calendar/calendars/de_DE.ISO8859-1/bayern LINK