mirror of https://gitlab.com/nakst/essence
				
				
				
			better support for automated port building
This commit is contained in:
		
							parent
							
								
									b9e2ff0fb7
								
							
						
					
					
						commit
						9c12e5df11
					
				
							
								
								
									
										14
									
								
								util/build.c
								
								
								
								
							
							
						
						
									
										14
									
								
								util/build.c
								
								
								
								
							|  | @ -1466,7 +1466,11 @@ void DoCommand(const char *l) { | |||
| 		printf(ColorNormal); | ||||
| 	} else if (0 == memcmp(l, "a2l ", 4)) { | ||||
| 		AddressToLine(l + 3); | ||||
| 	} else if (0 == strcmp(l, "build-port")) { | ||||
| 	} else if (0 == strcmp(l, "build-port") || 0 == memcmp(l, "build-port ", 11)) { | ||||
| 		bool alreadyNamedPort = l[10] == ' '; | ||||
| 		char *l2 = NULL; | ||||
| 
 | ||||
| 		if (!alreadyNamedPort) { | ||||
| 			printf("\nAvailable ports:\n"); | ||||
| 			DIR *directory = opendir("ports"); | ||||
| 			struct dirent *entry; | ||||
|  | @ -1492,12 +1496,18 @@ void DoCommand(const char *l) { | |||
| 			} | ||||
| 
 | ||||
| 			printf("\nEnter the port to be built: "); | ||||
| 		char *l2 = NULL; | ||||
| 			size_t pos; | ||||
| 			getline(&l2, &pos, stdin); | ||||
| 			l2[strlen(l2) - 1] = 0; | ||||
| 		} else { | ||||
| 			l2 = (char *) l + 11; | ||||
| 		} | ||||
| 
 | ||||
| 		CallSystemF("ports/%s/port.sh", l2); | ||||
| 
 | ||||
| 		if (!alreadyNamedPort) { | ||||
| 			free(l2); | ||||
| 		} | ||||
| 	} else if (0 == memcmp(l, "get-source ", 11)) { | ||||
| 		if (CallSystem("mkdir -p bin/cache && rm -rf bin/source")) { | ||||
| 			exit(1); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 nakst
						nakst