Code Monkey home page Code Monkey logo

pacnoob's Introduction

pacnoob

A simple script for finding and dealing with .pacnew files produced during Arch Linux system upgrades.

Motivation

As an Arch Linux novice, I was not aware of the importance of .pacnew files. During a recent upgrade, I failed to notice the warning message (buried in hundreds of lines of output) telling me that my /etc/pam.d/system-login file was changed and needed to be manually updated. After a reboot, I found myself unable to login to my own system. Although the solution turned out to be straightforward (boot with kernel command line init=/bin/bash and edit the file), the moment of panic was real.

So I started reading about .pacnew files and ways to manage them automatically. pacdiff seemed great at first, but I'm not a huge fan of vimdiff or merge tools in general. I tried a couple others as well, but none of them felt quite right. So I made pacnoob.

Usage

Download the script, make it executable, and copy it to /usr/local/bin/:

$ curl https://raw.githubusercontent.com/jwgcarlson/pacnoob/master/pacnoob -o pacnoob
$ chmod +x pacnoob
$ sudo cp pacnoob /usr/local/bin/

To run it automatically after a system upgrade (so that you never forget), add a Pacman hook:

$ sudo mkdir -p /etc/pacman.d/hooks/
$ sudo tee -a /etc/pacman.d/hooks/pacnoob.hook >/dev/null << EOF
[Trigger]
Operation = Upgrade
Type = Package
Target = *

[Action]
Description = Running pacnoob
When = PostTransaction
Exec = /usr/local/bin/pacnoob
EOF

TODO

Ultimately I'd like to have something like git add --patch, which is a fantastic tool for selectively applying a subset of a diff. I couldn't find a good way to use it outside of a git context though, so I settled for a cheap knock-off.

pacnoob's People

Contributors

jwgcarlson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.