Bug 469134 - (deco-archive) Review Request: deco-archive - Extraction scripts for various archive formats for use of deco
Review Request: deco-archive - Extraction scripts for various archive formats...
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks: deco
  Show dependency treegraph
 
Reported: 2008-10-29 23:40 EDT by Orcan Ogetbil
Modified: 2008-12-17 19:40 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-12-17 19:38:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
ville.skytta: fedora‑review+
kevin: fedora‑cvs+


Attachments (Terms of Use)
Simplify specfile (1.93 KB, patch)
2008-12-01 10:01 EST, Ville Skyttä
no flags Details | Diff

  None (edit)
Description Orcan Ogetbil 2008-10-29 23:40:44 EDT
Spec URL: http://oget.fedorapeople.org/review/deco-archive.spec
SRPM URL: http://oget.fedorapeople.org/review/deco-archive-1.2-1.fc9.src.rpm
Description: 
deco-archive provides support for popular archive
formats to the deco file extraction framework.

--
This package is a companion to deco (Bug# 444366). Neither packages mean much without each other hence I made them require and block each other. If you have a better idea for the dependencies I am wide open to accept.

There are three types of rpmlint errors/warnings from the deco-archive package that will be built, which can all be ignored:

   * deco.x86_64: W: dangerous-command-in-%trigger
   I used the %trigger functions for installing support for "non-default" 
   formats as Ville suggested in Bug# 444366 . This results in these
   "dangerous commands".

   * deco.x86_64: E: zero-length 
   All zero length files are needed by the program

   * deco.x86_64: E: compressed-symlink-with-wrong-ext
   These kinds of files are needed by the program too.
Comment 1 Orcan Ogetbil 2008-11-19 18:35:35 EST
Spec URL: http://oget.fedorapeople.org/review/deco-archive.spec
SRPM URL: http://oget.fedorapeople.org/review/deco-archive-1.2-2.fc9.src.rpm

%changelog
- Added conditionals to the trigger functions to suppress warnings on updates.
Comment 2 Orcan Ogetbil 2008-11-20 22:26:59 EST
Spec URL: http://oget.fedorapeople.org/review/deco-archive.spec
SRPM URL: http://oget.fedorapeople.org/review/deco-archive-1.2-3.fc9.src.rpm

%changelog
- License is GPLv3.
- Install the scripts in %%{_datadir}/%%{name} and the symlinks in %%{var}/lib/deco.

Note that deco is updated accordingly.
Comment 3 Ville Skyttä 2008-11-30 14:02:18 EST
I'm not sure about the dependencies for the default archivers - wouldn't things just work for them with triggers as well?  I'd personally remove them and do everything with triggers, but if you want to keep the default set, I think it would be good to add rpm to it - it's quite likely that it is installed on Fedora systems.

In any case, it would be good to own everything that is not actually installed as usual in /var/lib/deco using %ghost.  See the bash-completion package for an example how to do this.

There's something wrong with for example the tar.lzma trigger.  For me it installs a symlink: "/var/lib/deco/tar.lzma -> ../../../usr/share/deco-archive/tar.lzma" which is broken - there's no "tar.lzma" in /usr/share/deco-archive here.  "tar\.lzma" on the other hand is there, and I suppose "tar\.lzma" should be in /var/lib/deco instead of "tar.lzma" as well.  At least the unrar and p7zip triggers could have a similar problem, maybe others with special chars as well.
Comment 4 Orcan Ogetbil 2008-11-30 18:25:21 EST
Thanks,
(In reply to comment #3)
> I'm not sure about the dependencies for the default archivers - wouldn't things
> just work for them with triggers as well?  I'd personally remove them and do
> everything with triggers, but if you want to keep the default set, I think it
> would be good to add rpm to it - it's quite likely that it is installed on
> Fedora systems.
> 

I opted to make a "default archivers" list for simplicity. The script has to be more complicated for such cases as: 
   - the user has tar and gz but not bz2
In such a case I have to use smart nested if-clauses for the trigger functions of bz2 and tar. 

Since a user who wants to deal with archives will probably have all of these archivers anyways and they are all loaded by most installations, I don't think it is worth the trouble to make the code to so complicated.

> In any case, it would be good to own everything that is not actually installed
> as usual in /var/lib/deco using %ghost.  See the bash-completion package for an
> example how to do this.

I tried doing this. But I couldn't figure out how to escape the special characters such as [ { ) in the filenames in the %files section. The obvious \[  \{  etc. escapes don't work. Here is what I did:

SPEC: http://oget.fedorapeople.org/review/deco-archive.spec
SRPM: http://oget.fedorapeople.org/review/deco-archive-1.2-4.fc10.src.rpm

Note that this SRPM does not build. It fails with:

RPM build errors:
    File not found by glob: /home/orcan/rpmbuild/BUILDROOT/deco-archive-1.2-4.fc10.x86_64/var/lib/deco/7z\.[0-9]{2,}
    File not found by glob: /home/orcan/rpmbuild/BUILDROOT/deco-archive-1.2-4.fc10.x86_64/var/lib/deco/ace|[c0-9][0-9]{2}
    File not found by glob: /home/orcan/rpmbuild/BUILDROOT/deco-archive-1.2-4.fc10.x86_64/var/lib/deco/part[0-9]+\.rar
    File not found by glob: /home/orcan/rpmbuild/BUILDROOT/deco-archive-1.2-4.fc10.x86_64/var/lib/deco/rar|[rst][0-9]{2}
    File not found by glob: /home/orcan/rpmbuild/BUILDROOT/deco-archive-1.2-4.fc10.x86_64/var/lib/deco/t7z\.[0-9]{2,}
    File not found by glob: /home/orcan/rpmbuild/BUILDROOT/deco-archive-1.2-4.fc10.x86_64/var/lib/deco/tar\.7z\.[0-9]{2,}


I asked about this to many people but nobody could figure this out. Any suggestions?

Also the SPEC file is kind of ugly right now. I don't know how to simplify the part with 

   ( if x$i="xbz2" || x$i="xcpio" ||...|| x$i="xtar" ) 

in the %install section and also the 

   %{_var}/lib/deco/bz2
   %{_var}/lib/deco/cpio
   ...
   %{_var}/lib/deco/tar

part in the %files section.

> 
> There's something wrong with for example the tar.lzma trigger.  For me it
> installs a symlink: "/var/lib/deco/tar.lzma ->
> ../../../usr/share/deco-archive/tar.lzma" which is broken - there's no
> "tar.lzma" in /usr/share/deco-archive here.  "tar\.lzma" on the other hand is
> there, and I suppose "tar\.lzma" should be in /var/lib/deco instead of
> "tar.lzma" as well.  At least the unrar and p7zip triggers could have a similar
> problem, maybe others with special chars as well.

Thanks for the catch. Yes, there was a problem with tar\.lzma. The others are fine as far as I tested.
Comment 5 Orcan Ogetbil 2008-11-30 22:57:54 EST
OK, I worked-around the issue. I sed'ed the contents of the ghost list and replaced each non-alphanumeric character in the filenames with ?.
Here are the new files:
SPEC: http://oget.fedorapeople.org/review/deco-archive.spec
SRPM: http://oget.fedorapeople.org/review/deco-archive-1.2-5.fc10.src.rpm

The package builds and runs as desired. But I'm open to suggestions for the improvement of the code.
Comment 6 Ville Skyttä 2008-12-01 10:01:53 EST
Created attachment 325238 [details]
Simplify specfile

Here's a patch that simplifies the specfile somewhat, works for me on F-9.  I don't think it's necessary to change anything else but [ and \ to ?.

Regarding the default dependencies: I can see the point for gzipped tarballs and friends, the nested logic would indeed be ugly and possibly fragile.  But I'd still trim at least gzip and bzip2 from the list (ditto maybe cpio; I suppose deco has no support for compressed cpio files) - the logic for handling those is already there in for example 7zip and lzma cases as long as we can assume tar is around.  But I won't consider this a blocker if you don't agree.

But if you decide to keep the defaults, I suppose there's no need to do the symlinking for the defaults - their dirs could be simply directly installed to /var/lib/deco instead, no?
Comment 7 Orcan Ogetbil 2008-12-01 13:00:39 EST
(In reply to comment #6)
> Created an attachment (id=325238) [details]
> Simplify specfile
> 
> Here's a patch that simplifies the specfile somewhat, works for me on F-9.  I
> don't think it's necessary to change anything else but [ and \ to ?.
> 
Thanks a lot for the patch!

> Regarding the default dependencies: I can see the point for gzipped tarballs
> and friends, the nested logic would indeed be ugly and possibly fragile.  But
> I'd still trim at least gzip and bzip2 from the list (ditto maybe cpio; I
> suppose deco has no support for compressed cpio files) - the logic for handling
> those is already there in for example 7zip and lzma cases as long as we can
> assume tar is around.  But I won't consider this a blocker if you don't agree.
> 
> But if you decide to keep the defaults, I suppose there's no need to do the
> symlinking for the defaults - their dirs could be simply directly installed to
> /var/lib/deco instead, no?
The thing is; the rpm extractor, for instance, requires the presence of dd (coreutils), gunzip, bzip2, tar, cpio and rpm. The current list of default archivers is minimal. If we reduce the number of default archivers, we will need to go to nested logic. The only exception is rpm, but that is installed in probably 100-10^{-5} % of the Fedora systems. I can still take it out if you change your mind.

And yes, we can install the default archivers directly in /var/lib/deco/ . But the makefile script installs everything in one location and I would need to move them around manually. No biggie... But I think what I did is neat because, right now, one can see all the possible extraction scripts in one directory, and the symlinks don't occupy much of a harddrive space.

Here are the latest files:
SPEC: http://oget.fedorapeople.org/review/deco-archive.spec
SRPM: http://oget.fedorapeople.org/review/deco-archive-1.2-6.fc10.src.rpm
Comment 8 Ville Skyttä 2008-12-01 17:10:57 EST
I don't quite see the neatness/usefulness in that but the package works as is and disagreement on some details as tiny as this is not a blocker, approved.
Comment 9 Orcan Ogetbil 2008-12-01 17:36:39 EST
Thank you Ville.

New Package CVS Request
=======================
Package Name: deco-archive
Short Description: Extraction scripts for various archive formats for use of deco
Owners: oget
Branches: F-9 F-10
InitialCC:
Comment 10 Kevin Fenzi 2008-12-03 20:05:10 EST
cvs done.
Comment 11 Fedora Update System 2008-12-03 21:35:38 EST
deco-archive-1.2-6.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/deco-archive-1.2-6.fc10
Comment 12 Fedora Update System 2008-12-03 23:16:27 EST
deco-archive-1.2-6.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/deco-archive-1.2-6.fc9
Comment 13 Fedora Update System 2008-12-06 23:12:17 EST
deco-archive-1.2-6.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing-newkey update deco-archive'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-10734
Comment 14 Fedora Update System 2008-12-06 23:13:39 EST
deco-archive-1.2-6.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update deco-archive'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2008-10746
Comment 15 Fedora Update System 2008-12-17 19:38:52 EST
deco-archive-1.2-6.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 16 Fedora Update System 2008-12-17 19:40:27 EST
deco-archive-1.2-6.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.