File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1264,8 +1264,22 @@ int main(int argc, char **argv) {
12641264 registry_lookup (_swap_venv , swap_ver , swap_py , sizeof (swap_py ));
12651265 if (swap_py [0 ] && file_exists (swap_py )) {
12661266 if (debug ) fprintf (stderr , "[C-DISPATCH] swap shim → execv %s\n" , swap_py );
1267- argv [0 ] = swap_py ;
1268- execv (swap_py , argv );
1267+ if (strcmp (prog , "pip" ) == 0 ) {
1268+ /* pip: execv python -m pip <args> */
1269+ int argc = 0 ;
1270+ while (argv [argc ]) argc ++ ;
1271+ char * * new_argv = malloc ((argc + 3 ) * sizeof (char * ));
1272+ new_argv [0 ] = swap_py ;
1273+ new_argv [1 ] = "-m" ;
1274+ new_argv [2 ] = "pip" ;
1275+ for (int i = 1 ; i < argc ; i ++ )
1276+ new_argv [i + 2 ] = argv [i ];
1277+ new_argv [argc + 2 ] = NULL ;
1278+ execv (swap_py , new_argv );
1279+ } else {
1280+ argv [0 ] = swap_py ;
1281+ execv (swap_py , argv );
1282+ }
12691283 perror ("omnipkg: execv swap python failed" );
12701284 exit (1 );
12711285 }
You can’t perform that action at this time.
0 commit comments