)\r
)\r
)\r
+)\r
goto :eof\r
\r
\r
echo %1\r
echo %2\r
cd %1\r
-%base_dir%\rpm2cpio %2\r
+%base_dir%\rpm2cpio -x %2\r
exit /b\r
\r
:extract_2pkgs\r
echo %2\r
echo %3\r
cd %1\r
-call %base_dir%\rpm2cpio %2\r
-call %base_dir%\rpm2cpio %3\r
+call %base_dir%\rpm2cpio -x %2\r
+call %base_dir%\rpm2cpio -x %3\r
exit /b\r
+\r
+:list_pkg\r
+echo %1\r
+echo %2\r
+cd %1\r
+%base_dir%\rpm2cpio -l %2\r
+exit /b
\ No newline at end of file
@echo off\r
-set base_dir=%~dp0\r
+if "%1"=="-x" (\r
+goto pkg_check\r
+) else (\r
+if "%1"=="-l" (\r
+goto pkg_check\r
+) else (\r
+echo "unknown option!"\r
+exit /b 1\r
+)\r
+)\r
+)\r
\r
-if not '%1'=='' (\r
-if exist %1 goto args_ok\r
+:pkg_check\r
+if not "%2"=="" (\r
+if exist %2 goto args_ok\r
)\r
echo "no package supplied"\r
exit /b 1\r
\r
:args_ok\r
-set pkg=%1\r
+set pkg=%2\r
\r
setlocal enabledelayedexpansion\r
set count=1\r
set leadsize=96\r
set /a o=%leadsize%+8\r
-for /f "tokens=2-9" %%a in ('%base_dir%\od -j %o% -N 8 -t u1 %pkg%') do (\r
+for /f "tokens=2-9" %%a in ('od -j %o% -N 8 -t u1 %pkg%') do (\r
if !count!==2 goto endod\r
set var1=%%a\r
set var2=%%b\r
set /a o=%o% + %sigsize% + ( 8 - ( %sigsize% %% 8 ) ) %% 8 + 8\r
setlocal enabledelayedexpansion\r
set count=1\r
-for /f "tokens=2-9" %%a in ('%base_dir%\od -j %o% -N 8 -t u1 %pkg%') do (\r
+for /f "tokens=2-9" %%a in ('od -j %o% -N 8 -t u1 %pkg%') do (\r
if !count!==2 goto end2od\r
set var1=%%a\r
set var2=%%b\r
set /a hdrsize=8 + 16 * %il% + %dl%\r
set /a o=%o% + %hdrsize%\r
\r
-%base_dir%\dd if=%pkg% ibs=%o% skip=1 2>nul | %base_dir%\gzip -d | %base_dir%\cpio -i --make-directories --preserve-modification-time 2>nul\r
+if "%1"=="-x" (\r
+dd if=%pkg% ibs=%o% skip=1 2>nul | gzip -d | cpio -i --make-directories --preserve-modification-time 2>nul\r
+) else (\r
+if "%1"=="-l" (\r
+dd if=%pkg% ibs=%o% skip=1 2>nul | gzip -d | cpio -t\r
+)\r
+)\r
+\r