tazpkg view tazpkg-convert @ rev 712
tazpkg: backup "official" configuration files with "--newconf" anyway.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Dec 15 04:33:27 2014 +0200 (2014-12-15) |
parents | 8e7a183ebc67 |
children |
line source
1 #!/bin/sh
3 # This program is a part of TazPkg.
4 # /usr/bin/tazpkg-convert: toolset to convert alien package to the tazpkg format
6 # Usage: tazpkg-convert alien_package [ target_directory ]
9 PACKAGE_FILE="$1"
10 TARGET_DIR="$2"
11 TMP_DIR=$(mktemp -d)
12 TOP_DIR="$(pwd)"
14 . /etc/slitaz/slitaz.conf
15 . /lib/libtaz.sh
16 . /usr/lib/tazpkg/tazpkg-find-depends
18 # Internationalization.
19 export TEXTDOMAIN='tazpkg'
22 # FIXME: what does this mean?
23 [ -n "$TARGET_DIR" -a -s "$TARGET_DIR/files.list.lzma" ] && TMPLOCALSTATE="$TARGET_DIR"
26 show_unresolved_lib()
27 {
28 if [ -s $TMP_DIR/unresolved ]; then
29 echo -e "BUGS=\"$(_n 'No dependency for:')" >> $1
30 sort < $TMP_DIR/unresolved | uniq | \
31 while read file; do
32 _ 'WARNING: unknown dependency for %s' $lib
33 echo -n " $file" >> $1
34 done
35 echo "\"" >> $1
36 fi
37 }
40 # convert a .tar.bz2 package to .tazpkg
42 convert_upkg()
43 {
44 mkdir -p $TMP_DIR/fs
45 tar xjf $PACKAGE_FILE -C $TMP_DIR/fs
46 if [ -d $TMP_DIR/fs/var/lib/upkg/packages ]; then
47 cd $TMP_DIR
48 package="$(sed '/^Package:/!d;s/.*: //' fs/var/lib/upkg/packages/*.info)"
49 version="$(sed '/^Version:/!d;s/.*: //' fs/var/lib/upkg/packages/*.info)"
50 url="http://www.paldo.org/"
51 file=$package-$version
52 mkdir $file
53 mv fs $file
54 maintainer=nobody@slitaz.org
55 descrip="$package package from paldo."
56 cat > $file/receipt <<EOT
57 # SliTaz package receipt.
58 # generated by tazpkg from package $(basename $PACKAGE_FILE)
59 PACKAGE="$package"
60 VERSION="$version"
61 CATEGORY="misc"
62 SHORT_DESC="$descrip"
63 WEB_SITE="$url"
64 MAINTAINER="$maintainer"
65 DEPENDS="$(find_depends)"
66 EOT
67 [ -s $file/var/lib/upkg/files/*.config.bz2 ] &&
68 cat >> $file/receipt <<EOT
69 CONFIG_FILES="$(bzcat $file/var/lib/upkg/files/*.config.bz2)"
70 EOT
71 while read ext func ; do
72 [ -s $file/fs/var/lib/upkg/scripts/*.$ext ] || continue
73 cat >> $file/receipt <<EOT
75 $func()
76 {
77 $(cat $file/fs/var/lib/upkg/scripts/*.$ext)
78 }
79 EOT
80 done <<EOT
81 prerm pre_remove
82 EOT
84 tazpkg pack $file
85 mv $TMP_DIR/$file.tazpkg $TOP_DIR
86 else
87 _ 'File "%s" does not look like %s package!' $PACKAGE_FILE 'upkg'
88 fi
89 cd $TOP_DIR
90 rm -rf $TMP_DIR
91 }
94 # convert a .spack package to .tazpkg
96 convert_spack()
97 {
98 mkdir -p $TMP_DIR
99 ( cd $TMP_DIR ; cpio -i ) < $PACKAGE_FILE
100 cd $TMP_DIR
101 package="$(sed '$!d;s/:.*//' about.txt)"
102 version="$(basename $PACKAGE_FILE | sed "s/$package-\([^-]*\).*/\1/")"
103 descrip="$(sed '$!d;s/.*: //' about.txt)"
104 url="http://0linux.org/"
105 maintainer=nobody@slitaz.org
106 file=$package-$version
107 mkdir -p $file/fs
108 xzcat files.xz | ( cd $file/fs ; cpio -idmu )
109 cat > $file/receipt <<EOT
110 # SliTaz package receipt.
111 # generated by tazpkg from package $(basename $PACKAGE_FILE)
112 PACKAGE="$package"
113 VERSION="$version"
114 CATEGORY="misc"
115 SHORT_DESC="$descrip"
116 WEB_SITE="$url"
117 MAINTAINER="$maintainer"
118 DEPENDS="$(find_depends)"
119 EOT
120 [ -s pre-install.sh ] && cat >> $file/receipt <<EOT
122 pre_install()
123 {
124 cd /
125 $(sed 1d pre-install.sh)
126 }
127 EOT
128 [ -s post-install.sh ] && cat >> $file/receipt <<EOT
130 post_install()
131 {
132 cd /
133 $(sed '1,/^}/d' post-install.sh)
134 }
135 EOT
136 tazpkg pack $file
137 cd $TOP_DIR
138 mv $TMP_DIR/$file.tazpkg .
139 rm -rf $TMP_DIR
140 }
143 # convert a .ipk package to .tazpkg
145 convert_ipk()
146 {
147 mkdir -p $TMP_DIR
148 tar xOzf $PACKAGE_FILE ./control.tar.gz | tar xzf - -C $TMP_DIR
149 package=$(sed '/^Package/!d;s/.*: //' $TMP_DIR/control)
150 version=$(sed '/^Version/!d;s/.*: //' $TMP_DIR/control)
151 maintainer="$(sed '/^Maintainer/!d;s/.*: //' $TMP_DIR/control)"
152 target="$(sed '/^Architecture/!d;s/.*: //' $TMP_DIR/control)"
153 descrip=$(sed '/^Description/!d;s/.*: //' $TMP_DIR/control)
154 homepage=$(sed '/^Homepage/!d;s/.*: //' $TMP_DIR/control)
155 url="http://openwrt.org/"
156 case "$target" in
157 i386|all)
158 file=$package-$version
159 mkdir -p $TMP_DIR/$file/fs
160 tar xOzf $PACKAGE_FILE ./data.tar.gz | tar xzf - -C $TMP_DIR/$file/fs
161 cd $TMP_DIR
162 cat > $file/receipt <<EOT
163 # SliTaz package receipt.
164 # generated by tazpkg from package $(basename $PACKAGE_FILE)
165 PACKAGE="$package"
166 VERSION="$version"
167 CATEGORY="misc"
168 SHORT_DESC="$descrip"
169 WEB_SITE="${homepage:-$url}"
170 MAINTAINER="$maintainer"
171 DEPENDS="$(find_depends)"
172 EOT
173 show_unresolved_lib $file/receipt
174 [ -s conffiles ] && cat >> $file/receipt <<EOT
175 CONFIG_FILES="$(cat conffiles)"
176 EOT
177 show_unresolved_lib $file/receipt
178 while read script func; do
179 [ -s $script ] && cat >> $file/receipt <<EOT
181 $func()
182 {
183 $(cat $script)
184 }
185 EOT
186 done <<EOT
187 preinst pre_install
188 postinst post_install
189 prerm pre_remove
190 postrm post_remove
191 EOT
192 awk '
193 {
194 if (/^ / && show) print substr($0,2);
195 else show=0;
196 if (/^Description/) show=1;
197 }' < $TMP_DIR/control > $file/description.txt
198 sed -i 's/^\.$//' $file/description.txt
199 [ -s $file/description.txt ] || rm -f $file/description.txt
200 tazpkg pack $file
201 cd $TOP_DIR
202 mv $TMP_DIR/$file.tazpkg .
203 ;;
204 *)
205 _ 'Invalid target: %s (expected i386)' $target
206 ;;
207 esac
208 rm -rf $TMP_DIR
209 }
212 # convert a .pkg.tar.gz/.pkg.tar.xz/.apk package to .tazpkg
214 convert_arch()
215 {
216 mkdir -p $TMP_DIR/fs
217 busybox tar xf $PACKAGE_FILE -C $TMP_DIR/fs
218 if [ -f $TMP_DIR/fs/.PKGINFO ]; then
219 cd $TMP_DIR
220 package="$(sed '/^pkgname/!d;s/.*= //' fs/.PKGINFO)"
221 version="$(sed '/^pkgver/!d;s/.*= //' fs/.PKGINFO)"
222 descrip="$(sed '/^pkgdesc/!d;s/.*= //' fs/.PKGINFO)"
223 url="$(sed '/^url/!d;s/.*= //' fs/.PKGINFO)"
224 maintainer="$(sed '/^packager/!d;s/.*= //' fs/.PKGINFO)"
225 file=$package-$version
226 mkdir $file
227 mv fs $file
228 cat > $file/receipt <<EOT
229 # SliTaz package receipt.
230 # generated by tazpkg from Archlinux package $(basename $PACKAGE_FILE)
231 PACKAGE="$package"
232 VERSION="$version"
233 CATEGORY="misc"
234 SHORT_DESC="$descrip"
235 WEB_SITE="$url"
236 MAINTAINER="$maintainer"
237 DEPENDS="$(find_depends)"
238 EOT
239 show_unresolved_lib $file/receipt
240 rm -f $file/fs/.[A-Z]*
241 tazpkg pack $file
242 mv $file.tazpkg $TOP_DIR
243 else
244 _ 'File "%s" does not look like %s package!' $PACKAGE_FILE 'Archlinux/Alpine'
245 fi
246 cd $TOP_DIR
247 rm -rf $TMP_DIR
248 }
251 # get package and version from PACKAGE_FILE
253 parse_pkgname()
254 {
255 package=$(basename ${2:-$PACKAGE_FILE} $1)
256 IFS='-'
257 set -- $package
258 unset IFS
259 package=$1
260 version=$2
261 if [ -z "$version" ]; then
262 package=${1%%[0-9\.]*}
263 version=${1#$package}
264 fi
265 file="$package-$version"
266 mkdir $file
267 }
270 finish_convert_puppy()
271 {
272 rm -f fs/*.specs
273 mv fs $file
274 cat > $file/receipt <<EOT
275 # SliTaz package receipt.
276 # generated by tazpkg from puppy package $(basename $PACKAGE_FILE)
277 PACKAGE="$package"
278 VERSION="$version"
279 CATEGORY="misc"
280 SHORT_DESC="$desc"
281 WEB_SITE="http://puppylinux.org/"
282 MAINTAINER="nobody@slitaz.org"
283 DEPENDS="$(find_depends)"
284 EOT
285 show_unresolved_lib $file/receipt
286 for i in install uninstall ; do
287 [ -f $file/fs/p$i.sh ] && cat >> $file/receipt <<EOM
289 post_$i()
290 {
291 chroot \$1/ sh - << EOT
292 cd /
293 $(sed -e 's/\\/\\\\/g' -e 's/\$/\\$/g' < $file/fs/p$i.sh ; rm -f $file/fs/p$i.sh)
294 EOT
295 }
296 EOM
297 done
298 sed -i 's/post_uninstall/post_remove/' $file/receipt
299 tazpkg pack $file
300 mv $file.tazpkg $TOP_DIR
301 cd $TOP_DIR
302 rm -rf $TMP_DIR
303 }
306 # convert a .sfs package to .tazpkg
308 convert_sfs()
309 {
310 [ -n "$(which unsquashfs)" ] || tazpkg get-install squashfs
311 if ! unsquashfs -l $PACKAGE_FILE | grep -q squashfs-root/pet.specs$ ; then
312 _ 'File "%s" does not look like %s package!' $PACKAGE_FILE 'Puppy'
313 return 1
314 fi
315 mkdir -p $TMP_DIR
316 cd $TMP_DIR
317 parse_pkgname .sfs
318 unsquashfs $PACKAGE_FILE
319 mv squashfs-root fs
320 set -- $(cat fs/pet.specs)
321 desc="$10"
322 finish_convert_puppy
323 }
326 # convert a .pet package to .tazpkg
328 convert_pet()
329 {
330 mkdir -p $TMP_DIR
331 cd $TMP_DIR
332 parse_pkgname .pet
333 tar xzf $PACKAGE_FILE 2> /dev/null
334 . $package*/*.specs
335 desc="$PETMENUDESCR"
336 mv $package*/ fs
337 finish_convert_puppy
338 }
341 # convert a .sb package to .tazpkg
343 convert_sb()
344 {
345 [ -n "$(which unsquashfs)" ] || tazpkg get-install squashfs
346 if ! unsquashfs -l $PACKAGE_FILE | grep -q squashfs-root/var/log/removed_scripts ; then
347 _ 'File "%s" does not look like %s package!' $PACKAGE_FILE 'Slax'
348 return 1
349 fi
350 mkdir -p $TMP_DIR
351 cd $TMP_DIR
352 unsquashfs $PACKAGE_FILE
353 mv squashfs-root fs
354 parse_pkgname '' $(cat fs/var/log/packages/* | sed '/PACKAGE NAME:/!d;s/.*: *//')
355 desc="$(cat fs/var/log/packages/* | sed '/^PACKAGE DESCRIPTION:/,$!d;N;s/.*: //;q')"
356 cat fs/var/log/packages/* | sed '/^PACKAGE DESCRIPTION:/,/FILE LIST/!d;s/.*://;/^$/d' > $file/description.txt
357 mv fs $file
358 cat > $file/receipt <<EOT
359 # SliTaz package receipt.
360 # generated by tazpkg from slax package $(basename $PACKAGE_FILE)
361 PACKAGE="$package"
362 VERSION="$version"
363 CATEGORY="misc"
364 SHORT_DESC="$desc"
365 WEB_SITE="http://www.slax.org/"
366 MAINTAINER="nobody@slitaz.org"
367 DEPENDS="$(find_depends)"
368 EOT
369 show_unresolved_lib $file/receipt
370 [ -f $file/fs/var/log/scripts/$package* ] && cat >> $file/receipt <<EOM
372 post_install()
373 {
374 chroot \$1/ sh - << EOT
375 cd /
376 $(cat $file/fs/var/log/scripts/$package* | sed -e 's/\\/\\\\/g' | sed -e 's/\$/\\$/g')
377 EOT
378 }
379 EOM
380 tazpkg pack $file
381 mv $file.tazpkg $TOP_DIR
382 cd $TOP_DIR
383 rm -rf $TMP_DIR
384 }
387 # convert a .tgz package to .tazpkg
389 convert_tgz()
390 {
391 parse_pkgname
392 mkdir -p $TMP_DIR/$file/fs
393 tar xzf $PACKAGE_FILE -C $TMP_DIR/$file/fs
394 cd $TMP_DIR
395 if [ -d $file/fs/install ]; then
396 descrip=$(sed "/^$package/!d;s/.*(\\(.*\\)).*/\\1/;q" \
397 $file/fs/install/slack-desc)
398 cat > $file/receipt <<EOT
399 # SliTaz package receipt.
400 # generated by tazpkg from slackware package $(basename $PACKAGE_FILE)
401 PACKAGE="$package"
402 VERSION="$version"
403 CATEGORY="misc"
404 SHORT_DESC="$descrip"
405 WEB_SITE="http://www.slackware.com/packages/"
406 MAINTAINER="nobody@slitaz.org"
407 DEPENDS="$(find_depends)"
408 EOT
409 show_unresolved_lib $file/receipt
410 [ -f $file/fs/install/doinst.sh ] && cat >> $file/receipt <<EOM
412 post_install()
413 {
414 chroot \$1/ sh - << EOT
415 cd /
416 $(sed -e 's/\\/\\\\/g' -e 's/\$/\\$/g' < $file/fs/install/doinst.sh)
417 EOT
418 }
419 EOM
420 sed "/^$package/:d;s/^$package://" \
421 $file/fs/install/slack-desc > $file/description.txt
422 [ -s $file/description.txt ] || rm -f $file/description.txt
423 rm -rf $file/fs/install
424 tazpkg pack $file
425 mv $file.tazpkg $TOP_DIR
426 else
427 _ 'File "%s" does not look like %s package!' $PACKAGE_FILE 'Slackware'
428 fi
429 cd $TOP_DIR
430 rm -rf $TMP_DIR
431 }
434 # convert a .deb package to .tazpkg
436 convert_deb()
437 {
438 mkdir -p $TMP_DIR
439 dpkg-deb -e $PACKAGE_FILE $TMP_DIR
440 package=$(sed '/^ *Package:/!d;s/.*: //' $TMP_DIR/control)
441 version=$(sed '/^ *Version:/!d;s/.*: //' $TMP_DIR/control)
442 descrip=$(sed '/^ *Description:/!d;s/.*: //' $TMP_DIR/control)
443 homepage=$(sed '/^ *Homepage:/!d;s/.*: //' $TMP_DIR/control)
444 target="$(sed '/^ *Architecture:/!d;s/.*: //' $TMP_DIR/control)"
445 case "$target" in
446 i386|all)
447 file="$package-$version"
448 mkdir -p $TMP_DIR/$file/fs/
449 dpkg-deb -x $PACKAGE_FILE $TMP_DIR/$file/fs
450 cd $TMP_DIR
451 cat > $file/receipt <<EOT
452 # SliTaz package receipt.
453 # generated by tazpkg from debian package $(basename $PACKAGE_FILE)
454 PACKAGE="$package"
455 VERSION="$version"
456 CATEGORY="misc"
457 SHORT_DESC="$descrip"
458 WEB_SITE="${homepage:-http://packages.debian.org/search?keywords=$package}"
459 MAINTAINER="nobody@slitaz.org"
460 EOT
461 LICENSE="$(grep /usr/share/common-licenses/ \
462 $PACKAGE_FILE $TMP_DIR/$file/fs/usr/share/doc/*/copyright | \
463 sed 's|.*common-licenses/\([-\.A-Za-z0-9]*\).*|\1|;s|[-\.]$||q')"
464 [ -n "$LICENSE" ] && echo "LICENSE=\"$LICENSE\"" >> $file/receipt
465 echo "DEPENDS=\"$(find_depends)\"" >> $file/receipt
466 [ -s conffiles ] && cat >> $file/receipt <<EOT
467 CONFIG_FILES="$(cat conffiles)"
468 EOT
469 show_unresolved_lib $file/receipt
470 awk '
471 {
472 if (/^ / && show) print substr($0,2);
473 else show=0;
474 if (/^Description/) show=1;
475 }' < $TMP_DIR/control > $file/description.txt
476 sed -i 's/^\.$//' $file/description.txt
477 [ -s $file/description.txt ] || rm -f $file/description.txt
478 tazpkg pack $file
479 mv $file.tazpkg $TOP_DIR
480 ;;
481 *)
482 _ 'Invalid target: %s (expected i386)' $target
483 ;;
484 esac
485 cd $TOP_DIR
486 rm -rf $TMP_DIR
487 }
490 # convert a .rpm package to .tazpkg
492 convert_rpm()
493 {
494 mkdir -p $TMP_DIR
495 cp $PACKAGE_FILE $TMP_DIR
496 PACKAGE_FILE=$TMP_DIR/$(basename $PACKAGE_FILE)
497 rpm -qip $PACKAGE_FILE | awk -v pkg=$(basename $PACKAGE_FILE) '
498 BEGIN {
499 goturl=0;
500 printf "# SliTaz package receipt.\n";
501 printf "# generated by tazpkg from rpm package %s\n",pkg;
502 }
503 {
504 if (/^Name/) { name=$3; printf "PACKAGE=\"%s\"\n",$3; }
505 if (/^Version/) printf "VERSION=\"%s-",$3;
506 if (/^Release/) printf "%s\"\n",$3;
507 if (/^Summary/) printf "SHORT_DESC=\"%s\"\n",substr($0,15);
508 if (/^URL/) { goturl=1; printf "WEB_SITE=\"%s\"\n",$3; }
509 }
510 END {
511 if (goturl == 0)
512 printf "WEB_SITE=\"http://rpmfind.net/linux/rpm2html/search.php?query=%s\"\n",name;
513 printf "CATEGORY=\"misc\"\n";
514 printf "MAINTAINER=\"nobody@slitaz.org\"\n";
515 }
516 ' > $TMP_DIR/receipt
517 . $TMP_DIR/receipt
518 file=$PACKAGE-$VERSION
519 mkdir -p $TMP_DIR/$file/fs/
520 mv $TMP_DIR/receipt $TMP_DIR/$file
521 rpm -qip $PACKAGE_FILE | awk '
522 BEGIN { show=0 }
523 {
524 if (show) print;
525 if (/^Description/) show=1;
526 }
527 ' > $TMP_DIR/$file/description.txt
528 cd $TMP_DIR/$file/fs/
529 rpm2cpio $PACKAGE_FILE | cpio -idm --quiet
530 # rpm2cpio can't extract some new RPMs
531 if [ $? == 1 ]; then
532 if [ ! -e $INSTALLED/p7zip-full/receipt ]; then
533 boldify "$(_ 'Unable to extract the RPM using standard tools (rpm2cpio).')"
534 confirm "$(_n 'Do you want to install "%s" package? (y/N)' 'p7zip-full')"
535 if [ $? = 0 ]; then
536 tazpkg -gi p7zip-full
537 else
538 rm -rf $TMP_DIR
539 exit 1
540 fi
541 fi
542 # we may already have 7z or may have just installed it in the step above
543 if [ -e $INSTALLED/p7zip-full/receipt ]; then
544 7z x -so $PACKAGE_FILE | cpio -idm --quiet
545 fi
546 fi
547 cd ../..
548 echo "DEPENDS=\"$(find_depends)\"" >> $TMP_DIR/$file/receipt
549 show_unresolved_lib $TMP_DIR/$file/receipt
550 tazpkg pack $file
551 mv $file.tazpkg $TOP_DIR
552 cd $TOP_DIR
553 rm -rf $TMP_DIR
554 }
556 # convert a .xbps package to .tazpkg (http://repo.voidlinux.eu/current/)
557 xbpstag()
558 {
559 sed "/<key>$1<\/key>/!d{n;s/.*>\\(.*\\)<.*/\\1/}" \
560 < fs/props.plist | sed \$!d
561 }
563 convert_xbps()
564 {
565 mkdir -p $TMP_DIR/fs
566 ( xzcat $PACKAGE_FILE || bzcat $PACKAGE_FILE || zcat $PACKAGE_FILE ) | \
567 tar xf - -C $TMP_DIR/fs
569 cd $TMP_DIR
570 HOST_ARCH="$(xbpstag architecture)"
571 case "$HOST_ARCH" in
572 i686) HOST_ARCH="i486" ;;
573 *) _ 'Arch "%s" not supported.' $HOST_ARCH
574 HOST_ARCH=
575 esac
577 if [ "$HOST_ARCH" ]; then
578 package="$(xbpstag pkgname)"
579 version="$(xbpstag version)"
580 file=$package-$version
581 mkdir $file
582 cat > $file/receipt <<EOT
583 # SliTaz package receipt.
584 # generated by tazpkg from package $(basename $PACKAGE_FILE)
585 PACKAGE="$package"
586 VERSION="$version"
587 CATEGORY="misc"
588 SHORT_DESC="$(xbpstag short_desc)"
589 WEB_SITE="$(xbpstag homepage)"
590 MAINTAINER="$(xbpstag maintainer | sed 's/>/>/;s/</</')"
591 LICENSE="$(xbpstag license | sed 's/-//g')"
592 HOST_ARCH="$HOST_ARCH"
593 CONFIG_FILES="$(sed '/<key>conf_files<\/key>/,/<key>/!d;/array>/d;/<key>/d;s/.*>\(.*\)<.*/\1/' fs/props.plist)"
595 DEPENDS="$(find_depends)"
597 EOT
598 while read script func ; do
599 [ -s fs/$script ] && cat >> $file/receipt <<EOT
600 xbps_$func()
601 {
602 set +e
603 $(cat fs/$script)
604 }
606 pre_$func()
607 {
608 xbps_$func pre $package $version yes /etc/xbps.conf $HOST_ARCH
609 }
611 post_$func()
612 {
613 xbps_$func post $package $version yes /etc/xbps.conf $HOST_ARCH
614 }
616 EOT
617 rm -f fs/$script
618 done << EOT
619 INSTALL install
620 REMOVE remove
621 EOT
622 rm -f fs/*.plist
623 mv fs $package-$version
624 tazpkg pack $package-$version
625 mv $package-$version.tazpkg $TOP_DIR
626 fi
627 cd $TOP_DIR
628 rm -rf $TMP_DIR
629 }
633 if [ "$(dd if=$PACKAGE_FILE bs=8 count=1 skip=1 2> /dev/null)" == "debian-b" ]; then
634 convert_deb
635 else
636 case "$PACKAGE_FILE" in
637 *.deb|*.udeb)
638 convert_deb;;
639 *.rpm)
640 convert_rpm;;
641 *.sb)
642 convert_sb;;
643 *.sfs)
644 convert_sfs;;
645 *.pet)
646 convert_pet;;
647 *.tgz)
648 convert_tgz;;
649 *.apk|*.pkg.tar.gz|*.pkg.tar.xz)
650 convert_arch;;
651 *.ipk|*.opk)
652 convert_ipk;;
653 *.spack)
654 convert_spack;;
655 *.tar.bz2)
656 convert_upkg;;
657 *.xbps)
658 convert_xbps;;
659 *)
660 _ 'Unsupported format' ;;
661 esac
662 fi
664 exit 0