ԫɑ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI J K L M N O P Q R S T U V W X Y Z [ \]^_`abcdefghijklmnopqrstu v w x y z { | } ~  calls ) but will remove the target and retry if   raises EEXIST. =FIXME: We should really get this value from the mount table.  8Return the device represented by a device node, such as /dev/sda2. F Returns Nothing if there is an exception trying to stat the node, or 3 if the node turns out not to be a special device. 8Removable devices, such as USB keys, are in this group. 9Traverse a directory and return a list of all the (path,  fileStatus) pairs.      non-portable (requires POSIX) provisionaljeremy@seereason.com Entry returned by  TODO: add other fields $Textual name of this user (pw_name) APassword -- may be empty or fake if shadow is in use (pw_passwd) getSUserEntryForName name calls getspnam to obtain  the  SUserEntry, information associated with the user login  name.p ' !5Set the indentation string for the generated output. "4Set the verbosity level. This value can be queried 9 using the verbosity function, but is not otherwise used % by the -- functions in this module. #.If true print the elapsed time on termination $1If true, echo the shell command before beginning %,Type of output to generate during execution &Message printed on failure '*Message printed on successful termination (,Message printed before the execution begins )*Print nothing. +0Print an ellipsis (...) when the command starts  and then done. when it finishes. ,2Print a dot for every 1024 characters the command  outputs -Print all the command's output with each line ( indented using (by default) the string ' > '. .@Create a task that sends its output to a handle and then can be ? terminated using an IO operation that returns an exit status. ' Throws an error if the command fails. /012Remove styles by class 3*Add styles, replacing old ones if present 4Singleton case of setStyles 5Singleton case of addStyles 67Add styles only if not present 89:;;The timeDiffToString function returns the empty string for 6 the zero time diff, this is not the behavior I need. < !"#$%&'()*+,-./0123456789:;<./ ('&%$#"!:)-,+*0169347528<; ('&%$#"!!"#$%&'()-,+**+,-./0123456789:;<>HConcatenate two paths, making sure there is exactly one path separator. Use dropFileName ?Use takeFileName @resolve all references to ., .., extra slashes, and symlinks =>?@>?@=>?@ A9Traverse a directory and return a list of all the (path,  fileStatus) pairs. BTraverse a file system directory applying D to every directory, F : to every non-directory file, and M to every mount point. ! NOTE: It is tempting to use the find function to returns a list A of the elements of the directory and then map that list over an  unmount and remove/ function. However, because we are unmounting B as we traverse, the contents of the file list may change in ways ' that could confuse the find function. BARecursively remove a directory contents on a single file system.  The adjective "Safely" refers to these features: " 1. It will not follow symlinks > 2. If it finds a directory that seems to be a mount point, 8 it will attempt to unmount it up to five times. If it - still seems to be a mount point it gives up  3. It doesn't use proc$mounts, which is ambiguous or wrong  when you are inside a chroot. C$Like removeRecursiveSafely but doesn't remove any files, just A unmounts anything it finds mounted. Note that this can be much 2 slower than Mount.umountBelow, use that instead. D>Rename src to dst, and if dst already exists move it to dst~.  If dst~ exists it is removed. EItemporarily change the working directory to |dir| while running |action| FMcreate a temporary directory, run the action, remove the temporary directory C the first argument is a template for the temporary directory name d the directory will be created as a subdirectory of the directory returned by getTemporaryDirectory C the temporary directory will be automatically removed afterwards. ' your working directory is not altered GABCDEFGABCDEFGABCDEFGnon-portable (requires POSIX) provisionaljeremy@seereason.comHcalls crypt(3) key salt encrypted password HHH IJKLM9Compute an initial value for $QUIETNESS by examining the @ $QUIETNESS and $VERBOSITY variables and counting the -v and -q  options on the command line. NIGet the current quietness level from the QUIETNESS environment variable. O>Perform a task with the quietness level tansformed by f. Use  )defaultQuietness >>= modQuietness . const to initialize the --  verbosity for a program. PBDummy version of quieter, sometimes you want to strip out all the E quieter calls and see how things look, then restore them gradually. , Use this to help remember where they were. Q Peform a task only if quietness < 1. RAIf the current quietness level is less than one print a message. # Control the quietness level using quieter. SqPutStr with a terminating newline. TeMessage$ controlled by the quietness level. UqMessage with a terminating newline. VDPrint a message at quietness +1 and then do a task at quietness +3. 8 This is a pattern which gives the following behaviors: F Normally there is no output. With -v only the messages are printed. F With -v -v the messages and the shell commands are printed with dots 9 to show progress. With -v -v -v everything is printed. W[For debugging IJKLMNOPQRSTUVWXYZ[IJKLMNOPQRSTUVWXYZ[IJKLMNOPQRSTUVW[!BAn opaque type would give us additional type safety to ensure the  semantics of h. \AThe lazyCommand, lazyProcess and lazyRun functions each return a  list of \2. There will generally be one Result value at or 4 near the end of the list (if the list has an end.) ]^_`This is the type returned by  et. al. a>Kill the processes whose working directory is in or under the  given directory. bCreate a process with  and run it with d. cCreate a process with  and run it with d. d%Take the tuple like that returned by , C create a process, send the list of inputs to its stdin and return  the lazy list of \ objects. @Wait until at least one handle is ready and then write input or D read output. Note that there is no way to check whether the input C handle is ready except to try to write to it and see if any bytes @ are accepted. If no input is accepted, or the input handle is B already closed, and none of the output descriptors are ready for . reading the function sleeps and tries again. 6Return the next output element and the updated handle ' from a handle which is assumed ready. e6Filter everything except stdout from the output list. f6Filter everything except stderr from the output list. g;Filter the exit codes output list and merge the two output # streams in the order they appear. hBFilter everything except the exit code from the output list. See  discussion in d, of why we are confident that the list will  contain exactly one ]. An opaque type to hold the \ ) list would lend additional safety here. i3This belongs in Data.ByteString. See ticket 1070,   /http://hackage.haskell.org/trac/ghc/ticket/1070. jklmn<Turn all the Stdout text into Stderr, preserving the order. o<Turn all the Stderr text into Stdout, preserving the order. p!Split out and concatenate Stdout q!Split out and concatenate Stderr rNSplit out and concatenate both Stdout and Stderr, leaving only the exit code. s,Collect all output, unpack and concatenate. t*Partition the exit code from the outputs. \]^_`abcdefghijklmnopqrst`\_^]dbcefgjklmnopqrsthia\_^]]^_`abcdefghijklmnopqrst uBThe flags that control what type of output will be sent to stdout A and stderr. Also, the ExceptionOnFail flag controls whether an ! exception will be thrown if the ExitCode is not  ExitSuccess. vwxy%If All is present this has no effect z&If Echo is present this has no effect {|}~BNormally (when quietness is 0) we see the command echoed and dots > for progress indication. If quietness is -1 we also see the  command'.s output as it runs. If quietness is 1 we don' t see the / dots or the result code, and if it is 2 we don't see anything. The P; versions are the most general cases, here you can specify D a function that turns the quietness level into any set of progress  flags you like. Inject a command'+s output into the Progress monad, handling @ command echoing, output formatting, result code reporting, and C exception on failure. The flag set we get from the monad already  reflects the program'.s current quietness level, so calling quieter 8 and using the qPutStr functions here is not necessary. >Print one dot to stderr for every COUNT characters of output. GAdd prefixes to the output stream after every newline that is followed + by additional text, and at the beginning CPrint all the output to the appropriate output channel. Each pair C is the original input (to be returned) and the modified input (to  be printed.) =Print all the error output to the appropriate output channel >Run a task and return the elapsed time along with its result. GPerform a task, print the elapsed time it took, and return the result.  Unit tests. uvwxyz{|}~u~}|{zyxwvu ~}|{zyxwvvwxyz{|}~  # - unmounts all mount points below  belowPath  /proc/9mounts must be present and readable. Because of the way " linux handles changeroots, we can't trust everything we see in  /proc/5mounts. However, we make the following assumptions:  = there is a one-to-one correspondence between the entries in  /proc/"mounts and the actual mounts, and A (2) every mount point we might encounter is a suffix of one of ! the mount points listed in /proc/mounts (because being in a  a chroot doesn' t affect /proc/ mounts.) So we can search /proc/(mounts for an entry has the mount point ? we are looking for as a substring, then add the extra text on ? the right to our path and try to unmount that. Then we start 5 again since nested mounts might have been revealed. *For example, suppose we are chrooted into  /home/david/ environments/sid and we call umountBelow /proc. We  might see the mount point /home/david/ environments/sid/proc/bus/usb  in /proc/#mounts, which means we need to run umount /proc/bus/usb.  See also:  Lazy (umount -l flag) if true canonicalised, absolute path Upaths that we attempted to umount, and the responding output from the umount command ?umountSucceeded - predicated suitable for filtering results of  $ - unescape function for strings in /proc/mounts  - /proc/mount stytle string escaper & - run umount with the specified args * NOTE: this function uses exec, so you do not need to shell-escape  NOTE: we don'5t use the umount system call because the system call  is not smart enough to update /etc/mtab  4Echo the process arguments and then run the process 6 - run a process returning (stdout, stderr, exitcode) Warning9 - stdout and stderr will be read strictly so that we do B not deadlock when trying to check the exitcode. Do not try doing  something like, simpleProcess ["yes"] >NOTE: this may still dead-lock because we first strictly read D outStr and then errStr. Perhaps we should use forkIO or something? .chroot changes the root directory to filepath I NOTE: it does not change the working directory, just the root directory * NOTE: will throw IOError if chroot fails *fchroot runs an IO action inside a chroot C fchroot performs a chroot, runs the action, and then restores the @ original root and working directory. This probably affects the A chroot and working directory of all the threads in the process,  so... 3 NOTE: will throw IOError if internal chroot fails =The ssh inside of the chroot needs to be able to talk to the D running ssh-agent. Therefore we mount --bind the ssh agent socket ? dir inside the chroot (and umount it when we exit the chroot. ?A function to force the process output by examining it but not  printing anything. 8First send the process output to the and then force it. 7Print all the output to the appropriate output channel  !"#$%&'()*+,-.//0123456789:;8<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ [ \ ] ^ _ ` a b c d e f g h i j k l m8nopqrstuvwxyz{|}~       n   > 7 N   Unixutils-1.47System.Unix.ProcessSystem.Unix.OldProgressSystem.Unix.FilesSystem.Unix.SpecialDeviceSystem.Unix.ShadowSystem.Unix.FilePathSystem.Unix.DirectorySystem.Unix.CryptSystem.Unix.QIOSystem.Unix.ProgressSystem.Unix.MiscSystem.Unix.MountSystem.Unix.ProcessExtraSystem.Unix.ProcessStrictSystem.Unix.ChrootbaseGHC.IO.Exception ExitSuccess ExitFailureExitCodeold-time-1.0.0.7 System.Time noTimeDiffTimeDiffforceSymbolicLink SpecialDevice sysMountPointofPathrootPartofNode ofNodeStatus ofSysName ofSysPath ofMajorMinorofDevNotoDevnonodenodes splitPart diskOfPartsysNamesysDir getAllDisksgetAllPartitions getAllCdromsgetAllRemovable SUserEntry sUserName sUserPasswordgetSUserEntryForNameStyleIndent VerbosityElapsedEchoOutputErrorFinishStartQuietDoneDotsIndented systemTask otherTaskmsgmsgLn removeStyle setStylessetStyleaddStyleoutput addStyles stripDist verbosity readStylefixedTimeDiffToString showElapsed<++>dirNamebaseNamerealpathfindremoveRecursiveSafelyunmountRecursiveSafelyrenameFileWithBackupwithWorkingDirectorywithTemporaryDirectorymkdtempcryptePutStr ePutStrLneMessage eMessageLninitialQuietness quietnessquieterquieter'qDoqPutStr qPutStrLnqMessage qMessageLnq12q02v1v2v3showQResultStderrStdoutProcess killByCwd lazyCommand lazyProcesslazyRun stdoutOnly stderrOnly outputOnly exitCodeOnlyhPutNonBlocking checkResult discardStdout discardStderr discardOutput mergeToStderr mergeToStdout collectStdout collectStderr collectOutputcollectOutputUnpacked collectResult ProgressFlagExceptionOnFail ResultOnFail ErrorsOnFail AllOnFail EchoOnFailErrorsAll lazyCommandV lazyProcessV lazyCommandF lazyProcessF lazyCommandE lazyProcessE lazyCommandEF lazyProcessEF lazyCommandP lazyProcessPtimeTasktestsmd5sumgzip umountBelowumount isMountPoint cmdOutputcmdOutputStricttoLazytoStrict echoCommand echoProcess ePutStrBl simpleProcess processResult processOutput simpleCommand commandResult commandOutputfchrootuseEnv forceList forceList' unix-2.5.0.0System.Posix.FilescreateSymbolicLinkCharacterDevice BlockDeviceparseSysDevFile diskGroup cdromGroup floppyGroupgetDisksInGroupisPartdirectory_findCSpwd c_getspnam_runpackSUserEntryisERANGEdoubleAllocWhile pwBufSizethrowErrorIfNonZero_ putIndent startMessageprogressOutput finishMessage errorMessageindentelapsed isSublistOfmapSndePut c_realpath c_mkdtemptraversec_crypt Readyness EndOfFileUnreadyReadyOutputsprocess-1.1.0.0System.ProcessrunInteractiveProcessrunInteractiveCommandhReady'readynextOut ProgressState progressFlags doProgress dotOutputprefixes printOutput printErrors formatTime'umountSucceededunescapeescapec_chrootchroot