home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux      Getting to be as bloated as Windows!      107,822 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 106,405 of 107,822   
   J.O. Aho to alex   
   Re: patch command not work   
   29 Aug 24 12:05:08   
   
   From: user@example.net   
      
   On 29/08/2024 10.42, alex wrote:   
   > Il 28/08/24 19:34, marrgol ha scritto:   
   >>>> (for / -p0 should work too)   
   >>> ????   
   >> Let me rephrase:   
   >> To use your file.patch as is change your working directory to / and run   
   >> 'patch' with -p1 (-p0 should work too).  Or change your working directory   
   >> to/tmp/  and run 'patch' with -p2.  Or change your working directory to   
   >> /tmp/tmp.YI0xO6M46g/  and run 'patch' with -p3.  Clear now?   
   >>   
   >>   
   >   
   >   
   > mmmhhhh...   
   >   
   > $ pwd   
   > /tmp/tmp.YI0xO6M46g   
   >   
   > $ patch --dry-run < patched/file.patch   
   > checking file file   
   >   
   > and so far so good, but   
   >   
   > $ (cd / && patch --dry-run -p1 < /tmp/tmp.YI0xO6M46g/patched/file.patch)   
   > checking file tmp/tmp.YI0xO6M46g/patched/file   
   > Reversed (or previously applied) patch detected!  Assume -R? [n]   
   > Apply anyway? [n]   
   > Skipping patch.   
   > 1 out of 1 hunk ignored   
   >   
   > $ (cd / && patch --dry-run -p0 < /tmp/tmp.YI0xO6M46g/patched/file.patch)   
   > checking file /tmp/tmp.YI0xO6M46g/patched/file   
   > Reversed (or previously applied) patch detected!  Assume -R? [n]   
   > Apply anyway? [n]   
   > Skipping patch.   
   > 1 out of 1 hunk ignored   
   >   
      
   You did run a  "diff /tmp/tmp.YI0xO6M46g/bugged/file   
   /tmp/tmp.YI0xO6M46g/patched/file" (ignoring what ever options you provided)   
      
   The patch file (file.patch) will have the instruction of making the   
   /tmp/tmp.YI0xO6M46g/patched/file based on your   
   /tmp/tmp.YI0xO6M46g/bugged/file, so when you run the patch command it   
   will notice that the changes already has been applied to   
   /tmp/tmp.YI0xO6M46g/patched/file and asking if you want to remove the   
   changes so that you get a /tmp/tmp.YI0xO6M46g/patched/file that is   
   looking like  /tmp/tmp.YI0xO6M46g/bugged/file.   
      
   I guess you want to patch the /tmp/tmp.YI0xO6M46g/bugged/file then it's   
   simplest to go into /tmp/tmp.YI0xO6M46g/bugged and use the -p option to   
   make the patch command to ignore the directories.   
      
   Another alternative could be "cp -a /tmp/tmp.YI0xO6M46g/patched/file   
   /tmp/tmp.YI0xO6M46g/bugged/file"   
      
   --   
     //Aho   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca