www-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

www/audio-video/workshop av-create


From: Therese Godefroy
Subject: www/audio-video/workshop av-create
Date: Fri, 11 Nov 2022 12:30:40 -0500 (EST)

CVSROOT:        /webcvs/www
Module name:    www
Changes by:     Therese Godefroy <th_g> 22/11/11 12:30:40

Modified files:
        audio-video/workshop: av-create 

Log message:
        More fixes.

CVSWeb URLs:
http://web.cvs.savannah.gnu.org/viewcvs/www/audio-video/workshop/av-create?cvsroot=www&r1=1.3&r2=1.4

Patches:
Index: av-create
===================================================================
RCS file: /webcvs/www/www/audio-video/workshop/av-create,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- av-create   11 Nov 2022 15:24:51 -0000      1.3
+++ av-create   11 Nov 2022 17:30:39 -0000      1.4
@@ -7,7 +7,7 @@
 # run it without argument.
 
 # Public domain.
-# Last updated 2022-11-10.
+# Last updated 2022-11-11.
 # Please report bugs to thg@gnu.org or ineiev@gnu.org.
 
 
@@ -73,12 +73,10 @@
  sed 's,^[a-z]\+-\([0-9]\{4\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)[0-9],\1-\2-\3,')
 from=${date%%-*}
 
-year=${date%00-00}
-month=${date%-00}
-if test ! "$year" = "$date"; then
-  fdate=$(date "+%Y" -d "$year")
-elif test ! "$month" = "$date"; then
-  date="${month}-01"
+if test ! "${date%00-00}" = "$date"; then
+  fdate=$(date "+%Y" -d "$from")
+elif test ! "${date%-00}" = "$date"; then
+  date="${date/-00/-01}"
   fdate=$(date "+%B %Y" -d "$date")
 else
   fdate=$(date "+%B %d, %Y" -d "$date")
@@ -93,25 +91,32 @@
        English) lang="en";;
        Spanish) lang="es";;
         French) lang="fr";;
-    Malayalam ) lang="ml";;
+     Malayalam) lang="ml";;
              *) lang="other";;
   esac
 fi
 
 duration=${Duration#* }
-if echo $duration | grep -q '^[0-9]:[0-9]\{1,2\}:[0-9]\{1,2\}$'; then
-  h=${duration%%:*}
-  m=${duration%:*} && m=${m#*:}
-  s=${duration##*:}
+if ! echo $duration | grep -q '^[0-9]:[0-9]\{1,2\}:[0-9]\{1,2\}$'; then
+  echo "!!! The Duration field has wrong data: $duration; exit"
+  exit 1
+else
+  h=${duration%%:*} && h=${h##0}
+  m=${duration%:*} && m=${m#*:} && m=${m##0}
+  s=${duration##*:} && s=${s##0}
+  echo "hours = $h"
+  echo "minutes = $m"
+  echo "seconds = $s"
   errors=""
-  if [ "$h" -ne "0" ]; then
+  duration=""
+  if [ $h -ne 0 ]; then
     if [ $h -gt 5 ]; then
       echo "??? Are you sure this recording is $h hours long?"
     fi
     duration=${h}h
     hs=$(( $h * 3600 ))
   fi
-  if [ "$m" -ne "0" ]; then
+  if [ $m -ne 0 ]; then
     if [ $m -gt 59 ]; then
       m_error="\n    $m min is more than one hour."
       errors=1
@@ -142,9 +147,6 @@
     printf 1>&2 "!!! Error(s) in the Duration field: $m_error 
$s_error\nExit.\n"
     exit 1
   fi
-else
-  echo 1>&2 "!!! The Duration field has wrong data: $duration; exit"
-  exit 1
 fi
 
 awk -v from="$from" -v lang="$lang" -v tlength="$tlength" -v media="$media" \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]