UExtract-4.2

Miscellaneous tools
Post Reply
Message
Author
User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#136 Post by SFR »

Version 3.17:

- improved handling of command line options
- new CLI option '-n|--no-colors' - "disable ANSI colors in output"

New extensions:
  • .mo (GNU Gettext Machine Object File) [req. msgunfmt]
  • .tar.lz4 (Lz4 Compressed Tar Archive) [req. lz4]
  • .cpio.lz4 (Lz4 Compressed Cpio Archive) [req. lz4]
First post updated!

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#137 Post by SFR »

Version 3.18:

- fixed extracting of some .uu/.uue files
- simplified extracting of .sh(a)r archives
- can extract the old, legacy bzip (BZ0) compressed files (req. bunzip, not bunzip2)
- better handling of UPX-ed files (+ added .upx extension)
- fixed regression introduced in v3.17: not all backends were shown ('-b' option)
- some minor rearrangements/fixes
- added German translation (thanks to L18L)

New formats/extensions:
  • .eml (E-Mail Message) [req. ripmime]
  • .kgb (KGB Archive File) [req. kgb]
  • .mbox (E-mail Mailbox File) [req. ripmime]
  • .mht (MHTML Web Archive) [req. ripmime]
  • .mim (Multi-Purpose Internet Mail Extension) [req. ripmime]
  • .mime (Multi-Purpose Internet Mail Extension) [req. ripmime]
  • .msg (Outlook Message File) [req. 7z]
  • .styx (WPS Office Arttext Preset) [req. unzip/7z]
  • .tnef (Transport Neutral Encapsulation Format) [req. tnef]
  • .upx (Ultimate Packer for eXecutables File) [req. upx]
First post updated!
___________

Reminder: since UExtract supports lots of (un)archiving/(un)compressing/(en|de)crypting tools, most of which isn't available in practically any distro (or even in their repos, for that matter) OOTB, don't forget about a help file that comes with UExtract - /usr/local/apps/UExtract/help/LINKS.txt.
It contains links to sites from which you can obtain all the backends (source codes in most cases) used by UExtract.

Greetings!
Last edited by SFR on Tue 23 Feb 2016, 18:43, edited 1 time in total.
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#138 Post by step »

SFR wrote: Reminder: .../usr/local/apps/UExtract/help/LINKS.txt.
Thanks SFR! If you don't already, perhaps you could output the same reminder with uextract -h / --help. I know it doesn't help in the GUI case, but at least the command line is covered. Just a thought.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#139 Post by SFR »

Hey Step

If you decided to create a desktop shortcut during installation, you can right-click it (alternatively /usr/local/apps/UExtract AppDir itself) and you'll get that option (see screenshots).

Greetings!
Attachments
ScrUExtract_1.png
(10.84 KiB) Downloaded 445 times
ScrUExtract_2.png
(52.37 KiB) Downloaded 459 times
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

UExtract-3.18

#140 Post by L18L »

Greetings
Attachments
MoManager-de.tar.gz
uextract. mo
(3.94 KiB) Downloaded 195 times
uextract_AppRun.png
(16.88 KiB) Downloaded 450 times

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#141 Post by SFR »

Thank you L18L, I re-uploaded the .pet with your .mo file included.
Also fixed a small bug that prevented TEXTDOMAINDIR variable to be set properly.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

UExtract-3.18

#142 Post by L18L »

SFR wrote:Also fixed a small bug that prevented TEXTDOMAINDIR variable to be set properly.
I had to fix it also to test my translation. :wink:
I was sure you find it, too. 8)
Translation worked OOTB.

(Maybe I should re-code momanager to use non-default TEXTDOMAINDIRs)

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#143 Post by SFR »

Version 3.19:

- can extract DOTconfig from kernel images (req. extract-ikconfig, which should be available in kernel-sources.sfs - usr/src/linux-*/scripts/extract-ikconfig)
- added description of extensionless filetypes to FILETYPES.txt
- regression fix: not recognizing extensionless, upx-ed files
- some minor clean ups

New formats/extensions:
  • .xbps (Void Linux Package) [req. tar+xz]
First post updated!

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#144 Post by MochiMoppel »

My first attempt to use uextract left me a bit puzzled :cry:

I tried to unpack /mnt/sda2/backup.img.gz, a 6BG image file created by Pudd.
I used the command

Code: Select all

/mnt/home/apps/uextract /mnt/sda2/backup.img.gz
expecting that the resulting output file would be created in /mnt/sda2, the only partition large enough to accomodate a 10GB file. Apparently uextract tries to extract to a different location, but where? I receive an error "gzip: stdout: No space left on device", but which device? Also the following "Extraction failed!" doesn't really help. It would be nice if the console output could indicate the target path and it would be perfect (at least for me) if uextract would default output to the same directory as the input.

I finally succeded with the command

Code: Select all

/mnt/home/apps/uextract -o mnt/sda2 /mnt/sda2/backup.img.gz
but still I don't find this intuitive.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#145 Post by SFR »

Hey Mochi

If '-o' wasn't specified, UExtract sets output directory to current working dir (CUSTOMDIR="$(pwd)").
I can't recall exactly why I've chosen this way, but it was a concious choice and it's been unchanged since the initial release.
Anyway, I have to rethink your suggestion (and its possible good/bad implications).

Thanks for the feedback!
___________

Version 3.20:

- I came across an ISO image that can be mounted, as usual, but the contents of a mountpoint cannot be accessed ("permission denied", yes, for root!), unless 'norock' options was specified during mounting, so I added a workaround for this case
- can extract 'Unity-editor' installer
- added warning that some actions require root privileges (shows only if UExtract was launched by regular user)
- fixed missing 'gettext' in one spot
- minor rearrangements/optimizations

New formats/extensions:
  • .bzip (same as .bz)
  • .bzip2 (same as .bz2)
  • .cpio.bzip (same as .cpio.bz)
  • .cpio.bzip2 (same as .cpio.bz2)
  • .cpio.gzip (same as .cpio.gz)
  • .cxarchive (CrossOver Bottle Archive) [req. tar+gz]
  • .fp8 (FP8 (= Fast PAQ8) Compressed File) [req. fp8]
  • .jsonlz4 (Compressed Firefox Bookmarks Backup File) [req. lz4jsoncat]
  • .tar.bzip (same as .tar.bz)
  • .tar.bzip2 (same as .tar.bz2)
First post updated!

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#146 Post by musher0 »

Many thanks, SFR! You're still the best! :)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#147 Post by MochiMoppel »

SFR wrote:If '-o' wasn't specified, UExtract sets output directory to current working dir (CUSTOMDIR="$(pwd)").
...and this is exactly the problem. For users of the ROX right-click app CUSTOMDIR (initially CURRENTDIR) is set in AppRun (CURRENTDIR="${IFILES[0]%/*}/" ). It does what I want it to do for the command line script uextract: it determines the (default) output dir from the path of the input archive. The problem is that AppRun doesn't export CUSTOMDIR to uextract. If it would be exported you could check in uextract if CUSTOMDIR has been set and cd to it. However if someone like me uses uextract from the command line, CUSTOMDIR would be empty and the script would have to do what AppRun did for ROX users: Peel off the path from the archive file and assign it to CUSTOMDIR.

Even if you decide to stick to your present code I still would recommend to make the target clear in the console output. Presently the output indicates the full path of the source file at least 2 times, but the path of the target directory not even once.

But never mind, I can manage :wink: It's already a terrific piece of software. Thanks for that!

User avatar
Smithy
Posts: 1151
Joined: Mon 12 Dec 2011, 11:17

#148 Post by Smithy »

Hi SFR, is it worth bundling Barry's 7zip into UExtract?
http://barryk.org/blog/?viewDetailed=02319
I came across a .7z file and clicked on it (nothing happened) right clicked for UExtract and it had a go, but was unsuccessful.
So I installed Barry's http://distro.ibiblio.org/quirky/pet_pa ... 486-w5.pet and then UExtract did the business with all the notifications dialog ending with All OK.
Just thought it would be good, because UExtract and Packit seem to be the defacto no nonsense tools for Puppy in that department.

EDIT: Just realised I am using an older Pup and possibly newer pups have 7zip built in possibly, so maybe not a good idea after all.

To MochiMoppelel's comment below.
I am so used to double clicking into the directory, it doesn't bother me.

What bothers me more is the removal of the root /downloads folder in the new puppies, that's my temp folder! I always have to put that back in. One of many "improvements"?
Last edited by Smithy on Fri 11 Mar 2016, 12:38, edited 1 time in total.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#149 Post by MochiMoppel »

I tested as a ROX application and I had no success to set a target directory from the xdialog selection box. I did as I'm told in the header text, I "selected" my output directory '/opt', then pushed OK. Files ended up in / :cry: I know that I can doubleclick into the target, but that's not the same as "selecting" and is not how the dialog is supposed to work.

As you can see in the right screenshot (taken from the xdialog manual), the dselect box should show an edit field at the bottom with the selected directory. This is what xdialog is supposed to return and this is also how the fselect box works. The dselect box "lost" its edit field and seems to be broken. Only for me? Using slacko 5.6.
Attachments
xdialog_dselect.png
(21.87 KiB) Downloaded 250 times

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#150 Post by SFR »

@Musher0: Thanks for your continuous support, appreciated. :)
___________

@MochiMoppel: Ok, it's on my TODO list, however it may take a while as I wanted to take a bit longer break before releasing next version.
Here's a preview, though:

Code: Select all

--- old/uextract	2016-03-11 12:38:11.810579283 +0100
+++ new/uextract	2016-03-11 12:38:16.837246168 +0100
@@ -1204,7 +1204,7 @@
 
 #################################### START ####################################
 
-CUSTOMDIR="$(pwd)"
+CUSTOMDIR_FLAG=false
 MODE=extract
 BADOPT=false
 unset FILESSTACK
@@ -1214,8 +1214,8 @@
 
 while (($#)); do
   case "$1" in
-	-o|--output)		CUSTOMDIR="$2"; shift; shift	;;	# 'shift 2' hangs if only one arg left
-    --output=*)			CUSTOMDIR="${1#*=}"; shift	;;
+	-o|--output)		CUSTOMDIR="$2"; CUSTOMDIR_FLAG=true; shift; shift	;;	# 'shift 2' hangs if only one arg left
+    --output=*)			CUSTOMDIR="${1#*=}"; CUSTOMDIR_FLAG=true; shift	;;
     -l|--list)			MODE=list; shift	;;
     -n|--no-colors) 	unset REDCOL BLUECOL GREENCOL YELLOWCOL UNDERLINE; shift	;;
     -b|--backends)		EXTRAOPT=backends; shift	;;
@@ -1228,7 +1228,6 @@
 done
 
 echo -e "\n${UNDERLINE}${APPNAME} by SFR'$(head -n 6 "$0" | grep -Eo "[0-9]+-[0-9]+"); GNU GPL v2 applies${OFFCOL}"
-
 [ $(id -u) -ne 0 ] && { echo -e "\n${YELLOWCOL}$(gettext 'WARNING'): ${OFFCOL}$(gettext 'Some actions (like mounting ISO/disk images) require root privileges, so you may need to execute this script as root.')"; sleep 0.5; }
 
 [ "$BADOPT" = "true" ] && { echo -e "\n${REDCOL}$(gettext 'ERROR:') ${OFFCOL}$(gettext 'Unknown option:') ${1}\n"; exit 1; }
@@ -1300,6 +1299,7 @@
   [ ! -f "$ARCHPATH" ] && { echo -e "${YELLOWCOL}$(gettext 'WARNING:') ${OFFCOL}$(gettext "File does not exist or it's a device file; skipping...")"; ((SKIPCNT++)); SKIPFILES[$SKIPCNT]="${ARCHPATH:-${ARCHPATH_ORG}}"; shift; continue; }
   
   mkdir -p "$WORKDIR" || { echo -e "\n${REDCOL}$(gettext 'ERROR:') ${OFFCOL}$(gettext 'Cannot create temporary directory! Aborting...')\n"; exit 1; }
+  [ "$CUSTOMDIR_FLAG" = "true" ] || CUSTOMDIR="${ARCHPATH%/*}"
   func_uextract
   RET=$?
   cd "$OLDDIR"
Just note that if you do:

Code: Select all

uextract /path/to/symlink_to_file_in_another_location
the file will be extracted in that another location, not where symlink is, because UExtract always operates on full, real paths to files.

RE: Xdialog
Well, it still shows the current selection ("Selection: /") at the very bottom of the window.
Also, as you can see, fselect, too, doesn't show currently highlighted folder as "selection" nor put it into edit field, which gets filled only with a filename selected in right pane.
I suspect it just might have changed at some point and IMHO now it's more logical and consistent.
___________

@Smithy: UExtract is a wrapper script for many external tools and 7z is just one them, so bundling 7z only would be unfair to the rest. :wink:
Well, it crossed my mind to bundle UExtract along with _all_ tools that it supports, but it would be an awful mix of binaries with different/incompatibile licences, e.g. poweriso is free, but proprietary as well as unace, which comes with the following licence:
Linux unace is provided free, "as-is". You may freely copy the program.
Distribution is permitted within this original package only.
Anyway, you can always copy p7zip (and whatever tools you might need) to usr/local/apps/UExtract/resources in unpacked UExtract package and create PET/SFS for your own use.
In fact, I keep (I need to, in order to develop this app) all the missing binaries there (see screenshot).

Btw, in case of p7zip you need to:
1. Copy /usr/local/lib/p7zip/ (or wherever the p7zip directory is) to 'resources' dir.
2. Create the following wrapper (and name it just 7z), also in 'resources' dir:

Code: Select all

#!/bin/sh
MYPATH="$(dirname "$(readlink -f "$0")")"
"${MYPATH}/p7zip/7z" "$@"
Greetings!
Attachments
Screenshot.jpg
(76.21 KiB) Downloaded 193 times
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#151 Post by MochiMoppel »

SFR wrote:RE: Xdialog
Well, it still shows the current selection ("Selection: /") at the very bottom of the window.
Look closer. This shows the current directory (or whatever we may call it), the directory showing on the button above the list, but not what the user has selected from the list. The combination of "Selection" and "Select output directory" list item should form the output, but the latter choice by the user is completely ignored. I can see nothing logical or even consistent in it. E.g. it is contrary how ROX Filer works: Open directory '/' in ROX and you will get '/' in the window caption. Pick a subdirectory or file from the list and ROX will treat the selected files as your selection, not '/'. Nevertheless '/' remains the window title. For me xdialog's behavior is a clear bug, but in a way it's good that you like it because it would be difficult to fix :lol:
Also, as you can see, fselect, too, doesn't show currently highlighted folder as "selection" nor put it into edit field, which gets filled only with a filename selected in right pane.
I find that fselect does it right because getting the "filename selected in right pane" is the purpose of this dialog. The edit field is for the right selection, not the left. Design and naming could be clearer, but at least it functions the way it should.


As for the fix in uextract at around line 1205 I added 2 lines, commented out 1:

Code: Select all

######## START ####
# CUSTOMDIR="$(pwd)"  # should not be necessary any more
LAST_ARG=${!#}
CUSTOMDIR=${LAST_ARG%/*}
That's all. Seems to work in all 3 modi (console, ROX Right-click, AppRun desktop shortcut), but I didn't spend much time on it.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#152 Post by SFR »

MochiMoppel wrote:Look closer. This shows the current directory
Yes, that's what I meant, i.e. "selected" != "highlighted", but "chosen" in one way or another (e.g. by entering the directory we want to choose).
The consistency I see is between dselect and fselect (dselect now behaves like fselect's left pane), not between Xdialog and other dialogs.
Well, I guess both approaches can be justified, but indeed, we can't do much about it, anyway. :wink:

Code: Select all

# CUSTOMDIR="$(pwd)"  # should not be necessary any more 
LAST_ARG=${!#} 
CUSTOMDIR=${LAST_ARG%/*}
Not bad, but such an approach won't work properly in two scenarios, though:

- when you're extracting multiple files from different locations at once, e.g.:

Code: Select all

uextract /root/somefile /mnt/home/otherfile
Both files will be extracted to /mnt/home/.

- when last argument is not a filename, but an option:

Code: Select all

uextract /root/somefile -n
File will be extracted to -n dir.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#153 Post by MochiMoppel »

SFR wrote:Not bad, but such an approach won't work properly in two scenarios, though
Are these real world scenarios? Neither of those affect the ROX usage, or do they? As for the command line I find it hard to believe that a user adds multiple files from different locations and then does not supply a destination directory with the -o option. As with all defaults it can only be a reasonable choice and in absence of a user decision taking the directory of the last file in the list is as good or bad as any other default.

Similar with the case of putting source files before option arguments. Very unusual and not in line with uextract's usage instructions ("uextract [options] files"). I would never expect that putting options last would work, so in this sense my fix doesn't work properly for unproper commands :lol:

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

7z fixed for me

#154 Post by davids45 »

G'day SFR and smithy,

Thanks, between you, for enabling the 7z fix for UExtract-3.20.

I have a lot of archived files made with 7zip (Windows/wine) which I could not extract with UExtract - I had been simply running 7zip in wine up to now.

Now, I just need to be able to locate this fix for all my various Full Pups. I should make my own UExtract pet with the 7z files, I suppose, being the easiest solution for me and my ~20 Full Pups on this desktop :) .

Also I might try to make my own UExtract sfs, incorporating the extra files and script, to drop into my Frugals partition, or merge this another sfs as I already pre-load 6 sfs with most Frugals :shock: .

Thanks again.

David S.

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#155 Post by SFR »

MochiMoppel wrote:Are these real world scenarios?
Well, perhaps they're unlikely, but possible, aren't they?
Also, it is very common in the world of CLI utilities to recognize options placed after filenames and since v3.17 UExtract is no longer crippled in this regard.

@Davids45: You're welcome and I'm glad you're gonna free yourself from using Wine for this task.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

Post Reply