[Abcde-users] Custom Command Output to Output DIR/Folder

Roger rogerx.oss at gmail.com
Wed May 29 19:26:16 BST 2013


> On Wed, May 29, 2013 at 06:27:50AM -0400, Mike Poirier wrote:
>   Hey Roger,
>   I wrote earlier in the month about trying to grab/produce a log file from
>   cdparanoia along the way. �This thread you've got going seems like it can
>   help in that intent.
>   Are any of the custom functions triggered after a track is ripped to a
>   wav? As far as I can tell (from some simple "echo" flags), they're not.
>   If such a custom function existed, and it could also export the track
>   number ripped in a variable, that would be extremely helpful and would
>   make fetching a cdparanoia log file easy. �


I have sort of given up due to the lack of interest by others.

The custom pre- and post- functions within ${HOME}/abcde.conf do not work as 
expected and merrily seem to be tacked-in without much testing.  The variable 
definitions are being dropped (ie. filenaming), making using pre/post functions 
with the defined abcde variable names mostly impossible.  At least there's 
something in the code/script providing such a fuction.  ;-)

For now, I have just hacked in a custom command into the /usr/bin/abcde script 
as follows for my own personal use.  It works, but you'll notice the abcde 
scripting somewhere clears variable definitions, some how undefining my read 
only variable "HAVE_ALREADY_RUN_CDRDAO"!  As such, cdrdao would run after each 
track extraction and move to the destination folder.   Sort of unexpected.  
Since cdrdao prevents over-writing it's own files, I just ignored the remaining 
warnings.  I have now pretty much finished with extracting all my CD's to PCM 
WAV.


The below should give you an idea what I'm did.  For your cdparanoia log file, 
I would write in a quick "for $MY_COUNTER=1; do cdparanoia --log-debug 
/tmp/cdparanoia_log-${MY_COUNTER}.log; MY_COUNTER=${MY_COUNTER}+1" just prior 
to the call of cdparanoia within the /usr/bin/abcde file.  Basically, you're 
going to encapsulate the cdparanoia command with a generic variable counter.

Based on activity and the complexity of integrating the pre and post functions, 
I don't see anybody fixing within the near future.  The best first step would 
be to fix VI/VIM syntax highlighting with removing single quotes from the 
comments as I already mentioned within the mailing list.  Really sort of a 
trivial fix, or fix within VIM syntax highlighting.

Once highlinting is fixed, then can start working on fixing the pre/post 
functions more safely.  But to do so, may require rewriting major parts of the 
script, making a complete rewrite more preferable. :-/  In other words, you can 
still likely read through the script, but you can evidentally see where 
scripting has been added or modified, due to the added complexity while trying 
to comprehend the script.

If you notice, at the very end of the main routine, you'll see another large 
chunk of scripting piping into the entire main routine.  Quite odd, but guess 
somebody did so to implement a feature without having to rewrite everything.

If this were my baby for the Summer or had millions of CD's to digitize, I 
would likely sit down and rewrite everything from scratch, making everything 
easier to follow.  Do get me wrong, abcde works pretty good now and is somewhat 
still easy to read.  ABCDE is just getting to a point where it needs to be 
likely rewritten to properly include a pre/post functions without introducing 
further complexity to code reading. ;-)


(The below custom patch of mine, omits the read-only definition of a variable I 
that I guess I named as "RAN_POST_MOVE" after noticing the read-only variable 
definitions were being dropped within abcde.)


--- /usr/bin/abcde.orig 2013-05-15 17:35:11.864693787 -0800
+++ /usr/bin/abcde      2013-05-15 17:55:36.270754854 -0800
@@ -1429,6 +1429,18 @@
                                        fi
                                        ;;
                        esac
+
+                       # Run post_move only once, while taking advantage of $OUTPUTFILEDIR variables.
+                       #if [ $RAN_POST_MOVE -eq 0 ] || [ -z $RAN_POST_MOVE ]; then
+                               if [ -z $RAN_POST_MOVE ]; then
+                                       echo "At line 1434:"
+                                       echo "OUTPUTDIR: "$OUTPUTDIR
+                                       echo "OUTPUTFILE: "$OUTPUTFILE
+                                       echo "OUTPUTFILEDIR= "$OUTPUTFILEDIR
+                                       cdrdao read-toc --fast-toc $OUTPUTFILEDIR/.cd.toc
+                                       RAN_POST_MOVE=1
+                               fi
+
                        # Lets move the cue file
                        if CUEFILE=$(checkstatus cuefile) >/dev/null ; then
                                if [ -r "$ABCDETEMPDIR/$CUEFILE" ]; then


-- 
Roger
http://rogerx.freeshell.org/



More information about the Abcde-users mailing list