Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKévin Raymond <shaiton@fedoraproject.org>2011-12-16 23:17:29 (GMT)
committer Kévin Raymond <shaiton@fedoraproject.org>2011-12-16 23:17:29 (GMT)
commit07e05fc08353b1bd11df3ea983fe3c879d824e0e (patch)
treee5adc30226ceb57364805f7cfe9a306548e0bead
parent24af0e5b403ccf23dbeff790a21946758a83ec77 (diff)
should work soonbroken
-rwxr-xr-xjparser25
1 files changed, 8 insertions, 17 deletions
diff --git a/jparser b/jparser
index 69f12e3..5ebc3a6 100755
--- a/jparser
+++ b/jparser
@@ -76,18 +76,9 @@ get_sed()
# parse filename output name output_format
#
-par()
-{
-
- echo $*
- echo "WHOLE=$WHOLE=BASIC=$BASIC=X=$CHILD=SOURCE=$SOURCE=DEST=$DEST"
- exit 0
-
-}
-
parse()
{
- tmp=$(sed -e 's/": ["]/:/g;s/["], "/#/g;s/^{"//g;s/: ""}//g;s/": /:/g;s/, "/#/g;s/"}//g' $1)
+ tmp=$(sed -e 's/": ["]/:/g;s/["], "/#/g;s/^{"//g;s/: ""}//g;s/": /:/g;s/, "/#/g;s/"}//g' $SOURCE)
IFS='#' read -ra ADDR <<< "$tmp"
for i in "${ADDR[@]}"; do
@@ -104,13 +95,13 @@ parse()
esac
done
- if [ -z $BASIC ]
+ if [ ! -z $BASIC ]
then
- echo `date -d @${timestamp} +%d/%m/%Y`${separator}${uid}${separator}${title}${separator}${buddies} >> ${2}${simple_suffix}
+ echo `date -d @${timestamp} +%d/%m/%Y`${separator}${uid}${separator}${title}${separator}${buddies} >> ${DEST}${simple_suffix}
fi
- if [ -z $WHOLE ]
+ if [ ! -z $WHOLE ]
then
- echo ${activity}${separator}${timestamp}${separator}${uid}${separator}${title}${separator}${title_set}${separator}${buddies} >> $2
+ echo ${activity}${separator}${timestamp}${separator}${uid}${separator}${title}${separator}${title_set}${separator}${buddies} >> $DEST
fi
exit 0
@@ -141,7 +132,7 @@ do
USERNAME=$OPTARG
;;
s)
- if [ ! -d "$OPTARG" ]
+ if [ ! -r "$OPTARG" ]
then
echo "Error, path providen incorrect (check permissions)"
exit 1
@@ -167,7 +158,7 @@ done
if [ ! -z $CHILD ] # Am I a child process used for parsing?
then
- par $4 $DEST $WHOLE $BASIC
+ parse
else
if [ -z $USERNAME ]
then
@@ -204,7 +195,7 @@ fi
# Now we call ourself to be able to inter in the function. Also used to run in concurrency (remove the & to debug…)
#find $SOURCE -name "*$metadata" -exec $0 -x $callme -s '{}' -d $out $WHOLE $BASIC \;&
-find $SOURCE -name "*$metadata" -exec $0 -x $callme -s '{}' -d $out $WHOLE $BASIC \;
+find $SOURCE -name "*$metadata" -exec $0 -x $callme -s '{}' -d $out $WHOLE $BASIC \;&
wait # wait the end of parsing
if [ ! -z $BASIC ]