Pacnew_scripts: scripts to merge some .pacnew files after an upgrade

info page: http://xyne.archlinux.ca/info/pacnew_scripts
I was updating my old system which doesn't get turned on that often and had to deal with about 15 pacnew files. Most only required a simple "mv /path/to/file{.pacnew,}" but some required merging. I found a script that I had written a while ago to merge /etc/group.pacnew, made some changes, made a copy which can handle gshadow, then wrote scripts to handle the pacman mirrorlist and locale.gen.
Thus the pacnew_scripts package was born.
infopage wrote:
This package contains scripts which can help merge .pacnew files after a pacman upgrade. These scripts print their results to STDOUT and thus do NOT make any changes to the files. It is up to the user to inspect the output and, if satisfied, redirect it to the original file and then delete the .pacnew file.
The scripts accept "-c" and "--compare" as options and will display relevant information about differences between the files. For group and gshadow, this will display 3 columns to compare the original, .pacnew and merged files and will use colors to highlight changes. For the mirrorlist and locale.gen, it will check that all settings in the original file are available in the new file and print out a list of any that aren't (e.g. if one of your current mirrors has been dropped from the mirrorlist, it will be listed in the output).
I'll probably add scripts as I go. I might also merge the scripts to avoid some redundancy but I decided to keep them simple for now. merge_pacnew_locale_gen is actually very generic and works on the mirrorlist and probably other files as well. If you find any, let me know.
Last edited by Xyne (2010-03-21 13:03:34)

beroal wrote:
I'm really astonished that you interpreted my post as an advertisement of "diffpac".
Xyne wrote:Have you even tried these scripts and compared them to the alternatives that you've proposed? … you can at least post comments based on an informed comparison.
I expected such a comparison from you. If "pacnew_scripts" merges files automatically, what algorithm does it use?
I didn't interpret it as advertisement. It seemed that you read the basic description of what this does and concluded that something else already does the same thing. Following on the tail of the previous posts I felt that your post was somewhat rude because it implies that this is useless. Obviously that is relative, but even so I see no point of posting in this thread to express it, even indirectly.
I admit that I may have interpreted your post the wrong way and if I did then I apologize, but even then I don't understand why you felt the need to post what you did in a contribution thread.
As for algorithms, there are different scripts and they use different algorithms. The group and gshadow scripts create hash representations of the groups in the original and .pacnew files. Groups which only exist in one of the files pass through untouched. Groups which exist in both have their members combined, which usually means that the original simply passes through. Using the "--compare" option, three aligned columns are displayed which clearly shows existing groups, new groups and the results of merging, with colors used to highlight all changes.
The mirrorlist script creates a list of selected servers in the current mirrorlist and generates a new mirrorlist from the .pacnew mirrorlist with all servers in the generated list uncommented, if they exist. Passing the "--compare" option will simply check if all the currently selected mirrors still exist in the new mirrorlist (they might not if they're dropped) and prints out a list of any that aren't.
The locale_gen script does the same thing for currently enabled locales.
Also note that all of the results are printed to STDOUT so no files are actually changes. It isn't fully "automatic" and the user is expected to sanity-check the results before overwriting the target files.

Similar Messages

  • Script to merge multiple CSV files together with no duplicate records.

    I like a Script to merge multiple CSV files together with no duplicate records.
    None of the files have any headers and column A got a unique ID. What would be the best way to accomplish that?

    OK here is my answer :
    2 files in a directory with no headers.
    first column is the unique ID, second colomun you put whatever u want
    The headers are added when using the import-csv cmdlet
    first file contains :
    1;a
    2;SAMEID-FIRSTFILE
    3;c
    4;d
    5;e
    second file contains :
    6;a
    2;SAMEID-SECONDFILE
    7;c
    8;d
    9;e
    the second file contains the line : 2;b wich is the same in the first file
    the code :
    $i = 0
    Foreach($file in (get-childitem d:\yourpath)){
    if($i -eq 0){
    $ref = import-csv $file.fullname -Header id,value -Delimiter ";"
    }else{
    $temp = import-csv $file.fullname -Header id,value -Delimiter ";"
    foreach($line in $temp){
    if(!($ref.id.contains($line.id))){
    $objet = new-object Psobject
    Add-Member -InputObject $objet -MemberType NoteProperty -Name id -value $line.id
    Add-Member -InputObject $objet -MemberType NoteProperty -Name value -value $line.value
    $ref += $objet
    $i++
    $ref
    $ref should return:
    id                                                         
    value
    1                                                          
    a
    2                                                          
    SAMEID-FIRSTFILE
    3                                                          
    c
    4                                                          
    d
    5                                                          
    e
    6                                                          
    a
    7                                                          
    c
    8                                                          
    d
    9                                                          
    e
    (get-childitem d:\yourpath) -> yourpath containing the 2 csv file

  • Script to merge 2 Indesign files on alternating pages

    Hello
    I have created a data merge document for a book I am writing (Luckily I already had everything in Excel) . I created a template with the style headings and graphics frames positioned and sized exactly where I wanted them.My master page had repeating elements etc.
    Loved the process and it worked beautifully. It literally saved me a weeks worth of formatting and inserting graphics work. However the file basically created the Left hand page ONLY of a 2 page spread.
    My understanding from studying tutorials on data merge is that they can only create ONE page output altho I know you can change it to 2 page spreads afterward.
    The second data merge created a file what would ideally be the right hand page of every spread.
    This is a reference/encyclopedia type book with each 2 page spread a distinct entity devoted to a subject
    I need to join the 2 files together.
    The first file would be the left hand or EVEN page
    The second file would be the right hand or ODD page.
    The document is 350 pages.Each page is the same size,margins and subject matter but with different headings and graphics
    (Dragging pages would be too tedious and I have had problems with ID crashing. Don't want to go there again)
    I did read an answer by Dave Saunders (  9. Nov 1, 2008 5:03 PM (in response to Al Ferrari) Re: Script to interleave two InDesign files of equal page counts )
    Would that work do you think?
    I have ID CS4 6.0 running on windows vista.
    I have ZERO scripting experience but I can follow directions.
    Is there any way, scripting wise, I could (or should) accomplish this?
    Thank You in Advance for any help
    Lauren

    My understanding from studying tutorials on data merge is that they can only create ONE page output altho I know you can change it to 2 page spreads afterward.
    That isn't true. Data merge can be done with many pages. See my response to this post:
    http://forums.adobe.com/message/3909894#3909894
    In response to the OP's script request, i can't be of any help.
    What i'm hoping is that after reading how to make a data merge with both left and right hand pages from the post i've linked, that the data could be merged again... assuming there was little (or no) post-processing of the file after the merge was performed.

  • Iphoto will not import some jpeg files after many attempts to 'fix"

    I have scande images into my iphoto until i updated to iphoto 9. now it does not import jpeg for some reason. some jpegs are more equal than other how ever some go in some do not. So what is wrong with iphoto 9 and do i need to reset some profile something somewhere.
    mac book pro 17 standard edition no mods 2.6 intel core 2 duo 4 gigs memory 1067 mhz ddr3
    files are saved to desk top folder as a jpeg in either color or black and white using the system Image Capture software.
    1) the error is -20
    2) i tried importing some old files in and out they seem to work
    3) shut down restarted and tried again no joy with the scanned images
    4) all images are openable by preview and can be changed to tiff
    5) iphoto allows tiff in but not the jpeg or any kind
    6) upgraded to iphoto 9 and this started is there a profile file i should through away and what is the implications of doing this ? i have many thousands of photos i do not want to lose.
    i need to use jpeg format for my family and work.
    any suggestoins.
    7) rand disk permission repair from install disk no problems
    8) should i start in safte mode and do a PR reset.

    1 - iPhoto does not accept grayscale images - they must be RGB even if the photo is B&W
    2 - sometimes opening a photo in preview and doing a save as and then importing the new JPEG will resolve this type of problem
    LN

  • Cannot open numbers files after yosemite upgrade

    Numbers- Documents could not be opened/changed after Yosemite Upgrade on MacBook Pro.

    Found solution... by Remove website data in Safari setting within Settings

  • Problem with some video files after upgrading to iPhoto'11 ...

    Hi,
    I just realized that after converting from iPhoto'09 to iPhoto'11, I found 176 small video files that don't play anymore.  All problem files, can be found in iPhoto with a «.MOV» search.  When played I get this error message (it's in French :
    The problem is that I cannot find any file nested in my iPhoto Library corresponding to the iPhoto's info (name or size).  I get no corresponding file.  Also most of these «.MOV» files seem to have another file that plays and that is bigger.  It could be the original file or maybe my real file ...    As an example, one «.MOV» file is named MVI_6480Web and the original that works is named MVI_6480.  Not all problem files as the Web suffixe though.
    I did not pass all those 176 files one by one, so I am not sure what is the exact problem.  I wonder if some of you can help me understand what is going on ?
    Regards.

    dalrmi wrote:
    I can't believe this! I bought an upgrade to have new functionalities and what I'm having is a
    limitation ?
    you bought an upgrade to a separate application. i'm sure the iLife'11 manuals don't state a guarantee of compatibility with any appletv?
    i'm not saying this is definitely the cause, but in the past there has usually been a requirement for an update when new iLife products were released.
    Is it so unlikely to have an upgrade of ATV 1stG ?
    the original appletv has been replaced and as such i doubt there will be any more software updates at all.

  • Can't see some video files after update

    After my AppleTV updated recently, I cannot access about half of my video files from my iTunes movie library (streaming from my desktop). They used to be accessible on the previous version before the update, and they played on my AppleTV just fine. Now, when I go to "Movies," they don't even show up, though some of the video files do.
    How can I get these files to even show up on the latest software version of AppleTV?
    Thanks!

    Do you have the "show only the synched items" box checked? It's on the summary page when you have Apple TV selected under devices in iTunes. I had this problem and it took me a while to see it...now if my Apple TV would just stay connected to iTunes......or if someone could help me downgrade to 2.0 I'd be golden.

  • Lost some Note files after upgrade to iOS 5

    After I finally succeeded updating to iOS 5, I found some of my Note files are missing
    My update failed the fisrt time with "Unable to restore iPhone" error. I rebooted my Mac and tried the update again. It went the again the "Prepare...", "Sync for restore" again and this time the update worked. But I lost many Note files.
    I wish the backup process is more trouble proof, maybe entirely separate for the update step in which I can for certain save the content of my iPhone.  Then after the update, restore the backup.

    Already tried re-syncing and rebooting both devices with no apparent effect.

  • Script not showing in index file after publising -- 2nd day of trial

    Why doesn't the published DW index file show an actual, intended flash image (weather bug) when Publisher and CoffeeCup do? Please advise. Here is my DW index page: http://96.9.48.31/

    Out of the box, performing simple, elementary tasks, DW is a pain! First I realize I'm using outdated code to apply color to my table borders, then Flash for Live View doesn't work. Why doesn't DW simply write the current code that works in IE9? Why doesn't Flash install within DW?
    Experts may have the first instinct to tell me to get lost and go use Publisher or CoffeeCup, but I'm the real deal. I compose composition all day long -- for paper publishing! I know typesetting and I know composition. All I'm trying to do is recreate with a website the fine detail that I use everyday in setting type for printing on my printing presses! This is where it's all headed, you tell me. That everything will move from paper to monitors. Great, but if you're all happy looking at Vern's Tire Shop website built with a template, then I compare that to being satisfied with your wedding and graduation invites being printed from your inkjet printer.
    I'm serious. I have serious needs and I'm not able to understand how these programs can be so complex and resourceful, but they aren't capable of carrying out these simple tasks. Please give me some insight. I've been in the typesetting and composition business for over 30 years. I know what looks right. I'm just trying to make that happen on the screen.

  • Lost files after Tiger upgrade.

    My problem: All music files dissapeared from iTunes but still now retrieved from elsewhere on the drive, all vCards are now vanished completely, all photos gone from iPhoto, now luckily retrieved and imported back. All filed mail gone from Mail, now suddenly vanished still after retrieving and reimporting. Also mail account settings suddenly gone. I know I have myself to blame for not backing up, but why the h... is this happening? Also a lot of my settings is "being ignored" after restarting. What has really happened? How can I retrieve? I connected my iPod 4GB and turned it to manual, could it be the cause? Tried to download all my pics to it, but there was no dialogue window. Except the nogo sign on the iPod. Which I had to ignore after an hour. ALL of THIS happened after a SUCCESSFULL upgrade to Tiger. ALL my files were initially intact. IS the iPod the sinner here?

    There are some good reasons there to backup first, and to do some basic repairing and maintenance before any upgrade. Pick up a good Firewire drive to hold 2x what you think you need.
    Try using Disk Utility 10.4.6 DVD or fsck to repair your drive and then do a Safe Boot.
    You don't say if this was 10.4.8 update from .7, or something else, but I would recommend only using the standalone and combo updaters. And never use your Mac while updating, and always do a restart before the update (ideally having repaired the drive first anyway).
    This 42-page guide is designed to introduce some techniques, routines and habits that have a pretty good track record for quashing the most common OS X problems. available MacFixIt subscribers.
    Mac Pro 2GHz 2GB WD 10K Raptor; MDD G4   Mac OS X (10.4.8)   APC RS1500/XS1500; Vista

  • HT1296 itunes won't sync my audio files after I upgraded my iphone to i0S 6

    I upgraded my phone to iOS 6 for the new features and could no longer play (or find) my audio books.  The disk space usage indicated that the files were still there but the music player would not show or play them.  I try to sync to iTunes Library and it fails.  I upgraded my Mac OS and my iTunes versions to the current version and still no luck.  Incidentally I also notice that when I try to make a purchase of new audio files through iTunes directly from my iphone it also seems to hang up.  Occassionally after a couple reboots it may download but still shows my audio library as being empty. 
    Not sure where to go from here...any suggestions?

    OK, this is weird/interesting . . . just now, syncing my iPad, I noticed that under the Music tab there were no syncing options available, just a message that said "iTunes Matching is on." I'd turned it on yesterday, in the Settings, just messing around trying to troubleshoot the audio file sync issue.
    iTunes Matching didn't solve the problem, so I turned it off. Then resynced the iPad again from scratch. THIS TIME everything synced! Every single audio file, every playlist, everything.
    So that's odd, right?? I mean, I'm happy that it's working, but I'm not sure why it didn't work to begin with, nor why it's suddenly working now. So it's good, but a little unnerving . . .

  • Ark not working with rar files after unrar upgrade

    Today after a #pacman -Syu the package unrar was upgraded from 4.2.4 to 5.0.2. After that, Ark cannot extract .rar archives. Did anyone else experience this problem?
    Starting Ark from the command line doesn't show any error. I also tried installing libunrar (which was not needed before and also not installed as dependency) but it made no difference.
    Using unrar from the command line works fine, though, so it's just Ark not being able to use it for some reason.

    Bogart wrote:Sorry, maybe I should have specified that Ark is the archive extracting tool used by KDE. A graphical frontend for gzip, unrar, etc...
    Ahh fair enough. I have no experience with KDE whatsoever, so I'll leave others to help you work through this problem Best of luck!
    All the best,
    -HG

  • Missing Files after Lion Upgrade

    After upgrading to Lion I am missing files from a folder named "printers" I had created.  The previous os used a "printer" folder but not "printers".  It seems as if the Lion operating system deleted the existing folder and placed new files in there. I've searched the computer after enabling hidden files to no avail.  Any ideas as to how to recover the files? 
    Thanks

    Where had you put that folder?
    If in the top-level System or Library folder, that's why; those were replaced by the Lion installer, since we mere mortals are not supposed to fool with them.
    Restore it from your backups, but put it somewhere else; either in a user home folder or the special Shared user folder.

  • Problem syncing image files after OS5 upgrade.

    Lost all my image files with upgrade. Do not use Touch for Music, movies, podcasts - just images and a few apps. Tried restore to factory settings so now also lost my apps! I am trying to sync using Itunes>Photos>All folders but after about 15 mins just have the folders in the Touch but no images content. Sometimes the sync just stops and message says session ended - other times it just does nothing else. If I try to sync a specific folder then that seems to work but all images are duplicated into a Photo Library which I do not want.
    Looked to downgrade but seems I cannot do that.
    Any ideas?
    Thanks.
    Brian

    Alas, it didn't work. Instead of trying a shortcut, I followed the steps as closely as possible. The end result was that iTunes did not recognize any songs.
    I think the problem is that the Mac immediately registers the pc .xml file as an "OmniOutliner" file instead of an HTML file. I ported the file three different ways: pc-to-mac, attached to e-mail, and burned to a CD. OS X immediately identified each as an OmniOutliner file. My guess is that the iPod treats the .xml file slightly differently, allowing the pc .xml file to cross properly with the iPod as an intermediary. (Although the article you pointed me to did not specifically say this would work cross-platform.) Unfortunately, I have a iPod Mini, which can't carry 28 gigs of music.
    At this point, it seems to me, I can either buy a new iPod to try to port the .xml file, or load both xml files up in an HTML editor and manually update the OS X version, or forget it. I leaning toward the latter.
    Thanks for pointers. It's always challenging to try something new.

  • Unreadable FCP6 files after Leopard upgrade

    I realize that these message boards are littered with inquiries and problems of people that upgraded to Leopard and are having crash and graphic problems. I hate to add to the clutter but I have yet to see anything on the topic I am having trouble with.
    I have been running FCP6 at my office w/ Mac OS X (tiger) for some time. My boss updated all office macs this weekend with Leopard and yesterday he transferred a FCP project file along with the media on to an external HD and gave it to me to work on. But my computer puts up this message whenever I attempt to open his FCP project file
    "This project is unreadable or may be too new for this version of Final Cut Pro."
    I did a clean reinstall of FCS2 and restarted the comp but still no luck. All of my old FCP6 files still run on Leopard, even the ones created on Tiger. But the file he created on his comp isn't readable on my mac.
    If anyone has some suggestions, please advise.
    Thanks!!

    Okay, I figured out the solution. On the computer that I was getting the other files from, I had to have it export the FCP file in an XML format. Then once I opened the XML file on my computer I just reconnected all of my media and it worked.
    For some reason the intel/G5 switching didn't like something about FCP6 project files but it worked when the file is in XML format.

Maybe you are looking for

  • SAP Report Writer Material ????

    Hi Gurus, I am looking for Report Writer Material (for FI/CO reports). Please don't send any powerpoint presentation or SAP Help material, I am looking for material with good explainations, examples and excercise. Thanks in advance

  • Incorrect created date

    All files in my computer shows the same created date and not their real one. how can i change it? Thanks, Doron

  • Getting UNCAUGHT_EXCEPTION CX_WD_CONTEXT at using alv sort function

    Dear colleagues, I developed a simple application which displays records in an ALV and at lead-selection shows detailed data in a form. Everthing is working fine except one is clicking on the sort functionality at the top of the ALV short dump is thr

  • White 255 issue...

    How come when I am using the paint bucket - white RGB255, it eyedrops as RGB 237? Is there a filter of some kind on or a color setting that is doing this? I have come across this on a couple of image I have had to re-edit and I want a white backgroun

  • Server not starting through SAPMMC

    Hi We have a IDES 4.7 installation. The server is working fine. But we are facing a problem. We are not able to start server from MMC. When we click on SAP SYSTEMS node in MMC it gives following error : Snap-in-creation-failed. The snap-in is not cre