Aide commande patch

Bonjour,

J’ai créer un patch avec la commande “svn diff > mesModifications.patch”, Je voudrais maintenant pouvoir appliquer le patch sans soucis, mais j’ai ce message

[code](Stripping trailing CRs from patch.)
can’t find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:

|Index: AE-go_GameServer/config/admin.properties
|===================================================================
|— AE-go_GameServer/config/admin.properties (revision 847)

+++ AE-go_GameServer/config/admin.properties (working copy)

File to patch:
[/code]

Je suis placer dans le dossier juste avant AE-go_GameServer.

Je ne sais pas quoi taper a coté de 'File to patch:'
Quoi que je tape, sa merde >__<

Voila le contenu de mon fichier patch :

[code]Index: AE-go_GameServer/config/admin.properties

— AE-go_GameServer/config/admin.properties (revision 847)
+++ AE-go_GameServer/config/admin.properties (working copy)
@@ -17,6 +17,9 @@

Adds an item to your inventory

gameserver.administration.command.add=3

+# Add Kinah to player
+gameserver.administration.command.addkinah=3
+

Add target player skill

gameserver.administration.command.addskill=3

Index: AE-go_GameServer/data/scripts/system/handlers/admincommands/AddKinah.java

— AE-go_GameServer/data/scripts/system/handlers/admincommands/AddKinah.java (revision 847)
+++ AE-go_GameServer/data/scripts/system/handlers/admincommands/AddKinah.java (working copy)
@@ -0,0 +1,131 @@
+/*

    • aion-unique is free software: you can redistribute it and/or modify
    • it under the terms of the GNU General Public License as published by
    • the Free Software Foundation, either version 3 of the License, or
    • (at your option) any later version.
    • aion-unique is distributed in the hope that it will be useful,
    • but WITHOUT ANY WARRANTY; without even the implied warranty of
    • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    • GNU General Public License for more details.
    • You should have received a copy of the GNU General Public License
  • */

+package admincommands;
+
+import java.text.DecimalFormat;
+import java.util.Collections;
+
+import com.aionemu.gameserver.configs.AdminConfig;
+import com.aionemu.gameserver.model.gameobjects.Item;
+import com.aionemu.gameserver.model.gameobjects.VisibleObject;
+import com.aionemu.gameserver.model.gameobjects.player.Inventory;
+import com.aionemu.gameserver.model.gameobjects.player.Player;
+import com.aionemu.gameserver.network.aion.serverpackets.SM_INVENTORY_UPDATE;
+import com.aionemu.gameserver.services.ItemService;
+import com.aionemu.gameserver.utils.PacketSendUtility;
+import com.aionemu.gameserver.utils.chathandlers.AdminCommand;
+import com.aionemu.gameserver.world.World;
+import com.google.inject.Inject;
+
+/**
+* @author sweetkr
+*
+*/
+public class AddKinah extends AdminCommand
+{

  • @Inject

  • private World world;

  • @Inject

  • private ItemService itemService;

  • public AddKinah()

  • {

  •   super("Kinah");
    
  • }

  • @Override

  • public void executeCommand(Player admin, String[] params)

  • {

  •   if(admin.getCommonData().getAdminRole() < AdminConfig.COMMAND_ADDKINAH)
    
  •   {
    
  •   	if (admin.getCommonData().getAdminRole() > 0)
    
  •   	{
    
  •   		PacketSendUtility.sendMessage(admin, "You don't have enough rights to execute this command");
    
  •   	}
    
  •   	return;
    
  •   }
    
  •   if (params.length < 1 || params.length > 2)
    
  •   {
    
  •   	PacketSendUtility.sendMessage(admin, "syntax: //Kinah <Quantity> [PlayerName]");
    
  •   	return ;
    
  •   }
    
  •   int itemID = 182400001;
    
  •   int itemCount = 1;
    
  •   Item addedItem = null;
    
  •   try
    
  •   {
    
  •   	itemCount = Integer.parseInt(params[0]);
    
  •   }
    
  •   catch (NumberFormatException e)
    
  •   {
    
  •   	PacketSendUtility.sendMessage(admin, "You have wrong Kinah Quantity. (Max: 2,147,483,647 Kinah)");
    
  •   	return;
    
  •   }
    
  •   Player target = null;
    
  •   if (params.length == 2)
    
  •   {
    
  •   	target = world.findPlayer(params[1]);
    
  •   	if (target == null)
    
  •   	{
    
  •   		PacketSendUtility.sendMessage(admin, "player" + params[1] + "is on offline.");
    
  •   		return;
    
  •   	}
    
  •   }
    
  •   else
    
  •   {
    
  •   	VisibleObject o = admin.getTarget();
    
  •   	if (!(o instanceof Player) || o == null)
    
  •   	{
    
  •   		target = admin;
    
  •   	}
    
  •   }
    
  •   Item item = itemService.newItem(itemID,itemCount);
    
  •   Inventory inventory = target.getInventory();
    
  •   addedItem = inventory.getKinahItem();
    
  •   addedItem.increaseItemCount(itemCount);
    
  •   DecimalFormat decimalFormat = new DecimalFormat("###,###");
    
  •   String result = decimalFormat.format(itemCount);
    
  •   PacketSendUtility.sendPacket(target, new SM_INVENTORY_UPDATE(Collections.singletonList(addedItem)));
    
  •   if(addedItem == null)
    
  •   {
    
  •   	PacketSendUtility.sendMessage(admin, "You can't add Kinah.");
    
  •   }
    
  •   else
    
  •   {
    
  •   	if (target.equals(admin))
    
  •   	{
    
  •   		PacketSendUtility.sendMessage(admin, "You have acquired" + result + " Kinah.");
    
  •   	}
    
  •   	else
    
  •   	{
    
  •   		PacketSendUtility.sendMessage(admin, "You added" + result + "Kinah to player " + target.getName());
    
  •   		PacketSendUtility.sendMessage(target, "You have acquired " + result + " Kinah.");
    
  •   	}
    
  •   }
    
  • }
    +}
    Index: AE-go_GameServer/src/com/aionemu/gameserver/configs/AdminConfig.java
    ===================================================================
    — AE-go_GameServer/src/com/aionemu/gameserver/configs/AdminConfig.java (revision 847)
    +++ AE-go_GameServer/src/com/aionemu/gameserver/configs/AdminConfig.java (working copy)
    @@ -26,6 +26,9 @@

    @Property(key = “gameserver.administration.command.add”, defaultValue = “3”)
    public static int COMMAND_ADD;

  • @Property(key = “gameserver.administration.command.addkinah”, defaultValue = “3”)

  • public static int COMMAND_ADDKINAH;

    @Property(key = “gameserver.administration.command.ai”, defaultValue = “3”)
    public static int COMMAND_AI;
    [/code]
    Que faire svp ?

Salut,

Les demandes d’aide sont à faire dans Assistance Debian, pas dans Trucs & Astuces où tu donneras des solutions toutes faites de ta blanche main :slightly_smiling:

C’est pas très compliqué, par exemple ici un patch pour dmenu:

$ ls
dmenu-4.0/      dmenu-4.0-vertical_meillo.diff 
$ patch -p0 < dmenu-4.0-vertical_meillo.diff 
patching file dmenu-4.0/config.mk
patching file dmenu-4.0/dmenu.1
patching file dmenu-4.0/dmenu.c
$ echo 'fini'

Ah mince désolé >__< si vous pouviez me déplacer :s

Euuh a quoi peuvent me servir les dmenu ??

je veux juste pouvoir patcher tranquillement moi ^^

Sa me fais plein de reject :s

[quote=“Knucky”]C’est pas très compliqué, [size=200]par exemple[/size] ici un patch pour dmenu:
[/quote]

T’as besoin d’un café je crois :wink:

On va dire que tu as un répertoire qui contient ceci :

$ ls laousontlessourcesetlepatch/
AE-go_GameServer/       lesuperpatch.diff

Bon, ton patch est à appliquer sur un répertoire (plusieurs fichiers indiqués), et le nom du répertoire cible est le même dans le patch et dans ton arborescence, ça facilite les choses :slightly_smiling:

Alors dans ce cas il suffit de faire:

$ cd laousontlessourcesetlepatch/
$ patch -p0 < lesuperpatch.diff

okay !! Mais c’est bien sa le pb >__<

C’est ce que j’ai fais pour que toute ces erreurs s’affichent :confused:
J’ai trois ou quatre fois la même chose (avec des lignes différentes bien sur) mais quand je tape le chemin, sa me met not found >__<

[quote=“baddark”]okay !! Mais c’est bien sa le pb >__<

C’est ce que j’ai fais pour que toute ces erreurs s’affichent :confused:
J’ai trois ou quatre fois la même chose (avec des lignes différentes bien sur) mais quand je tape le chemin, sa me met not found >__<[/quote]

T’es sur que ce patch est pour la bonne version ?

Ensuite, as tu modifié quelque chose dans le répertoire contenant les sources AVANT de patcher ? Si oui, tu recommences à 0 :wink:

Oui pour créer le patch avec la commande svn diff > patch.patch

J’ai reset le dossier et voulu appliquer le patch mais toujours le même problème

Euuh et pour la version c’est a dire ?

Et maintenant sa me met sa comme erreur <__< (cetait bien un pb de version apparemment mais la :s)

Hunk #1 FAILED at 1. Hunk #2 FAILED at 208. Hunk #3 FAILED at 225. Hunk #4 FAILED at 241. Hunk #5 FAILED at 269. Hunk #6 FAILED at 285. Hunk #7 FAILED at 295. Hunk #8 FAILED at 346. Hunk #9 FAILED at 363. Hunk #10 FAILED at 379. Hunk #11 FAILED at 430. Hunk #12 FAILED at 446. Hunk #13 FAILED at 516. Hunk #14 FAILED at 570. Hunk #15 FAILED at 578. Hunk #16 FAILED at 586. Hunk #17 FAILED at 656. Hunk #18 FAILED at 700. Hunk #19 FAILED at 708. Hunk #20 FAILED at 716. Hunk #21 FAILED at 1029. Hunk #22 FAILED at 1058. Hunk #23 FAILED at 1122. Hunk #24 FAILED at 1144. Hunk #25 FAILED at 1921. Hunk #26 FAILED at 2009.