Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

Unfortunately, in the distribute tool that I've mentioned here in another answerthe distribute tool that I've mentioned here in another answer, the simplicity of the essential splitting task is not matched by the complexity and bloatedness of the user interface of distribute (because it was written to combine several tasks; although performed in stages, but still combined not in the cleanest way I could think of now).

Unfortunately, in the distribute tool that I've mentioned here in another answer, the simplicity of the essential splitting task is not matched by the complexity and bloatedness of the user interface of distribute (because it was written to combine several tasks; although performed in stages, but still combined not in the cleanest way I could think of now).

Unfortunately, in the distribute tool that I've mentioned here in another answer, the simplicity of the essential splitting task is not matched by the complexity and bloatedness of the user interface of distribute (because it was written to combine several tasks; although performed in stages, but still combined not in the cleanest way I could think of now).

Typo.
Source Link

Note that the eatFiles function prepares the layouts of the future disks as treetrees where the leaves are symlinks to the real files. So, it is meeting your requirement that you should be able to edit the layouts before burning. The mkisofs utility has an option to follow symlinks, which is indeed employed in the code of my mkiso function.

Note that the eatFiles function prepares the layouts of the future disks as tree where the leaves are symlinks to the real files. So, it is meeting your requirement that you should be able to edit the layouts before burning. The mkisofs utility has an option to follow symlinks, which is indeed employed in the code of my mkiso function.

Note that the eatFiles function prepares the layouts of the future disks as trees where the leaves are symlinks to the real files. So, it is meeting your requirement that you should be able to edit the layouts before burning. The mkisofs utility has an option to follow symlinks, which is indeed employed in the code of my mkiso function.

(minor) Turned on syntax highlighting for the bash code.
Source Link
# Splitting: function splitMirrorDir() { if [[ ! -d "$THIS_BASES_DIR/$BASE/$type" ]]; then echo $"No base fixed for $type" >&2 exit 1 fi # Getting the list of all suitable files: local -a allFiles let 'no = 0' ||: allFiles=() # no points to the next free position in allFiles # allFiles contains the constructed list for p in "$THIS_BASES_DIR/$BASE/$type"/*.rpm; do if [[ ! -e "$p" ]]; then # fail on non-existent files echo $"Package file doesn't exist: " "$p" >&2 return 1 fi if [[ "$ONLY_REAL_FILES" == "yes" && ! -f "$p" ]]; then continue fi if [[ "$DIFF_TO_BASE" ]]; then older_copy="$DIFF_TO_BASE/$type/${p##*/}" # using shell param expansion instead of `basename' to speed up if [[ -h "$older_copy" || -a "$older_copy" ]]; then continue fi fi allFiles[$(( no++ ))]="$p" done readonly -a allFiles # Splitting the list of all files into future disks: # local -a filesToEat allSizes let 'no = 0' ||: filesToEat=() allSizes=($(getSize "${allFiles[@]}")) readonly -a allSizes # allSizes contains the sizes corrsponding to allFiles # filesToEat hold the constructed list of files to put on the current disk # no points to the next free position in filesToEat # totalSize should hold the sum of the sizes # of the files already put into filesToEat; # it is set and reset externally. for p in "${allFiles[@]}"; do if (( totalsize + ${allSizes[$(( no ))]} > CDVOLUME )); then eatFiles "${filesToEat[@]}" filesToEat=() finishCD startTypedCD fi let "totalsize += ${allSizes[$(( no ))]}" ||: filesToEat[$(( no++ ))]="$p" done eatFiles "${filesToEat[@]}" } function eatFiles() { #{ oldIFS="$IFS"; IFS=$'\n'; echo "$FUNCNAME: args: " "$*" | head >&2; IFS="$oldIFS"; } zeroDelimited "$@" | xargs -0 --no-run-if-empty \ cp -s \ --target-dir="$THIS_LAYOUTS_DIR/cd$(( cdN ))/$PREFIX/$type$DOT_SUFFIX"/ \ -- } function startTypedCD() { # set -x mkdir -p "$THIS_LAYOUTS_DIR/cd$(( cdN ))/$PREFIX/$type$DOT_SUFFIX" start_action $" %s with %s" "$(( cdN ))" "$type" # set +x } function finishCD() { 
# Splitting: function splitMirrorDir() { if [[ ! -d "$THIS_BASES_DIR/$BASE/$type" ]]; then echo $"No base fixed for $type" >&2 exit 1 fi # Getting the list of all suitable files: local -a allFiles let 'no = 0' ||: allFiles=() # no points to the next free position in allFiles # allFiles contains the constructed list for p in "$THIS_BASES_DIR/$BASE/$type"/*.rpm; do if [[ ! -e "$p" ]]; then # fail on non-existent files echo $"Package file doesn't exist: " "$p" >&2 return 1 fi if [[ "$ONLY_REAL_FILES" == "yes" && ! -f "$p" ]]; then continue fi if [[ "$DIFF_TO_BASE" ]]; then older_copy="$DIFF_TO_BASE/$type/${p##*/}" # using shell param expansion instead of `basename' to speed up if [[ -h "$older_copy" || -a "$older_copy" ]]; then continue fi fi allFiles[$(( no++ ))]="$p" done readonly -a allFiles # Splitting the list of all files into future disks: # local -a filesToEat allSizes let 'no = 0' ||: filesToEat=() allSizes=($(getSize "${allFiles[@]}")) readonly -a allSizes # allSizes contains the sizes corrsponding to allFiles # filesToEat hold the constructed list of files to put on the current disk # no points to the next free position in filesToEat # totalSize should hold the sum of the sizes # of the files already put into filesToEat; # it is set and reset externally. for p in "${allFiles[@]}"; do if (( totalsize + ${allSizes[$(( no ))]} > CDVOLUME )); then eatFiles "${filesToEat[@]}" filesToEat=() finishCD startTypedCD fi let "totalsize += ${allSizes[$(( no ))]}" ||: filesToEat[$(( no++ ))]="$p" done eatFiles "${filesToEat[@]}" } function eatFiles() { #{ oldIFS="$IFS"; IFS=$'\n'; echo "$FUNCNAME: args: " "$*" | head >&2; IFS="$oldIFS"; } zeroDelimited "$@" | xargs -0 --no-run-if-empty \ cp -s \ --target-dir="$THIS_LAYOUTS_DIR/cd$(( cdN ))/$PREFIX/$type$DOT_SUFFIX"/ \ -- } function startTypedCD() { # set -x mkdir -p "$THIS_LAYOUTS_DIR/cd$(( cdN ))/$PREFIX/$type$DOT_SUFFIX" start_action $" %s with %s" "$(( cdN ))" "$type" # set +x } function finishCD() { 
# Splitting: function splitMirrorDir() { if [[ ! -d "$THIS_BASES_DIR/$BASE/$type" ]]; then echo $"No base fixed for $type" >&2 exit 1 fi # Getting the list of all suitable files: local -a allFiles let 'no = 0' ||: allFiles=() # no points to the next free position in allFiles # allFiles contains the constructed list for p in "$THIS_BASES_DIR/$BASE/$type"/*.rpm; do if [[ ! -e "$p" ]]; then # fail on non-existent files echo $"Package file doesn't exist: " "$p" >&2 return 1 fi if [[ "$ONLY_REAL_FILES" == "yes" && ! -f "$p" ]]; then continue fi if [[ "$DIFF_TO_BASE" ]]; then older_copy="$DIFF_TO_BASE/$type/${p##*/}" # using shell param expansion instead of `basename' to speed up if [[ -h "$older_copy" || -a "$older_copy" ]]; then continue fi fi allFiles[$(( no++ ))]="$p" done readonly -a allFiles # Splitting the list of all files into future disks: # local -a filesToEat allSizes let 'no = 0' ||: filesToEat=() allSizes=($(getSize "${allFiles[@]}")) readonly -a allSizes # allSizes contains the sizes corrsponding to allFiles # filesToEat hold the constructed list of files to put on the current disk # no points to the next free position in filesToEat # totalSize should hold the sum of the sizes # of the files already put into filesToEat; # it is set and reset externally. for p in "${allFiles[@]}"; do if (( totalsize + ${allSizes[$(( no ))]} > CDVOLUME )); then eatFiles "${filesToEat[@]}" filesToEat=() finishCD startTypedCD fi let "totalsize += ${allSizes[$(( no ))]}" ||: filesToEat[$(( no++ ))]="$p" done eatFiles "${filesToEat[@]}" } function eatFiles() { #{ oldIFS="$IFS"; IFS=$'\n'; echo "$FUNCNAME: args: " "$*" | head >&2; IFS="$oldIFS"; } zeroDelimited "$@" | xargs -0 --no-run-if-empty \ cp -s \ --target-dir="$THIS_LAYOUTS_DIR/cd$(( cdN ))/$PREFIX/$type$DOT_SUFFIX"/ \ -- } function startTypedCD() { # set -x mkdir -p "$THIS_LAYOUTS_DIR/cd$(( cdN ))/$PREFIX/$type$DOT_SUFFIX" start_action $" %s with %s" "$(( cdN ))" "$type" # set +x } function finishCD() { 
# Splitting: function splitMirrorDir() { if [[ ! -d "$THIS_BASES_DIR/$BASE/$type" ]]; then echo $"No base fixed for $type" >&2 exit 1 fi # Getting the list of all suitable files: local -a allFiles let 'no = 0' ||: allFiles=() # no points to the next free position in allFiles # allFiles contains the constructed list for p in "$THIS_BASES_DIR/$BASE/$type"/*.rpm; do if [[ ! -e "$p" ]]; then # fail on non-existent files echo $"Package file doesn't exist: " "$p" >&2 return 1 fi if [[ "$ONLY_REAL_FILES" == "yes" && ! -f "$p" ]]; then continue fi if [[ "$DIFF_TO_BASE" ]]; then older_copy="$DIFF_TO_BASE/$type/${p##*/}" # using shell param expansion instead of `basename' to speed up if [[ -h "$older_copy" || -a "$older_copy" ]]; then continue fi fi allFiles[$(( no++ ))]="$p" done readonly -a allFiles # Splitting the list of all files into future disks: # local -a filesToEat allSizes let 'no = 0' ||: filesToEat=() allSizes=($(getSize "${allFiles[@]}")) readonly -a allSizes # allSizes contains the sizes corrsponding to allFiles # filesToEat hold the constructed list of files to put on the current disk # no points to the next free position in filesToEat # totalSize should hold the sum of the sizes # of the files already put into filesToEat; # it is set and reset externally. for p in "${allFiles[@]}"; do if (( totalsize + ${allSizes[$(( no ))]} > CDVOLUME )); then eatFiles "${filesToEat[@]}" filesToEat=() finishCD startTypedCD fi let "totalsize += ${allSizes[$(( no ))]}" ||: filesToEat[$(( no++ ))]="$p" done eatFiles "${filesToEat[@]}" } function eatFiles() { #{ oldIFS="$IFS"; IFS=$'\n'; echo "$FUNCNAME: args: " "$*" | head >&2; IFS="$oldIFS"; } zeroDelimited "$@" | xargs -0 --no-run-if-empty \ cp -s \ --target-dir="$THIS_LAYOUTS_DIR/cd$(( cdN ))/$PREFIX/$type$DOT_SUFFIX"/ \ -- } function startTypedCD() { # set -x mkdir -p "$THIS_LAYOUTS_DIR/cd$(( cdN ))/$PREFIX/$type$DOT_SUFFIX" start_action $" %s with %s" "$(( cdN ))" "$type" # set +x } function finishCD() { 
Typo.
Source Link
Loading
(minor) Punctuation.
Source Link
Loading
(minor) Presentational/intro words before a paragraph, to help the reader through the text without loosing the idea of why the text has been written.
Source Link
Loading
(minor) Expand a bit the note on the design faults of "distribute".
Source Link
Loading
Source Link
Loading