vuxml – fix

This isn’t so much a fix for the vuxml problem mentioned previously as it is a fix for properly detecting and reporting fetch errors. The patch is pretty simple:

$ cvs di -u utilities.pm
Index: utilities.pm
===================================================================
RCS file: /home/repositories/freshports-1/scripts/utilities.pm,v
retrieving revision 1.16
diff -u -r1.16 utilities.pm
--- utilities.pm        13 Sep 2007 13:01:41 -0000      1.16
+++ utilities.pm        13 Sep 2007 13:43:33 -0000
@@ -74,9 +74,9 @@
                my $command = "sh $FreshPorts::Config::scriptpath/fetch-cvs-file.sh \
                                    $URL $SRCDIR $FILE $REVISION $SUFFIX 2>&1";
                print "about to fetch = '$command'";
                my $FetchResults = `$command`;
-               $result = $?;
-#              print "fetch result = $result\n";
-               if (($result >> 8)) {
+               my $code = $?;
+               print "fetch result = $code\n";
+               if (($code >> 8)) {
                        #
                        # This might be a nice place to retry a fetch, or send an email
                        #

It is not shown, but $result is returned by this function. It was being overwritten by the fetch command. With this change, we use $code instead of $result for the fetch, thereby ensuring that this code segment works correctly:

    my $result = 0;

    my $FetchAttempts = $FreshPorts::Config::Fetch_Retry_Limit;

    while ($FetchAttempts) {
...
    # if we succeeded in our fetch..
    if ($FetchAttempts) {
        $result = 1;
    }

    return $result;

I’ll be putting this code into production soon.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top