Comments (8)
If given a relative path, we really should be searching only in these directories, and in this order:
- The current recipe's directory ("RECIPE_DIR")
- The directory of the ParentRecipe (if any)
- The directory of the ParentRecipe's ParentRecipe (if any)
- and so on until there are no more ParentRecipes.
We should only be searching cwd if the recipe or one of its parents lives in the cwd.
from autopkg.
After looking at your change I think I see the problem.
if os.path.exists(relpath)
would return an item in the cwd, which was not the intention; I think the intention was "if this is actually a full path pointing to a file/directory, use it"
from autopkg.
autopkg/Code/autopkglib/PkgCreator.py
Lines 102 to 107 in d95dff2
Since we don't call self.find_path_for_relpath(value) if the path starts with "/", I think the problem is then avoided.
I think you should merge the change and do a new release.
from autopkg.
Yep. I also hadn't thought about whether RECIPE_CACHE_DIR
should or shouldn't be there, but now that you mention it, I'd say it makes sense for it to be removed as well.
The cache dir doesn't have anything to do with a recipe unless there's some special logic going on in staging files, in which case %RECIPE_CACHE_DIR%
should be explicitly given.
from autopkg.
Not 100% sure either way (whether RECIPE_CACHE_DIR should be searched or not).
I think it might be useful to eliminate a lot of boiler-plate things in recipes; I think a common pattern is to start with a template item in the RECIPE_DIR, copy it to RECIPE_CACHE_DIR and modify it, then pass it to a processor like PkgCreator.
from autopkg.
That's true, but then that behavior seems too ambiguous to me - whether it will use the cache dir or the recipe dir is just implied and not obvious just from looking at the path in pkg_request
. Having multiple lines all with %RECIPE_CACHE_DIR%
is a bit noisy, but then it's very clear what the input path is.
Maybe you have a modified Resources folder in the cache and a stock unmodified Scripts folder in the recipe, for example..
from autopkg.
"Maybe you have a modified Resources folder in the cache and a stock unmodified Scripts folder in the recipe, for example.."
And a search order of
RECIPE_CACHE_DIR
RECIPE_DIR
(ParentRecipe dirs)
would do the right thing in this case.
I don't feel particularly strongly about this; since we do have access to a RECIPE_CACHE_DIR variable we can use it; it's harder to usefully subclass recipes if all resources must live in the RECIPE_DIR and not in any parent recipe's dir.
from autopkg.
Ok, sounds good. We can always revisit this later if it becomes an issue.
Merged the changes and made a new release of 0.2.1.
from autopkg.
Related Issues (20)
- Fork jc0b-recipes HOT 5
- audit verb with plist output includes standard output
- Expose on-disk GitHub token as a variable for use in processors
- Add members to recipe repo team HOT 1
- Re-implement recipe chain trust verification
- Generating the Recipe Map for the first time is very slow
- GitHubReleasesInfoProvider additional functionality - raise a warning if a repo has been archived or disabled. HOT 2
- Add repo pandemicus-recipes HOT 1
- FR: Mark certain fields as non-logging/debug only. HOT 4
- Offering a new recipe list HOT 4
- Repo add bryanheinz-recipes HOT 3
- Add repo ccaviness-recipes HOT 3
- Trouble adding new recipes HOT 2
- autopkglib.ProcessorError: curl: (22) The requested URL returned error: 401 HOT 6
- Add recipe repo gilburns-recipes HOT 1
- AppPkgCreator breaks code signature on info.plist HOT 7
- Copier fails to mount DMG with wildcard path HOT 2
- AppPkgCreator summary error message inaccurate for invalid string substitution in argument
- Please add my WorkspaceOneImporter repo to the AutoPkg org HOT 4
- Add users to the AutoPkg Org HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autopkg.