sigito / rmpkg Goto Github PK
View Code? Open in Web Editor NEWUtility for removing packages by their pkg file.
License: MIT License
Utility for removing packages by their pkg file.
License: MIT License
For testing MacTex.pkg
could be used. Example of PackageInfo
file:
<pkg-info format-version="2" identifier="com.tug.mactex.gui2013" version="1.0" install-location="/Applications" auth="root">
<payload installKBytes="402012" numberOfFiles="7190"/>
<scripts>
<postinstall file="./postinstall"/>
</scripts>
<bundle id="edu.ucsd.cs.mmccrack.bibdesk" CFBundleIdentifier="edu.ucsd.cs.mmccrack.bibdesk" path="./TeX/BibDesk-SnowLeopard.app" CFBundleVersion="2861">
<bundle id="net.sourceforge.bibdesk.btparse" CFBundleIdentifier="net.sourceforge.bibdesk.btparse" path="./Contents/Frameworks/BTParse.framework" CFBundleVersion="1.0"/>
<bundle id="com.mac.amaxwell.fileview" CFBundleIdentifier="com.mac.amaxwell.fileview" path="./Contents/Frameworks/FileView.framework" CFBundleVersion="1.0"/>
<bundle id="net.sourceforge.skim-app.framework.SkimNotesBase" CFBundleIdentifier="net.sourceforge.skim-app.framework.SkimNotesBase" path="./Contents/Frameworks/SkimNotesBas
e.framework" CFBundleVersion="1.3.1"/>
<bundle id="org.andymatuschak.Sparkle" CFBundleIdentifier="org.andymatuschak.Sparkle" path="./Contents/Frameworks/Sparkle.framework" CFBundleVersion="1.5"/>
<bundle id="net.sourceforge.bibdesk.yaz" CFBundleIdentifier="net.sourceforge.bibdesk.yaz" path="./Contents/Frameworks/yaz.framework" CFBundleVersion="1.0"/>
<bundle id="net.sourceforge.bibdesk.quicklookgenerator" CFBundleIdentifier="net.sourceforge.bibdesk.quicklookgenerator" path="./Contents/Library/QuickLook/BibDesk.qlgenerat
or" CFBundleVersion="1.3.17"/>
<bundle id="net.sourceforge.bibdesk.bibimporter" CFBundleIdentifier="net.sourceforge.bibdesk.bibimporter" path="./Contents/Library/Spotlight/BibImporter.mdimporter" CFBundl
eVersion="1.5.2"/>
<bundle id="edu.ucsd.cs.mmccrack.bibdesk.help" CFBundleIdentifier="edu.ucsd.cs.mmccrack.bibdesk.help" path="./Contents/Resources/BibDesk.help" CFBundleVersion="1.0"/>
</bundle>
<bundle id="edu.bucknell.Excalibur" CFBundleIdentifier="edu.bucknell.Excalibur" path="./TeX/Excalibur-4.0.7/Excalibur.app" CFBundleVersion="4.0.7"/>
<bundle id="fr.chachatelier.pierre.LaTeXiT" CFBundleIdentifier="fr.chachatelier.pierre.LaTeXiT" path="./TeX/LaTeXiT.app" CFBundleVersion="2.5.2">
<bundle id="org.andymatuschak.Sparkle" CFBundleIdentifier="org.andymatuschak.Sparkle" path="./Contents/Frameworks/Sparkle.framework" CFBundleVersion="9662452">
<bundle id="org.andymatuschak.sparkle.finish-installation" CFBundleIdentifier="org.andymatuschak.sparkle.finish-installation" path="./Resources/finish_installation.app"
CFBundleVersion="1"/>
<bundle id="org.andymatuschak.sparkle.finish-installation" CFBundleIdentifier="org.andymatuschak.sparkle.finish-installation" path="./Versions/A/Resources/finish_instal
lation.app" CFBundleVersion="1"/>
<bundle id="org.andymatuschak.sparkle.finish-installation" CFBundleIdentifier="org.andymatuschak.sparkle.finish-installation" path="./Versions/Current/Resources/finish_
installation.app" CFBundleVersion="1"/>
</bundle>
<bundle id="fr.chachatelier.pierre.LaTeXiT.CreateEquations" CFBundleIdentifier="fr.chachatelier.pierre.LaTeXiT.CreateEquations" path="./Contents/Library/Automator/CreateEqu
ations.action" CFBundleVersion="2.5.2"/>
<bundle id="fr.club.ktd.LaTeXiT" CFBundleIdentifier="fr.club.ktd.LaTeXiT" path="./Contents/Resources/LaTeXiT Helper.app" CFBundleVersion="2.5.2"/>
</bundle>
...
</pkg-info>
If a package file contains inside few package directories only first is investigated and it's content will be removed, all others are ignored.
Print on -h parameter usage information.
Plus consider to print some examples.
Add parameter to specify directory for temporal files.
Add support for multiple bundles in a single subpackage.
Here is the log:
$ rmpkg -fd -p JDK8.pkg
-f option specified. Forcing deletion.
-d option specified. Removing whole package installation.
Expanding JDK8.pkg to /tmp/JDK8.pkg.24320.1362880561
Processing subpackage at ./javaappletplugin.pkg
Parsing install-location...
install-location: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
Removing installed package staff...
Removing whole /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/./
Password:
rm: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/./: Invalid argument
Unable to delete /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/./
As it is mandatory parameter we can simply use rmpkg pkg_to_delete.pkg
.
After by-file removing rmpkg should delete empty directories left alone after pkg content deleted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.