[TOOL 4 CHEFS] kitchen UPDATE ONLY NEW EXT batch file (EVK & OSK compatible)

Search This thread

HD2Owner

Inactive Recognized Developer
Oct 9, 2009
2,342
2,475
Neuhausen am Rheinfall
only new ext-pkg's to a other kitchen (language import support is coming...).

a friend of mine wrote a little bat-file for me and i want to share it with you.
the creator insisted to call it bloody rudimentary but i think it's quite useful.
he wants to stay anonymous... :)

around two hours of brainwork (i remember the command for this... what was it again?) and notepad.exe to create this from scratch.

you only need to adjust the two paths at the beginning.
the batch searches for same packets (exact name matches) and ignores them.
a txt will pop up showing only the new packages.
you can edit this list (only delete pks but don't change entries).
save and close after you removed the lines you don't want to import.
batch will create a temp workfolder in c: (it will pop up once copying is finished).
at this point you can rename the folders (add *_photon_1.36 at the end for example)
and add missing language sub-folders.
if you are done, press any key at the cmd window and all the edited/renamed package folders will be moved to the ext-folder in the destination kitchen (_NewPackages folder).

example (if you want to update only new ext from 1.36 into 1.11 kitchen):
-kitchen1 (source kitchen) photon 1.36 htc
-kitchen2 (destination kitchen) photon 1.11 vodafone

tested and working with oskitchen1.31beta10 file-/folder-structure.

take this code and save it into a txt file. rename it to *.bat and adjust the paths.

Code:
@echo off
REM ------- EDITABLE SECTION

SET L_SOURCEPATH="[COLOR="Red"]X:\osKitchen Zero v1.31beta10_1.36SOURCE\Sources\Devices\HTC HD Mini\EXT Packages\HTC HD Mini Packages\[/COLOR]"
SET L_TARGETPATH="[COLOR="Red"]X:\osKitchen Zero v1.31beta10_1.11DESTINATION\Sources\Devices\HTC HD Mini\EXT Packages\HTC HD Mini Packages\[/COLOR]"

REM ------ END

SET L_WORKPATH=C:\SCRWORK
MKDIR %L_WORKPATH%
SET SCRFILE=%L_WORKPATH%\packets_source.txt
SET TGTFILE=%L_WORKPATH%\packets_target.txt
SET ACTFILE=%L_WORKPATH%\PKG2COPY.TXT
del %ACTFILE%>nul
CD %L_SOURCEPATH%
DIR /B>%SCRFILE%
CD \
CD %L_TARGETPATH%
DIR /B>%TGTFILE%
CD \
  FOR /F "delims=" %%I IN (%SCRFILE%)  DO (
  REM <--------------------------------------------------------------
  REM insert logic here to select packages i.e. package numbers
  FINDSTR /C:"%%I" %TGTFILE%>nul&& ECHO Exact name match. || ECHO "%%I">>%ACTFILE%
REM insert some better logic here duh!
  REM <--------------------------------------------------------------
  )
CLS
ECHO !!!! Remove packages you dont want to copy from list but RETAIN LINE FORMAT !!!!
ECHO !!!! Save and close List to continue!!!!
  start /w notepad %L_WORKPATH%\PKG2COPY.TXT
REM hier: Collect packages based on pkg2copy.txt
  CD %L_SOURCEPATH%
  FOR /F "delims=" %%I IN (%ACTFILE%)  DO (
  xcopy /E /Y /H /I %%I %L_WORKPATH%\PRECOPY\%%I
  )
CLS
ECHO !!!!Edit Folders now!!! Add langs etc.. press any key to continue and copy edited folders to destination (_NewPackages)
  REM <--------------------------------------------------------------
  REM i.E. delete... rename....
  explorer %L_WORKPATH%\PRECOPY\
  REM automate it duh!
  pause
  REM <--------------------------------------------------------------

REM !!!  ACTION - Copy from Precopy to Target Folder (Targetpath\_NewPackages)
 xcopy /E /H /Y /I %L_WORKPATH%\PRECOPY\*.* %L_TARGETPATH%\_NewPackages\
 rmdir /s /q %L_WORKPATH%
 explorer %L_TARGETPATH%
 CD \
 
Last edited:

jjblaster3

Inactive Recognized Developer
Jan 4, 2009
853
87
wow this tool is awesome, its amazing how a simple batch file created by notepad can do so much functionality..
gonna use this right now :)
thanks..
 

HD2Owner

Inactive Recognized Developer
Oct 9, 2009
2,342
2,475
Neuhausen am Rheinfall
my opinion:

many xda-chef's would use it if they would know about it's existence..

please help me to keep this thread alive so all chefs can see it better...

tell your favorite chefs to take a look at this thread. thanks.
 
Last edited:

af974

Retired Recognized Developer / Retired Forum Mod
Jan 22, 2008
4,934
1,683
Redmi Note 8
I didnt try it yet but sounds like a very life saver tool, got one week sticky for let other chefs to check it.

Thanks for sharing.

@ mods: i will take care of unsticky it @ 04 August.
 
Last edited:

Laurentius26

Inactive Recognized Developer
Nov 22, 2005
7,970
1,151
I'm sorry but I've read the intro 3 times and still don't know what it does. :eek:
 

HD2Owner

Inactive Recognized Developer
Oct 9, 2009
2,342
2,475
Neuhausen am Rheinfall
feel free to test it. no harm done.

source and destination folders stay untouched.

only the (not exact name match - packets that aren't already in the destination kitchen) packets you don't delete from the pop-up list will be copied to the destination kitchen ext folder (_NewPackages subfolder).
 

Laurentius26

Inactive Recognized Developer
Nov 22, 2005
7,970
1,151
I will give it a shot when I'm back from holiday mate.

Thanks for sharing with us. ;)

feel free to test it. no harm done.

source and destination folders stay untouched.

only the (not exact name match - packets that aren't already in the destination kitchen) packets you don't delete from the pop-up list will be copied to the destination kitchen ext folder (_NewPackages subfolder).
 

NRGZ28

Retired Senior Mod & Senior RD
Apr 6, 2007
10,512
9,977
XDA-Developers
my opinion:

many xda-chef's would use it if they would know about it's existence..

please help me to keep this thread alive so all chefs can see it better...

tell your favorite chefs to take a look at this thread. thanks.


This is all nice and cool.. but what happened to porting your packages MANUALLY and actually looking at them before you put them in your kitchen ? You can't tell me this is how you cook a ROM... you run this batch file and blindly move over "newer" packages to your kitchen ? Wow... I believe packages need to be looked over and brought it one by one to insure compatibility first.
 

HD2Owner

Inactive Recognized Developer
Oct 9, 2009
2,342
2,475
Neuhausen am Rheinfall
This is all nice and cool.. but what happened to porting your packages MANUALLY and actually looking at them before you put them in your kitchen ? You can't tell me this is how you cook a ROM... you run this batch file and blindly move over "newer" packages to your kitchen ? Wow... I believe packages need to be looked over and brought it one by one to insure compatibility first.

you are right... that's why the tool moves the new ext folders into a sub-folder (_NewPackages).

cooks still need to add compatible lang sub-folders and maybe adjust some keys in the rgu's.

this batch-file is only around a week old. so it's basically new.

the main reason for it's existence is to remove the manual package comparison wich is very time-consuming (detection of already present packages).

of course cooks need to check the new ext like they would need to do when updating them manually.

in my personal kitchen i adjust the ext folder names as following:

Album_3_2_19203733_0_leo_1.66
Album_3_2_20132625_0_leo_2.13
Album_3_2_20161229_00_leo_3.04
Album_3_2_20171628_00_huashan_0.90

this way i always know where the ext's in my kitchen are coming from.
the batch file detection still works when adjusting the end of the folder names.

for example:
source kitchen-Album_3_2_19203733_0
destination kitchen-Album_3_2_19203733_0_leo_1.66

the album folder will still be ignored even after you changed the folder name of the already imported package to Album_3_2_19203733_0_leo_1.66.

just don't change/rename the blue part (original package name)
 
Last edited:

NRGZ28

Retired Senior Mod & Senior RD
Apr 6, 2007
10,512
9,977
XDA-Developers
you are right... that's why the tool moves the new ext folders into a sub-folder (_NewPackages).

cooks still need to add compatible lang sub-folders and maybe adjust some keys in the rgu's.

this batch-file is only around a week old. so it's basically new.

the main reason for it's existence is to remove the manual package comparison wich is very time-consuming (detection of already present packages).

of course cooks need to check the new ext like they would need to do when updating them manually.

in my personal kitchen i adjust the ext folder names as following:

Album_3_2_19203733_0_leo_1.66
Album_3_2_20132625_0_leo_2.13
Album_3_2_20161229_00_leo_3.04
Album_3_2_20171628_00_huashan_0.90

this way i always know where the ext's in my kitchen are coming from.
the batch file detection still works when adjusting the end of the folder names.

for example:
source kitchen-Album_3_2_19203733_0
destination kitchen-Album_3_2_19203733_0_leo_1.66

the album folder will still be ignored even after you changed the folder name of the already imported package to Album_3_2_19203733_0_leo_1.66.

just don't change/rename the blue part (original package name)


That's cool I guess... but it still seems like a lot to do, for such a simple operation as replacing a package with a newer one. I personally use beyond compare. It's a MUST have tool for chefs. It's great once you get to know how to use it.
 

HD2Owner

Inactive Recognized Developer
Oct 9, 2009
2,342
2,475
Neuhausen am Rheinfall
That's cool I guess... but it still seems like a lot to do, for such a simple operation as replacing a package with a newer one. I personally use beyond compare. It's a MUST have tool for chefs. It's great once you get to know how to use it.

i bought beyondcompare too. it's a must have for chef's if you ask me too.. :)

lot to do?? did you actually try the batch-file??? :)

-adjust the 2 paths in the batch
-remove the lines you dont want to import (from the pop-up txt file - save and close to continue)
-adjust packages (insert lang subfolders and rename packages in the pop up temp folder)
-press any key (dos window) to move adjusted packages from temp folder to sub-folder "_NewPackages" in destination kitchen

for me, this batch is a real time-saver........ :)
and i dont even have to use beyondcompare for this specific task anymore..

btw:
i will try to adjust the batch to show a pop-up of the destination-kitchen too when the temp folder is showing (so you dont have to open it manually to pick lang folders).
 
Last edited: