#! /bin/csh -f -e # Rebuilds the PUB directory of the ${STOLFIHOME}/ repository # Get the LAC package management tools: set path = ( /bin ) set lacbin = "${LAC_PUB}/bin" set mergedir = "${lacbin}/merge-export-directory" set diffdir = "${lacbin}/compare-export-directories" foreach tool ( ${mergedir} ${diffdir} ) if ( ! ( -x ${tool} ) ) then echo "${tool} not found -- install it manually and retry" exit 1 endif end # Get platform list: if ( $#argv == 0 ) then set platforms = ( sun4-SunOS-4.1.3 sun4-SunOS-5.3 mips-IRIX-5.2 ) else set platforms = ( $* ) endif set pkgdir = "${cwd}" set subpkgs = ( \ lac-pkg-tools-1 \ lac-utils-1 \ lac-elisp-19.28-1 \ lac-new-user-1 \ lac-pkg-enablers-1 \ lac-run-emacs-19.28-1 \ cweb-3.3 \ mh-e-4.1 \ ) foreach pl ( ${platforms} ) echo "building the PUB/${pl} directory of ${pkgdir}" if ( \ ( "x${pl}" != "xsun4-SunOS-4.1.3" ) && \ ( "x${pl}" != "xmips-IRIX-5.2" ) && \ ( "x${pl}" != "xsun4-SunOS-5.3" ) && \ ( "x${pl}" != "xnew-user" ) \ ) then echo "this package does not export anything for the platform ${pl}" else cd ${pkgdir} rm -fr PUB/${pl}.new mkdir -p PUB/${pl}.new cd PUB/${pl}.new && pwd foreach sp ( ${subpkgs} ) if ( -e ${pkgdir}/pkg/${sp}/PUB/${pl} ) then ${mergedir} ${pkgdir}/pkg/${sp}/PUB/${pl} . else echo "no PUB/${pl} in subpackage ${sp}" endif end foreach dt ( elisp info ) # Merge generic "${dt}" into the "${dt}-19.28" versions: if ( -e ${dt} ) then mkdir -p ${dt}-19.28 cd ${dt}-19.28 && pwd ${mergedir} ../${dt} . cd .. rm -rf ${dt} endif # Hack: add symbolic links for users of other versions of emacs if ( -e ${dt}-19.28 ) then ln -s ./${dt}-19.28 ${dt}-dcc endif end cd ${pkgdir} # Report changes and replace directories: # if ( -e PUB/${pl} ) ${diffdir} PUB/${pl} PUB/${pl}.new rm -fr PUB/${pl}~ if ( -e PUB/${pl} ) mv -f PUB/${pl} PUB/${pl}~ mv PUB/${pl}.new PUB/${pl} endif end # End