PROG_VERSION=0.2
AVAILABLE_TYPES="gnome tjds desktop-other"
LANG=C
export LANG
{
while [ $# -gt 0 ]
do
-c|--create)
CREATE_COPYRIGHT=1;;
-h|--help)
exit 0;;
-m|--merge)
-t|--type)
shift
*)
echo "Unknown type $1" 1>&2
exit 1;;
esac
;;
*)
exit 1;;
esac
shift
done
}
{
printf "This script makes L10N copyright files from "
printf "/usr/share/locale/LANG/LC_MESSAGES/COPYING.foo .\n"
printf "\n"
printf "usage: $PROGNAME Version $PROG_VERSION -c|-m [OPTIONS...]\n"
printf " -c, --create Create l10n copyright files.\n"
printf " -m, --merge Merge l10n copyright files with base ones.\n"
printf " This option is used after -c is run.\n"
printf " -h, --help Show this message.\n"
printf "\n"
printf "Options:\n"
printf " -t, --type TYPE $AVAILABLE_TYPES is available for TYPE.\n"
printf " the default is gnome.\n"
printf "\n"
printf "NOTE: This overrides the copyright files in $HOME/packages/spec-files/copyright/*.\n"
}
{
rm -f $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright
echo "Creating $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright ..."
>> $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright
for LING in $LING_MESSAGE
do
echo "-------------------------------------------------------------" \
>> $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright
>> $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright
done
rm -f $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright
echo "Creating $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright ..."
>> $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright
do
echo "-------------------------------------------------------------" \
>> $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright
>> $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright
done
}
{
do
rm -f $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright
echo "Creating $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright ..."
>> $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright
echo "-------------------------------------------------------------" \
>> $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright
>> $COPY_ORG_DIR/${COPY_ORG}-m-$TAG.copyright
rm -f $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright
echo "Creating $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright ..."
>> $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright
echo "-------------------------------------------------------------" \
>> $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright
>> $COPY_ORG_DIR/${COPY_ORG}-d-$TAG.copyright
done
}
{
LING_MESSAGE="ar az az_IR fa he ur ur_PK yi"
LING_DOC="ar"
LING_MESSAGE="bg ca ca@valencia da el et fi hr is lt lv mk mt nb nl nn no pt pt_PT ro sk sl sq sr sr@Latn sr@ije sr@latin ta te th tr"
LING_DOC="bg ca da el fi mk nl ru sr"
LING_MESSAGE="aa af am ang as be be@latin bn bn_IN br bs byn cy dv dz eo eu fo fur ga gez gl gn gu gv haw hy ia id io iu ka kk kl km kn kok ku kw ky li lo mai mg mi ml mn mr ms my_MM nds@NFE ne nso oc om or pa ps rw sa si sid so sw syr tg ti tig tk tl tt ug uk uz uz@cyrillic ve vi wa wal wo xh yo zu"
LING_DOC="eu oc pa uk vi"
}
{
LING_MESSAGE="ar he"
LING_DOC="ar"
LING_MESSAGE="bg ca da el et fi hr lt mk nb nl pt ro sk sl sr ta tr wo"
LING_DOC="bg ca da el fi mk nl ru sr"
LING_MESSAGE="af bn bs cy gl gu id ka km lo mr pa uk vi xh zu"
LING_DOC="eu oc pa uk vi"
}
{
do
continue;
fi
continue;
fi
done
TAGS="NONE"
else
TAGS="cs de es fr hi hu it ja ko pl ptBR ru sv zhCN zhHK zhTW rtl extra noinst"
fi
do
else
fi
continue
fi
do
echo "Merging $L10N_COPYRIGHT_FILE ..."
do
echo "-------------------------------------------------------------" \
done
done
done
}
{
}
{
}
{
}
{
init $@
if [ $TYPE -eq $TYPE_DESKTOP_OTHER ] ; then
if [ ! -d $HOME/packages/spec-files-other ] ; then
exit 1
fi
else
if [ ! -d $HOME/packages/spec-files ] ; then
exit 1
fi
fi
if [ $CREATE_COPYRIGHT -ne 0 -a $TYPE -eq $TYPE_GNOME ] ; then
elif [ $CREATE_COPYRIGHT -ne 0 -a $TYPE -eq $TYPE_DESKTOP_OTHER ] ; then
echo "Please run this script on x86 for desktop-other" 1>&2
exit 1
fi
fi
if [ $MERGE_BASE_COPYRIGHT -ne 0 -a $TYPE -eq $TYPE_GNOME ] ; then
elif [ $MERGE_BASE_COPYRIGHT -ne 0 -a $TYPE -eq $TYPE_TJDS ] ; then
elif [ $MERGE_BASE_COPYRIGHT -ne 0 -a $TYPE -eq $TYPE_DESKTOP_OTHER ] ; then
fi
}
main $@