[Pkg-mc-devel] Bug#479549: [VFS] NEW: tar files (even compreessed with bzip2/gzip) can now be updated
Michelle Konzack
linux4michelle at freenet.de
Fri May 9 21:26:05 UTC 2008
Attached updated version which can not localized...
Thanks, Greetings and nice Day
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
+49/177/9351947 50, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
-------------- next part --------------
#!/bin/bash
# #
# Copyright 2008, Michelle Konzack All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions #
# are met: #
# #
# 1. Redistributions of source code must retain the above copyright #
# notice, this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above #
# copyright notice, this list of conditions and the following #
# disclaimer in the documentation and/or other materials provided #
# with the distribution. #
# #
# 3. Neither the name of Michelle Konzack nor the names of its #
# contributors may be used to endorse or promote products derived #
# from this software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY MICHELLE KONZACK AND CONTRIBUTORS #
# ``AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT #
# NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND #
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT #
# SHALL MICHELLE KONZACK OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, #
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES #
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) #
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR #
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, #
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
EXENAME=tdmc_tar
PKGNAME=tdmc
if [ -n "$(which gettext.sh)" ] ; then
. gettext.sh
else
gettext()
{
echo "$1"
}
eval_gettext()
{
eval 'echo $1'
}
fi
export TEXTDOMAIN=${PKGNAME}
export TEXTDOMAINDIR=/usr/share/locale
VERSION=0.0.2
AUTHORNAME="Michelle Konzack"
AUTHORMAIL="linux4michelle at freenet.de"
LICENSE=$(gettext 'This tool is under GNU GPL version 3.0')
LICENSE_LONG=/usr/share/common-licenses/GPL-3
########################################################################
if [ "${MCVFS_DEBUG}" = "true" ] ; then
STRG="------------------------"
date --rfc-822 >>${HOME}/.mc/mcvfs_debug
echo -e "0: $0\n1: $1\n2: $2\n3: $3\n4: $4" >>${HOME}/.mc/mcvfs_debug
echo "${STRG}${STRG}${STRG}" >>${HOME}/.mc/mcvfs_debug
fi
########################################################################
if [ -n "$(echo ",list,copyout,copyin,rm,mkdir,rmdir," |grep ",$1,")" ] ; then
ARCHIVENAME=/tmp/`echo "$2" |md5sum |sed 's|\ .*||'`
find /tmp -name "`basename ${ARCHIVENAME}`" -mmin -30 -maxdepth 1 -mindepth 1 >/dev/null 2>&1
if [ $? -ne 0 ] ; then
rm --force ${ARCHIVENAME}
fi
if [ ! -f ${ARCHIVENAME} ] ; then
if [ -n "$(echo "$2" |grep '.tar.bz2$' )" ] ; then
bzcat "$2" >${ARCHIVENAME}
elif [ -n "$(echo "$2" |grep '.tar.gz$' )" ] ; then
zcat "$2" >${ARCHIVENAME}
else
cat "$2" >${ARCHIVENAME}
fi
fi
fi
########################################################################
if [ "$1" = "list" ] ; then
fnc_list()
{
TMPFILE=`mktemp -t tdmc.XXXXXX || exit 1`
(tar --list --numeric-owner --verbose --file ${ARCHIVENAME} |tr -s ' ') |
while read LINE
do
VAL_mode=`echo "${LINE}" |cut -d ' ' -f1`
VAL_ugid=`echo "${LINE}" |cut -d ' ' -f2`
VAL_uid=`echo ${VAL_ugid} |cut -d '/' -f1`
VAL_gid=`echo ${VAL_ugid} |cut -d '/' -f2`
VAL_size=`echo "${LINE}" |cut -d ' ' -f3`
VAL_date=`echo "${LINE}" |cut -d ' ' -f4`
VAL_time=`echo "${LINE}" |cut -d ' ' -f5`
VAL_dati=`date --date="${VAL_date} ${VAL_time}" +"%b %d %Y %H:%M"`
VAL_path=`echo "${LINE}" |cut -d ' ' -f6- |sed 's|/$||g'`
VAL_links=1
echo "${VAL_path} 0 ${VAL_mode} ${VAL_links} ${VAL_uid} ${VAL_gid} ${VAL_size} ${VAL_dati}" >>${TMPFILE}
done
fnc_foo1()
{
(cat ${TMPFILE}) |
while read LINE
do
if [ -n "`echo "${LINE}" |cut -d ' ' -f3- |grep '^d'`" ] ; then
echo "${LINE}"
fi
done
}
DIRS=`fnc_foo1`
fnc_foo2()
{
(cat ${TMPFILE}) |
while read LINE
do
if [ -z "`echo "${LINE}" |cut -d ' ' -f3 |grep --regexp='^d'`" ] ; then
echo "${LINE}"
fi
done
(echo "${DIRS}") |
while read LINE
do
DIR1="`echo "${LINE}" |cut -d ' ' -f1 |sed 's|$|/|'`"
if [ -z "`grep --regexp="${DIR1}" ${TMPFILE}`" ] ; then
echo "${LINE}"
fi
done
}
fnc_foo2 |
sort |
sed 's|\(.*\) 0 \(.*\) \(.*\) \(.*\) \(.*\) \(.*\) \(.*\) \(.*\) \(.*\)$|\2 \3 \4 \5 \6 \7 \8 \9 \1|g'
rm --force ${TMPFILE}
}
fnc_list
#=======================================================================
elif [ "$1" = "copyout" ] ; then
fnc_copyout()
{
TMPFILE=`mktemp -t tdmc.XXXXXX || exit 1`
echo "$2" >${TMPFILE}
tar --extract --numeric-owner --to-stdout --files-from ${TMPFILE} --file $1 >$3
rm --force ${TMPFILE}
}
fnc_copyout "${ARCHIVENAME}" "$3" "$4"
#=======================================================================
elif [ "$1" = "copyin" ] ; then
fnc_copyin()
{
TMP_DIR=`mktemp -t -d tdmc.XXXXXX || exit 1`
DIRNAME=${TMP_DIR}/`dirname $2`
DIRNAME=`echo "${DIRNAME}" |sed 's|/\.$||'`
FILENAME=`basename $2`
mkdir -p ${DIRNAME}
ln -s ${PWD}/${FILENAME} ${DIRNAME}/${FILENAME}
FN=`dirname $2`/${FILENAME}
FN=`echo "${FN}" |sed 's|\./||'`
tar --update --numeric-owner --dereference --directory ${TMP_DIR} --file $1 ${FN}
rm --force ${DIRNAME}/*
BN=`basename ${TMP_DIR}`
cd ${TMP_DIR} && cd .. && rmdir --parents `echo "${DIRNAME}" |sed "s|.*${BN}|${BN}|" |sed 's|\.$||'`
}
fnc_copyin "${ARCHIVENAME}" "$3" "$4" >>${HOME}/.mc/mcvfs_debug
#=======================================================================
elif [ "$1" = "rm" ] ; then
fnc_rm()
{
tar --delete --file $1 $2 2>/dev/null
if [ $? -ne 0 ] ; then
tar --delete --file $1 ./$2 2>/dev/null
fi
}
fnc_rm "${ARCHIVENAME}" "$3"
#=======================================================================
elif [ "$1" = "mkdir" ] ; then
gettext 'VFS#tar: It is not possibel to create empty directories in an archive.' 1>&2
#=======================================================================
elif [ "$1" = "rmdir" ] ; then
gettext 'VFS#tar: It is not possibel to remove empty directories in an archive.' 1>&2
#=======================================================================
elif [ "$1" = "run" ] ; then
gettext 'VFS#tar: what is "run"?' 1>&2
#=======================================================================
else
gettext 'Usage: ${libdir}/extfs/prefix command [arguments]' 1>&2
echo "" 1>&2
gettext ' list archivename' 1>&2
gettext ' copyout archivename storedfilename extractto' 1>&2
gettext ' copyin archivename storedfilename sourcefile' 1>&2
gettext ' rm archivename storedfilename' 1>&2
gettext ' mkdir archivename dirname' 1>&2
gettext ' rmdir archivename dirname' 1>&2
gettext ' run ???' 1>&2
exit 1
fi
########################################################################
if [ -n "$(echo ",copyout,copyin,rm,mkdir,rmdir," |grep ",$1,")" ] ; then
if [ -n "$(echo "$2" |grep '.tar.bz2$')" ] ; then
bzip2 <${ARCHIVENAME} >$2
elif [ -n "$(echo "$2" |grep '.tar.gz$')" ] ; then
gzip <${ARCHIVENAME} >$2
else
cat ${ARCHIVENAME} >$2
fi
fi
-------------- next part --------------
# Translation of the VFS (tar)
# Copyright (C) 2008 Michelle Konzack <linux4michelle at freenet.de>
# This file is distributed under the same license as the tdmc package.
# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: tdmc 0.0.2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-05-09 23:15+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: tdmc_tar:57
msgid "This tool is under GNU GPL version 3.0"
msgstr ""
#: tdmc_tar:188
msgid "VFS#tar: It is not possibel to create empty directories in an archive."
msgstr ""
#: tdmc_tar:192
msgid "VFS#tar: It is not possibel to remove empty directories in an archive."
msgstr ""
#: tdmc_tar:196
msgid "VFS#tar: what is \"run\"?"
msgstr ""
#: tdmc_tar:200
#, sh-format
msgid "Usage: ${libdir}/extfs/prefix command [arguments]"
msgstr ""
#: tdmc_tar:202
msgid " list archivename"
msgstr ""
#: tdmc_tar:203
msgid " copyout archivename storedfilename extractto"
msgstr ""
#: tdmc_tar:204
msgid " copyin archivename storedfilename sourcefile"
msgstr ""
#: tdmc_tar:205
msgid " rm archivename storedfilename"
msgstr ""
#: tdmc_tar:206
msgid " mkdir archivename dirname"
msgstr ""
#: tdmc_tar:207
msgid " rmdir archivename dirname"
msgstr ""
#: tdmc_tar:208
msgid " run ???"
msgstr ""
-------------- next part --------------
# Translation of the VFS (tar)
# Copyright (C) 2008 Michelle Konzack <linux4michelle at freenet.de>
# This file is distributed under the same license as the tdmc package.
# Michelle Konzack <linux4michelle at freenet.de>, 2008.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: tdmc 0.0.2\n"
"Report-Msgid-Bugs-To: Michelle Konzack <linux4michelle at freenet.de>\n"
"POT-Creation-Date: 2008-05-09 23:15+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Michelle Konzack <linux4michelle at freenet.de>\n"
"Language-Team: german <debian-l10n-german at list.debian.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#: tdmc_tar:57
msgid "This tool is under GNU GPL version 3.0"
msgstr "Dieses Util ist unter GNU GPL Version 3.0"
#: tdmc_tar:188
msgid "VFS#tar: It is not possibel to create empty directories in an archive."
msgstr ""
"VFS#tar: Es ist nich m?glich, leere verzeichnisse in einem Archiv zu "
"erstellen."
#: tdmc_tar:192
msgid "VFS#tar: It is not possibel to remove empty directories in an archive."
msgstr ""
"VFS#tar: Es ist nicht m?glich, leere Verzeichnisse in einem Archiv zu "
"l?schen."
#: tdmc_tar:196
msgid "VFS#tar: what is \"run\"?"
msgstr "VFS#tar: Was ist \"run\"?"
#: tdmc_tar:200
#, sh-format
msgid "Usage: ${libdir}/extfs/prefix command [arguments]"
msgstr "Benutzung: ${libdir}/extfs/prefix befehl [argumente]"
#: tdmc_tar:202
msgid " list archivename"
msgstr " list archivname"
#: tdmc_tar:203
msgid " copyout archivename storedfilename extractto"
msgstr " copyout archivname gespeichertername speichenals"
#: tdmc_tar:204
msgid " copyin archivename storedfilename sourcefile"
msgstr " copyin archivname gespeichertername quelldatei"
#: tdmc_tar:205
msgid " rm archivename storedfilename"
msgstr " rm archivname gespeichertername"
#: tdmc_tar:206
msgid " mkdir archivename dirname"
msgstr " mkdir archivname verzeichnisname"
#: tdmc_tar:207
msgid " rmdir archivename dirname"
msgstr " rmdir archivname verzeichnisname"
#: tdmc_tar:208
msgid " run ???"
msgstr " run ???"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-mc-devel/attachments/20080509/adb3deda/attachment-0001.pgp
More information about the Pkg-mc-devel
mailing list