dotdee-1.11/0000775000175000017500000000000012205232400013050 5ustar kirklandkirklanddotdee-1.11/ChangeLog0000664000175000017500000001701712205232400014630 0ustar kirklandkirklanddotdee (1.11) released; urgency=low [ Laszlo Boszormenyi ] * debian/control, debian/copyright, debian/dirs, debian/rules: - fixes for Debian - remove accented characters - use DEP5 copyright format - drop unecessary dirs file - specify rules format -- Dustin Kirkland Fri, 16 Aug 2013 14:03:25 -0500 dotdee (1.10-0ubuntu1) saucy; urgency=low * Packaged and released for upload to Debian, closes: #719691 * debian/default, debian/upstart: LP: #993503 - provide an easy mechanism for diabling inotify vi configuration * debian/control: - bump standards - add uploader, Laszlo Boszormenyi (GCS) - fix lintian error -- Dustin Kirkland Fri, 16 Aug 2013 14:03:20 -0500 dotdee (1.9-0ubuntu1) oneiric; urgency=low [ Juan L. Negron ] * etc/dotdee.xml: LP: #803030 - Original dotdee.xml file needs to not be installed as a conffile -- Dustin Kirkland Wed, 29 Jun 2011 02:30:17 +0000 dotdee (1.8-0ubuntu1) oneiric; urgency=low * debian/postinst, usr/sbin/dotdee: - fix some installation time breakage - must update the contents, before the link, else update-alternatives fails - simplify the postinst /etc/dotdee.xml setup logic for idempotence -- Dustin Kirkland Wed, 15 Jun 2011 10:28:40 -0500 dotdee (1.7-0ubuntu1) oneiric; urgency=low * === added directory usr/share/dotdee, debian/postinst, === removed directory etc/dotdee/usr, === removed directory etc/dotdee/usr/share, === removed directory etc/dotdee/usr/share/dotdee, === renamed directory etc/dotdee/usr/share/dotdee/dotdee.xml.d => etc/dotdee/dotdee.xml.d, usr/sbin/dotdee, usr/share/dotdee/watch_template: - manage /etc/dotdee.xml with dotdee itself - watch the managed file (symlink) for changes - if the managed file changes, reinstall our dotdee managed link * === added directory etc/dotdee/etc, debian/postinst, etc/dotdee/dotdee.xml.d/51-etcdotdee-watch => etc/dotdee/etc/dotdee.xml.d/51-main, === renamed directory etc/dotdee/dotdee.xml.d => etc/dotdee/etc/dotdee.xml.d, usr/lib/dotdee/dotdee-inotify-handler, usr/sbin/dotdee, usr/share/dotdee/watch_template, usr/share/man/man8/dotdee.8: - add update-link, update-contents, list methods * usr/lib/dotdee/dotdee-inotify-handler, usr/sbin/dotdee: - move the inotify handling code into dotdee itself, which already has several helper functions; should improve performance for inotify handling situations * usr/sbin/dotdee, usr/share/dotdee/watch_template: - fixup a couple of minor bugs around canonicalizing the path and handle - update the template to use --handle-inotify * etc/dotdee/etc/dotdee.xml.d/51-main, usr/sbin/dotdee: - get dotdee restarting when /etc/dotdee.xml changes - clean up restart procedures -- Dustin Kirkland Mon, 13 Jun 2011 00:12:23 -0500 dotdee (1.6-0ubuntu1) oneiric; urgency=low * === added directory etc, === added directory etc/dotdee, === added directory etc/dotdee/usr, === added directory etc/dotdee/usr/share, === added directory etc/dotdee/usr/share/dotdee, === added directory etc/dotdee/usr/share/dotdee/dotdee.xml.d, === added directory usr, === added directory usr/lib, === added directory usr/lib/dotdee, === added directory usr/sbin, === added directory usr/share, === added directory usr/share/icons, === added directory usr/share/icons/hicolor, === added directory usr/share/icons/hicolor/192x192, === added directory usr/share/man, === added directory usr/share/man/man8, debian/install, debian/manpages, dotdee.8 => usr/share/man/man8/dotdee.8, dotdee- inotify-handler => usr/lib/dotdee/dotdee-inotify-handler, dotdee => usr/sbin/dotdee, dotdee.xml => etc/dotdee/usr/share/dotdee/dotdee.xml.d/50-original, dpkg.txt, etc/dotdee/usr/share/dotdee/dotdee.xml.d/10-header, etc/dotdee/usr/share/dotdee/dotdee.xml.d/90-footer, etc/dotdee/usr/share/dotdee/dotdee.xml.d/.comment, img/dotdee.png => usr/share/icons/hicolor/192x192/dotdee.png, === removed directory img: - reorganize the layout for simpler installation - scale the dotdee.png down to 192x192 * === added directory usr/share/dotdee, debian/postinst, etc/dotdee/usr/share/dotdee/dotdee.xml.d/50-original => etc/dotdee/usr/share/dotdee/dotdee.xml.d/51-etcdotdee-watch, usr/sbin/dotdee, usr/share/dotdee/dotdee.xml: - add a --setup-force mode (don't document this) * usr/sbin/dotdee, usr/share/man/man8/dotdee.8: - add support for comment start and end characters, like and /* */ * usr/sbin/dotdee: - add a bug/note about XML special case needed for comments * debian/postinst, debian/upstart, === removed directory usr/share/dotdee, usr/share/dotdee/dotdee.xml, etc/dotdee.xml: - flatten back to a single dotdee.xml - move it to /etc, for admin configurability * debian/upstart: - respawn in case iwatch fails * usr/lib/dotdee/dotdee-inotify-handler: - update on .comment changes * etc/dotdee.xml: - try only sending event once; should make inotify events far less frequent; testing will show if this is sufficient -- Dustin Kirkland Thu, 02 Jun 2011 15:06:30 -0400 dotdee (1.5-0ubuntu1) oneiric; urgency=low * dotdee.xml: - need moved_self -- Dustin Kirkland Wed, 01 Jun 2011 13:15:59 -0500 dotdee (1.4-0ubuntu1) oneiric; urgency=low * dotdee, dotdee.8: - drop the maintenance of .attr; let's just pull this from 50-original - fix chmod to affect all write access -- Dustin Kirkland Tue, 31 May 2011 17:55:08 -0500 dotdee (1.3-0ubuntu1) oneiric; urgency=low * dotdee, dotdee.8: - add support for a .comment file in the .d configuration directory -- Dustin Kirkland Tue, 31 May 2011 17:34:52 -0500 dotdee (1.2-0ubuntu1) oneiric; urgency=low * dotdee, dotdee.8: - add one-character shortcut parameters - add a --dir option; useful when someone or something (dpkg?) needs to add a snippet -- Dustin Kirkland Tue, 31 May 2011 12:50:24 -0500 dotdee (1.1-0ubuntu1) oneiric; urgency=low * === added directory img, img/dotdee.png: - branding * dotdee, dotdee.8: - add a --original option; useful when someone or something (dpkg?) needs to modify the original file -- Dustin Kirkland Tue, 31 May 2011 12:30:29 -0500 dotdee (1.0-0ubuntu1) oneiric; urgency=low * Initial release * === added directory debian, debian/compat, debian/control, debian/copyright, debian/install, debian/manpages, debian/rules: - initial packaging * debian/control, debian/install, debian/upstart, dotdee.8, dotdee- inotify-handler: - add inotify support * dotdee: - preserve permissions, use function for all - use ":" to signify "/" in update-alternatives pathnames - add support for executables - add support for .patch and .diff files - only preserve timestamps at undo * dotdee-inotify-handler: - relax naming requirements slightly * debian/upstart: - fix path - drop respawn, get the quoting right * debian/dirs: - added, needed for upstart job to work * dotdee.8: - add a bunch of examples * debian/install, debian/upstart, dotdee.xml: - use an xml configuration instead of command line, for the iwatch daemon; offers more flexibility -- Dustin Kirkland Tue, 24 May 2011 20:11:55 -0500 dotdee-1.11/etc/0000775000175000017500000000000011755516616013652 5ustar kirklandkirklanddotdee-1.11/etc/dotdee/0000775000175000017500000000000011755516616015116 5ustar kirklandkirklanddotdee-1.11/etc/dotdee/etc/0000775000175000017500000000000011755516616015671 5ustar kirklandkirklanddotdee-1.11/etc/dotdee/etc/dotdee.xml.d/0000775000175000017500000000000011755516616020156 5ustar kirklandkirklanddotdee-1.11/etc/dotdee/etc/dotdee.xml.d/10-header0000664000175000017500000000034711755516616021553 0ustar kirklandkirkland dotdee dotdee-1.11/etc/dotdee/etc/dotdee.xml.d/51-main0000664000175000017500000000032211755516616021245 0ustar kirklandkirkland /etc/dotdee dotdee-1.11/etc/dotdee/etc/dotdee.xml.d/90-footer0000664000175000017500000000003111755516616021617 0ustar kirklandkirkland dotdee-1.11/usr/0000775000175000017500000000000011755516616013710 5ustar kirklandkirklanddotdee-1.11/usr/lib/0000775000175000017500000000000011755516616014456 5ustar kirklandkirklanddotdee-1.11/usr/lib/dotdee/0000775000175000017500000000000011755516616015722 5ustar kirklandkirklanddotdee-1.11/usr/lib/dotdee/dotdee-inotify-handler0000775000175000017500000000164711755516616022216 0ustar kirklandkirkland#!/bin/sh -e # # dotdee-inotify-handler - handle dotdee's inotify events # # NOTE: THIS SCRIPT IS DEPRECATED BY: # dotdee --handle-inotify # AND IS PROVIDED FOR COMPATIBILITY PURPOSES ONLY!!! # # Copyright (C) 2011 Dustin Kirkland # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PKG="dotdee" exec ${PKG} --handle-inotify "${1}" dotdee-1.11/usr/sbin/0000775000175000017500000000000011755516616014643 5ustar kirklandkirklanddotdee-1.11/usr/sbin/dotdee0000775000175000017500000002021611755516616016036 0ustar kirklandkirkland#!/bin/sh -e # # dotdee - convert a flat file into one dynamically generated from a .d directory # Copyright (C) 2010 Dustin Kirkland # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PKG="dotdee" DIR="/etc/${PKG}" ORIGINAL="50-original" COMMENT=".comment" FORCE= info() { echo "INFO: $@" 1>&2 } error() { echo "ERROR: $@" 1>&2 exit 1 } usage() { echo echo "dotdee --dir|--original|--setup|--update|--undo FILENAME" echo echo " -c|--comment FILENAME COMMENT_DELIM set the file comment delimiter" echo " -d|--dir FILENAME print the dotdee directory where snippets live" echo " --handle-inotify inotify handler procedures" echo " -l|--list [FILENAME] list dotdee managed paths" echo " -o|--original FILENAME print the current location of the original file" echo " -s|--setup FILENAME convert FILENAME to a .d directory structure" echo " -u|--update FILENAME update the generated FILENAME immediately" echo " --update-link FILENAME only update the generated FILENAME symlink" echo " --update-contents FILENAME only update the contents of FILENAME" echo " --undo FILENAME undo/revert a dotdee setup" echo } u_a_name() { # Ensure a unique name in update-alternatives f=$(managed_path "${1}") echo "${f}" | sed -e "s%/%:%g" -e "s%^:\+%%" } managed_path() { # Best to keep this code in one place; strip: # - duplicate "/" # - leading $DIR # - trailing ".d" # - trailing ".d/*" echo "${1}" | sed -e "s:/\+:/:g" -e "s:^${DIR}/:/:" -e "s:\.d$::" -e "s:\.d/[^/]*$::g" } is_dotdee() { # Is this file managed by dotdee? update-alternatives --list "${HANDLE}" 2>/dev/null | grep -qs "^${DIR}/${1}$" } sync_attrs() { chown --reference "${1}" "${2}" chmod --reference "${1}" "${2}" } comment() { local tmp=$(mktemp) echo "${2}" > "${tmp}" [ -n "${3}" ] && echo "${3}" >> "${tmp}" mv -f "${tmp}" "${DIR}/${1}.d/${COMMENT}" sleep 0.1 # Ugly, but somehow this isn't getting written to disk? } directory() { if is_dotdee "${1}"; then echo "${DIR}/${1}.d" else error "[${1}] is not managed by dotdee" fi } original() { if is_dotdee "${1}"; then echo "${DIR}/${1}.d/${ORIGINAL}" else error "[${1}] is not managed by dotdee" fi } restart_dotdee() { /sbin/restart "${PKG}" || /sbin/start "${PKG}" } setup() { # Setup a file for dotdee management if is_dotdee "${1}" && [ "${FORCE}" != "1" ]; then error "[${1}] is already managed by dotdee" else # Test for applicability [ -f "${1}" ] || error "Not a regular file [${1}]" # Create the directory and move the file mkdir -p "${DIR}/${1}.d" mv -f "${1}" "${DIR}/${1}.d/${ORIGINAL}" [ -n "${2}" ] && comment "${1}" "${2}" "${3}" NEW=1 update "${1}" # Re-establish links to file # Establish update-alternatives link at a higher priority to the generated one update-alternatives --install "${1}" "${HANDLE}" "$DIR/${1}" 50 # Establish update-alternatives link at a lower priority to the original one update-alternatives --install "${1}" "${HANDLE}" "$DIR/${1}.d/${ORIGINAL}" 20 t=$(mktemp) d=$(dirname "${1}") b=$(basename "${1}") sed -e "s@___DIRNAME___@${d}@g" -e "s@___BASENAME___@${b}@g" /usr/share/dotdee/watch_template > "${t}" mv -f "${t}" "${DIR}/etc/dotdee.xml.d/60-${HANDLE}" restart_dotdee fi } link_ok() { f=$(readlink -f "${1}") case "${f}" in ${DIR}${1}|${DIR}/${1}) # No need to update; already correct info "[${1}] -> [${f}] is correct" return 0 ;; *) info "[${1}] -> [${f}] is incorrect" return 1 ;; esac } update_link() { update-alternatives --install "${1}" "${HANDLE}" "${DIR}/${1}" 50 >/dev/null 2>&1 } contents_ok() { md5sum -c "/var/lib/${PKG}/${HANDLE}" } update_contents() { # Construct the file via concatenation if is_dotdee "${1}" || [ "${NEW}" = 1 ]; then tmp=$(mktemp) # Conditionally add the comment header to the beginning of the generated file. # BUG: XML will need special handling, as comments cannot come before the doc type header if [ -f "${DIR}/${1}.d/${COMMENT}" ]; then lines=$(wc -l "${DIR}/${1}.d/${COMMENT}" | awk '{print $1}') if [ "$lines" = "1" ]; then c1=$(head -n1 "${DIR}/${1}.d/${COMMENT}") c2= elif [ "$lines" = "2" ]; then c1=$(head -n1 "${DIR}/${1}.d/${COMMENT}") c2=$(tail -n1 "${DIR}/${1}.d/${COMMENT}") c2=" ${c2}" fi if [ "$lines" = "1" ] || [ "$lines" = "2" ]; then printf "${c1} DOTDEE: DO NOT EDIT THIS FILE DIRECTLY!${c2}\n" >> "${tmp}" printf "${c1} DOTDEE: Rather, add, remove, or modify file(s) in [%s]${c2}\n" "${DIR}/${1}.d" >> "${tmp}" printf "${c1} DOTDEE: per the dotdee(8) manpage.${c2}\n" >> "${tmp}" fi fi for i in "${DIR}/${1}.d/"[0-9]*; do case "${i}" in "${DIR}/${1}.d/${ORIGINAL}") cat "${i}" >> "${tmp}" ;; *.patch|*.diff) patch "${tmp}" "${i}" ;; *) if [ -x "${i}" ]; then # file is not 50-original, and is executable, # so by convention, feed the current state # of the file as STDIN, and write STDOUT to # the file tmp2=$(mktemp) ${i} <"${tmp}" >"${tmp2}" mv -f "${tmp2}" "${tmp}" else cat "${i}" >> "${tmp}" fi ;; esac done # Sync owner:group and permissions sync_attrs "${DIR}/${1}.d/${ORIGINAL}" "${tmp}" # But then remove all write access, to prevent inadvertent writes to this generated file chmod a-w "${tmp}" mv -f "${tmp}" "${DIR}/${1}" # Store a checksum of the contents, in order to detect changes mkdir -p "/var/lib/${PKG}" md5sum "${DIR}/${1}" > "/var/lib/${PKG}/${HANDLE}" info "[${1}] updated by dotdee" else error "[${1}] is not managed by dotdee" fi } update() { update_contents "${1}" update_link "${1}" [ "${1}" = "/etc/dotdee.xml" ] && restart_dotdee "${PKG}" || true } undo() { # Undo a dotdee setup if is_dotdee "${1}"; then rm -f "$DIR/etc/dotdee.xml.d/60-${HANDLE}" update-alternatives --remove "${HANDLE}" "${DIR}/${1}" update-alternatives --remove "${HANDLE}" "${DIR}/${1}.d/${ORIGINAL}" cp -af "${DIR}/${1}.d/${ORIGINAL}" "${1}" info "[${1}] has been restored" info "You may want to manually remove [${DIR}/${1} ${DIR}/${1}.d]" else error "[${1}] is not managed by dotdee" fi } list() { if [ -n "${1}" ]; then if is_dotdee "${1}"; then echo "${1}" else error "[${1}] is not managed by ${PKG}" exit 1 fi else # List all dotdee managed paths for i in $(find "${DIR}" -type d -name "*.d"); do f=$(managed_path "${i}") case "$(readlink -f "${f}")" in ${DIR}/*) echo "${f}" ;; esac done fi } handle_inotify() { case "${1}" in # Files in an /etc/dotdee/*.d dir changed ${DIR}/*.d/[0-9]*|${DIR}/*.d/.comment) f=$(managed_path "${1}") # Update the managed file update "${f}" ;; ${DIR}/*) # Dereferenced dotdee link; strip leading dir f=$(managed_path "${1}") if is_dotdee "${f}"; then # Link is correct; check/update contents contents_ok || update_contents "${f}" fi ;; *) if is_dotdee "${1}"; then # Check/update link link_ok "${1}" || update_link "${1}" # Check/update contents contents_ok "${1}" || update_contents "${1}" fi ;; esac } # Main #set -x HANDLE=$(u_a_name "${2}") case "${1}" in -c|--comment) comment "${2}" "${3}" "${4}" ;; -d|--dir|--directory) directory "${2}" ;; --handle-inotify) handle_inotify "${2}" ;; -l|--list) list "${2}" ;; -o|--original) original "${2}" ;; -s|--setup) setup "${2}" "${3}" ;; --setup-force) FORCE=1 setup "${2}" "${3}" "${4}" ;; -u|--update) NEW= update "${2}" ;; --update-contents) update_contents "${2}" ;; --update-link) update_link "${2}" ;; --undo) undo "${2}" ;; --help) usage ;; *) usage error "Invalid argument [${1}]" ;; esac dotdee-1.11/usr/share/0000775000175000017500000000000011755516616015012 5ustar kirklandkirklanddotdee-1.11/usr/share/icons/0000775000175000017500000000000011755516616016125 5ustar kirklandkirklanddotdee-1.11/usr/share/icons/hicolor/0000775000175000017500000000000011755516616017564 5ustar kirklandkirklanddotdee-1.11/usr/share/icons/hicolor/192x192/0000775000175000017500000000000011755516616020523 5ustar kirklandkirklanddotdee-1.11/usr/share/icons/hicolor/192x192/dotdee.png0000664000175000017500000002075211755516616022503 0ustar kirklandkirklandPNG  IHDRݾP zTXtRaw profile type exifxڥkv:s>rH8gv0˟NbI3RKE U@Ͽ-ܣ}ZG̼81h{ֻkӖ3[R)_VX QdL,P ' ŧb{{Ͼ>^_d=ÇEy{<Ӟ/s`س'F8?.L}Ȓ%}k"nQ 6>y> j(1|Ւ$M+YH99,7w9ky\q5Pu>¸EO$HRlH{JrJq"y@5+RJI5I QK+lHHˀC*V{uJjk7K^;G}2dԁ1X3ςfcι\̼ZX_\y-{uϑSO;3ҬEE6:tB+nλ Y1jͺ )ި)׿_I3˒@;:;fq$9fqffYMq%)WK߱?-4#n"p~G˃g41+yo'=fG/Ƣq}}H=5K'zilt~D׀ RokOۍxeg<$9Xsk]l4|f:Jn״?n~Z0~Z&\> Q:ۊڏĴ5)ꔚ xXoJ,fFduv &;wli]Y dh07km,jgnlpJ(0̔H )Y!ǩ%xfnO.Ρwvt䅗AxWe*Hf,j:w^ h;ӽ/x63ɞ7 ~]:'I"}NPוA?ƴ CPuY"vf\~5Kr@QZDQy|̠N:RY^ K3CH2kǎEU ܰij7:>Jp" N_+`s1I0ϯh=tvl;~y(B9H QkLpMbmmLJaMڐy p:AC]tnzU`sh̬ݖ14ɛci;iuʑo&wpbYԣo[JSno"v݄rZ(ÕsЌ<yijL09N„шq╉$7*p|׾G#b@[!fÙO VͥNk\q'oY{{ 'O5$sBITOIDATx{|ս{7& !"y7HUZ-ZoKǭjU* $HB^l3Bhvf7 Gqܓ33sC 䂏u$BH "@E @!B( P$Bn"@(I($#P\V'yHqcY8ex<;;g3XAv> 4΀1tРhю]ݽ$qq('B CHl}l(uwutuŒ($$IWò5r$x@=/7uyÜ!'r(A$>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bB( P$BH "@E @!B( P$BH "@E?8IENDB`dotdee-1.11/usr/share/man/0000775000175000017500000000000011755516616015565 5ustar kirklandkirklanddotdee-1.11/usr/share/man/man8/0000775000175000017500000000000011755516616016430 5ustar kirklandkirklanddotdee-1.11/usr/share/man/man8/dotdee.80000664000175000017500000001314711755516616017773 0ustar kirklandkirkland.TH dotdee 8 "21 May 2011" dotdee "dotdee" .SH NAME dotdee \- convert a flat file into one dynamically generated from a .d directory .SH SYNOPSIS \fBdotdee\fP -c|--comment /PATH/TO/FILE [COMMENT_DELIMITER_START [COMMENT_DELIMITER_END]] \fBdotdee\fP -d|--dir /PATH/TO/FILE \fBdotdee\fP -l|--list \fBdotdee\fP -o|--original /PATH/TO/FILE \fBdotdee\fP -s|--setup /PATH/TO/FILE [COMMENT_DELIMITER_START [COMMENT_DELIMITER_END]] \fBdotdee\fP -u|--update /PATH/TO/FILE \fBdotdee\fP --update-contents /PATH/TO/FILE \fBdotdee\fP --update-link /PATH/TO/FILE \fBdotdee\fP --undo /PATH/TO/FILE .SH DESCRIPTION \fBdotdee\fP is an administrative utility useful for converting a flatfile into a dynamically generated file, from a .d directory. The original path at /PATH/TO/FILE will be replaced with a symbolic link to /etc/dotdee/PATH/TO/FILE, which is dynamically generated by concatenating all of the files in /etc/dotdee/PATH/TO/FILE.d/*, per the order of the shell. The Linux kernel's \fBinotify\fP(7) mechanism is used by \fBdotdee\fP running \fBiwatch\fP(1) against the \fI/etc/dotdee/\fP directory. Any changes to the constituent files are automatically reflected in the constructed, dynamically generated file. Therefore, as long as the \fBiwatch\fP(1) is running, you should never need to actually run "dotdee --update /PATH/TO/FILE" manually. There is at least 1 file always present in an \fI/etc/dotdee/PATH/TO/FILE.d/\fP directory: - \fI50-original\fP is the original file being managed; note that write permissions are removed from this file, as we don't want to ever modify it Optionally, a 2nd file might be present in an \fI/etc/dotdee/PATH/TO/FILE.d/\fP directory: - \fI.comment\fP is a text file that defines the "comment" string; if, for instance, the contents of \fI.comment\fP is the # character, the following will be printed to the head of the generated file: # DO NOT EDIT THIS FILE DIRECTLY! # Rather, add, remove, or modify file(s) in [/etc/dotdee/path/to/some.conf.d] # per the dotdee(8) manpage. Alternativately, \fI.comment\fP might contain "//", or ";", or anything else that denotes that the rest of the string will be a comment. As for the rest of the contents of \fI/etc/dotdee/PATH/TO/FILE.d/\fP directory, all of them must begin with 2 or more digits, to ensure that they are processed in a specific order. there are 3 supported file types: - plain text files, which must not be executable; these files are simply concatenated in order - executable files; these files are executed, with the current state of the managed file provided on STDIN, and the STDOUT is then written to the managed file - patch/diff files; these files end in either ".patch" or ".diff", and are applied using the \fBpatch\fP(1) command to the current state of the managed file .SH EXAMPLES $ sudo dotdee --setup /etc/hosts update-alternatives: using /etc/dotdee/etc/hosts to provide /etc/hosts (etc:hosts) in auto mode. $ ll /etc/hosts lrwxrwxrwx 1 root root 27 2011-05-25 00:26 /etc/hosts -> /etc/alternatives/etc:hosts $ ll /etc/alternatives/etc:hosts lrwxrwxrwx 1 root root 22 2011-05-25 00:26 /etc/alternatives/etc:hosts -> /etc/dotdee/etc/hosts $ ll /etc/dotdee/etc/hosts -rw-r--r-- 1 root root 221 2011-05-16 01:40 /etc/dotdee/etc/hosts $ cat /etc/hosts 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts $ echo 10.9.8.7 somehost | sudo tee /etc/dotdee/etc/hosts.d/10-somehost $ cat /etc/hosts 10.9.8.7 somehost 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts $ cat /etc/dotdee/etc/hosts.d/60-googledns.patch --- /etc/hosts 2011-05-16 01:40:03.000000000 +0000 +++ /tmp/hosts.new 2011-05-25 00:30:41.187412417 +0000 @@ -1,6 +1,8 @@ 10.9.8.7 somehost 127.0.0.1 localhost +8.8.8.8 googledns + # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet $ cat /etc/hosts 10.9.8.7 somehost 127.0.0.1 localhost 8.8.8.8 googledns # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts $ cat /etc/dotdee/etc/hosts.d/90-uppercase #!/bin/sh tr '[:lower:]' '[:upper:]' $ cat /etc/hosts 10.9.8.7 SOMEHOST 127.0.0.1 LOCALHOST 8.8.8.8 GOOGLEDNS # THE FOLLOWING LINES ARE DESIRABLE FOR IPV6 CAPABLE HOSTS ::1 IP6-LOCALHOST IP6-LOOPBACK FE00::0 IP6-LOCALNET FF00::0 IP6-MCASTPREFIX FF02::1 IP6-ALLNODES FF02::2 IP6-ALLROUTERS FF02::3 IP6-ALLHOSTS $ sudo dotdee --dir /etc/hosts /etc/dotdee/etc/hosts.d $ cat /some/hosts/snippet > $(sudo dotdee --dir /etc/hosts)/60-foo $ sudo dotdee --original /etc/hosts /etc/dotdee/etc/hosts.d/50-original $ cat /some/other/hosts/file > $(sudo dotdee --original /etc/hosts) $ sudo dotdee --comment /path/to/some.xml '' .SH SEE ALSO \fBupdate\-alternatives\fP(8), \fBiwatch\fP(1), \fBpatch\fP(1) .SH AUTHOR This manpage and the utility was written by Dustin Kirkland for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL, or on the web at \fIhttp://www.gnu.org/licenses/gpl.txt\fP. dotdee-1.11/usr/share/dotdee/0000775000175000017500000000000011755516616016256 5ustar kirklandkirklanddotdee-1.11/usr/share/dotdee/watch_template0000664000175000017500000000027111755516616021202 0ustar kirklandkirkland ___DIRNAME___